Community
Participate
Working Groups
EC post "IAction ids for popup menu extensions" by MW on Aug 2, 2001. Here's an unexpected result: I have added several popup menu items to a couple of Java views - but not the Outline view :-( - and was expecting that when my correponding plugin run(IAction) method was called that the action.getId() method call would return the id matching the popup menu item just selected. The thought was that I could use that id for selecting the correct action to take. Instead all I get is a generic id (e.g. "PluginAction.8") which is of no use to me since I have no way of knowing what that id means. I have worked around the problem by using the setInitializationData method which returns the correct id, however I would have naturally expected the same id to be returned in the IAction object. Bug? NOTES: NE (8/2/01 3:49:07 PM) This does seem like a reasonable default. I'll file a PR and check with the author to see if there's any reason why we shouldn't do this. DS (8/7/01 11:05:55 AM) At some point during the development of the sorting algorithm for action delegates there was a reason to use a unique id. However, I can't remember what it is now and there is no clue from the code. This was a very rushed last minute change. To test the proposed change I added the following line to the constructor for ActionDescriptor and found the behavior seemed OK .. We should probably try the fix and test in house. public ActionDescriptor(IConfigurationElement actionElement, int targetType, Object target) { // Load attributes. id = actionElement.getAttribute(ATT_ID); ... // Create action. action = createAction(targetType, actionElement, target); action.setId(id); ... }
Changed ActionDescriptor to suit.
PRODUCT VERSION: 0.9