public abstract class ToggleHandler extends AbstractHandler implements IElementUpdater
<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/eclipse/2009_01_21_togglehandler/ http://eclipsesource.com/blogs/2009/01/15/toggling-a-command-contribution/
Constructor and Description |
---|
ToggleHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(ExecutionEvent event) |
void |
updateElement(UIElement element,
java.util.Map parameters)
Update command element with toggle state
|
addHandlerListener, dispose, isEnabled, isHandled, removeHandlerListener, setEnabled
public final java.lang.Object execute(ExecutionEvent event) throws ExecutionException
execute
in interface IHandler
ExecutionException
public void updateElement(UIElement element, java.util.Map parameters)
updateElement
in interface IElementUpdater