Skip to content

Commit

Permalink
Made the log-in/out handlers update them-self
Browse files Browse the repository at this point in the history
  • Loading branch information
KlasJoensson committed Aug 14, 2012
1 parent 4391318 commit c1580a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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,9 @@
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.internal.commands.CommandService;
import org.eclipse.ui.internal.commands.CommandServiceFactory;
import org.eclipse.ui.services.IEvaluationService;

public class LogoutHandler extends AbstractHandler {
Expand All @@ -19,8 +22,10 @@ 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 c1580a9

Please sign in to comment.