Summary: | [Ruler] Toggle Ruler and Grid Commands are not active in editor right click menu | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] GEF | Reporter: | Anshu Jain <anshu.jain> | ||||
Component: | GEF-Legacy GEF (MVC) | Assignee: | Anthony Hunter <ahunter.eclipse> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | nyssen | ||||
Version: | 3.0 | ||||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Anshu Jain
2005-02-07 03:56:19 EST
Created attachment 17713 [details]
Patched plugin.xml to define the commands for the GEF Toggle actions
The purpose of defining a Command definition is to allow keybindings to be set and changed by the user. How does this affect the ability to put something on a menu? I don't see the connection. (In reply to comment #2) > The purpose of defining a Command definition is to allow keybindings to be set > and changed by the user. How does this affect the ability to put something on a > menu? I don't see the connection. -> Well the definition is serving more than its intended purpose by actually enabling the Command. The "handleAboutToShow" of a menumanager calls the update, which checks the "isVisible()" of a contribution item. This function returns true only is the associated CommandCallback returns isActive(String commandId) = true for the particular commandID.For those GEF Actions which dont have a commandId(derived from the actionDefinitinId of the Action class)the method returns a true. Like DeleteAction, DirectEditAction etc. However for those GEF actions which have a commandID(actionDefinitionId) set in their constructors, the method checks if the commandId is defined in the registry. This definition comes only by extension to the 'org.eclipse.ui.commands' point as i have suggested in the patch. Another possible solution without adding command extensions would be to not set the actionDefinitionId() in the constructor of these Actions which is this line. //setActionDefinitionId(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY); however i am not sure of the effect of this change on the behaviour of the actions elsewhere. Please let me know if i made myself clear. otherwise i will try to help by sending a test case along with a stack trace of the calls. Thanks. I wish all bug reporters had comments as clear and helpful as yours. We will add command definitions because it makes sense. It sounds like there is also a potential bug in the workbench. If an action has an unmapped definition ID set, you should get a warning message in the .log file. I downloaded the latest interation build. U seem to have added some command definitions, however the toggle_ruler_visibility, toggle_grid_visibility, toggle_snap_to_geometry, commands have not been added. These were the commands whose use led me to the bug in the first place. Any particular reason Unset target milestone as the specified one is already passed. |