public abstract class ToggleHandler
extends org.eclipse.core.commands.AbstractHandler
implements org.eclipse.ui.commands.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(org.eclipse.core.commands.ExecutionEvent event) |
void |
updateElement(org.eclipse.ui.menus.UIElement element,
java.util.Map parameters)
Update command element with toggle state
|
public final java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
throws org.eclipse.core.commands.ExecutionException
execute in interface org.eclipse.core.commands.IHandlerorg.eclipse.core.commands.ExecutionExceptionpublic void updateElement(org.eclipse.ui.menus.UIElement element,
java.util.Map parameters)
updateElement in interface org.eclipse.ui.commands.IElementUpdater