Elexis API documentation
Version 2.1.6 as of December 11 2011

de.ralfebert.rcputils.handler
Class ToggleHandler

java.lang.Object
  extended by AbstractHandler
      extended by de.ralfebert.rcputils.handler.ToggleHandler

public abstract class ToggleHandler
extends AbstractHandler

Use this handler for style="toggle" command contributions. You need to declare a state for your command to use ToggleHandler:

 <command id="somecommand" name="SomeCommand">
         <state class="org.eclipse.jface.commands.ToggleState" id="STYLE"/>
 </command>
 
The id="STYLE" was chosen because of IMenuStateIds.STYLE - maybe this will work without any Handler foo in later Eclipse versions. See http://www.ralfebert.de/blog/eclipsercp/togglehandler/ http://eclipsesource.com/blogs/2009/01/15/toggling-a-command-contribution/

Author:
Ralf Ebert

Constructor Summary
ToggleHandler()
           
 
Method Summary
 java.lang.Object execute(ExecutionEvent event)
           
 void updateElement(UIElement element, java.util.Map parameters)
          Update command element with toggle state
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToggleHandler

public ToggleHandler()
Method Detail

execute

public final java.lang.Object execute(ExecutionEvent event)
                               throws ExecutionException
Throws:
ExecutionException

updateElement

public void updateElement(UIElement element,
                          java.util.Map parameters)
Update command element with toggle state


Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis