Skip to content

Commit

Permalink
Merge pull request #17 from KlasJoenssson/loginIcon2
Browse files Browse the repository at this point in the history
Login icon2
  • Loading branch information
goglepox committed Aug 14, 2012
2 parents 8318ad1 + 58fa088 commit 432f826
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 9 deletions.
Expand Up @@ -330,8 +330,7 @@ protected void fillCoolBar(ICoolBarManager coolBar) {
manager.add(helpAction);

}



private void removeUnwantedActions(){

String actionSetId = "org.eclipse.ui.edit.text.actionSet.navigation";
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 53 additions & 5 deletions plugins/net.bioclipse.usermanager/plugin.xml
Expand Up @@ -123,8 +123,9 @@
icon="icons/login_16.png">
<visibleWhen >
<test
property="net.bioclipse.usermanager.accountTypeExists"
value="true">
forcePluginActivation="true"
property="net.bioclipse.usermanager.accountTypeExists"
value="true">
</test>
</visibleWhen>
</command>
Expand All @@ -134,11 +135,12 @@
<command
commandId="net.bioclipse.usermanager.commands.logout"
label="Log Out"
icon="icons/login_16.png">
icon="icons/login_green_16.png">
<visibleWhen >
<test
property="net.bioclipse.usermanager.accountTypeExists"
value="true">
forcePluginActivation="true"
property="net.bioclipse.usermanager.isLoggedIn"
value="true">
</test>
</visibleWhen>
</command>
Expand All @@ -155,5 +157,51 @@
name="Account">
</wizard>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="toolbar:org.eclipse.ui.trim.status">
<toolbar
id="net.bioclipse.usermanager.toolbar1">
<command
commandId="net.bioclipse.usermanager.commands.login"
icon="icons/login_16.png"
mode="FORCE_TEXT"
style="push"
tooltip="Not logged in, click to logg in.">
<visibleWhen>
<test
forcePluginActivation="true"
property="net.bioclipse.usermanager.isLoggedIn"
value="false">
</test>
</visibleWhen>
</command>
<command
commandId="net.bioclipse.usermanager.commands.logout"
icon="icons/login_green_16.png"
mode="FORCE_TEXT"
style="push"
tooltip="Logged in, click to log out.">
<visibleWhen>
<test
forcePluginActivation="true"
property="net.bioclipse.usermanager.isLoggedIn"
value="true">
</test>
</visibleWhen>
</command>
<visibleWhen
checkEnabled="false">
<test
forcePluginActivation="true"
property="net.bioclipse.usermanager.accountTypeExists"
value="true">
</test>
</visibleWhen>
</toolbar>
</menuContribution>
</extension>

</plugin>
Expand Up @@ -11,6 +11,7 @@
import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.services.IEvaluationService;


Expand Down Expand Up @@ -47,6 +48,8 @@ public Object execute( ExecutionEvent event ) throws ExecutionException {
IEvaluationService es = (IEvaluationService)PlatformUI.getWorkbench().getService( IEvaluationService.class );
es.requestEvaluation( "net.bioclipse.usermanager.isLoggedIn" );

ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
commandService.refreshElements("net.bioclipse.usermanager.commands.logout", null);

return null;
}
Expand Down
Expand Up @@ -7,6 +7,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.services.IEvaluationService;

public class LogoutHandler extends AbstractHandler {
Expand All @@ -18,9 +19,11 @@ public Object execute( ExecutionEvent event ) throws ExecutionException {

IEvaluationService es = (IEvaluationService)PlatformUI.getWorkbench().getService( IEvaluationService.class );
es.requestEvaluation( "net.bioclipse.usermanager.isLoggedIn" );


ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
commandService.refreshElements("net.bioclipse.usermanager.commands.login", null);

return null;
}


}

0 comments on commit 432f826

Please sign in to comment.