score:1
the solution involves having the command handler implement the ielementupdater interface. the ui element can then be updated as so:
public void updateelement(uielement element, map parameters)
{
element.setchecked(isselected);
}
updateelement is called as part of a ui refresh which can be invoked from the handler's execute command as so:
icommandservice service = (icommandservice) handlerutil
.getactiveworkbenchwindowchecked(event).getservice(
icommandservice.class);
service.refreshelements(event.getcommand().getid(), null);
lots more info here (see radio button command and update checked state entries)
score:1
maybe things have changed, maybe there's a difference between rcp and an eclipse plug-in, but i just set the style of my action to toggle
, and it handled the toggling automatically. you can see the source code on github.com.
<action
class="live_py.enableaction"
id="live-py.enable.action"
label="li&ve coding"
menubarpath="pygeneralmenu/pynavigategroup"
state="false"
style="toggle">
to see whether the feature is currently enabled, i just look up the action by its id, and then call ischecked()
.
Source: stackoverflow.com
Related Query
- Toggling the state of a menu item
- Checking the state of menu items inside handlers
- How to display the label of an item on the drop-down menu
- How to display different labels for the same action in the a Project Explorer context menu item depending on the nature of the project selected?
- How do I call one eclipse menu item after the click of another menu item?
- Is there a way to change the text of an Action Bar Menu Item when I touch the menu item in Android?
- How to make a menu contribution item stays first before the additional Actions I added to the same menu?
- How to Display Menu Icons after clicking the More item in Android
- How can I configure the font size for the tree item in the package explorer in Eclipse?
- How do I find the "Preferences" menu in Eclipse in OS X?
- Is there a way in the Eclipse debugger to be notified when the state of a Java object changes?
- What is the state of C++ refactor support in Eclipse?
- What is the current state of the Scala Eclipse plugin?
- what's the state of go language IDE support?
- How to make On Item Selected not automatically choose the first entry
- How do I add "Android Project" to the File>New>_____ Menu in Eclipse?
- How to enable "Browse Deployment Location..." context menu item in Eclipse?
- Align Center Menu Item text in android
- Missing the ‘maven package’ menu entry in eclipse
- How to add a submenu entry to Eclipse Package Explorer context menu item using org.eclipse.ui.menus?
- Adding menu item in Eclipse
- Where is the "Maven->Update project configuration" menu item?
- Problems occurred while trying to save the state of the workbench in Eclipse
- Invalid item in the dependencies list after importing Android project from Eclipse
- Eclipse - Why the "Show Whitespace" toolbar item is grayed out in the XML editor but not in the Java one?
- Add "Class" option in the New menu in Java EE perspective
- The missing of the "build" option in right-click menu in Eclipse
- Enable/disable menu item in Eclipse plugin
- How can I get(know) the menuid of a specific menu in eclipse?
- How to setCurrentPage in ViewPager according to user selection & how do I know which list item called the activity
More Query from same tag
- Including source files from another C++ project in Eclipse CDT
- nested exception is java.sql.SQLTransactionRollbackException: At least one parameter to the current statement is uninitialized
- Eclipse gtkmm cross-compiling for Raspberry Pi, can't find file ft2build.h even though it does exist
- Caret position of Eclipse text editor
- Invalid element name:- display-name One of the following is expected:- distributable, context-param , filter, servlet, etc
- Master web.xml to use in all webapp projects
- Eclipse PMD automatic reparse once source file is updated?
- How can I back-up my java project in Eclipse?
- mysql and javax.naming.NamingException
- eclipse helios won't start
- Can't seem to input any integer values when running the app? It just shows result "grade c"
- Can't load beans XSD in Eclipse - SAXParseException
- Arduino on Eclipse
- Java Applet not updating in Eclipse's built in applet viewer
- How to implement ArcMenu for Android?
- Eclipse Indigo 3.7.2 - paste removes tabs and whitespace
- Convert Windows-1252 to UTF-16 in Java
- Eclipse don't display javadoc for javax
- Integrating Eclipse and GitHub
- Setting new text file line delimiter as Unix in Eclipse IDE
- Running a jsp website on Tomcat server in Eclipse - how to run a Main method upon server start-up?
- Eclipse Java: "The import com.jidesoft cannot be resolved"
- setting up a maven project in Juno Eclipse
- Eclipse GWT com.google.gwt.dev.DevMode adds -xstartOnFirstThread to VM_ARGS on Mac
- How to update the maven version without pom backup files
- Cannot get content assist in JSP editor
- How to install Tween Engine in Libgdx (Eclipse project)
- Eclipse IDE Learning Curve
- Erro: java.lang.NoSuchFieldError: LUCENE_5_2_1
- Error marker in Eclipse is not shown