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 |
|---|---|
Object |
execute(ExecutionEvent event) |
void |
updateElement(UIElement element,
Map parameters)
Update command element with toggle state
|
addHandlerListener, dispose, isEnabled, isHandled, removeHandlerListener, setEnabledpublic final Object execute(ExecutionEvent event) throws ExecutionException
execute in interface IHandlerExecutionExceptionpublic void updateElement(UIElement element, Map parameters)
updateElement in interface IElementUpdater