Bug 2672

Summary: [UI] EC: Action delegate's concrete action should have same ID (1GHUJUZ)
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Unknown User <unknown>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Nick Edgar CLA 2001-10-10 22:41:11 EDT
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);
	...
}
Comment 1 Unknown User CLA 2001-10-12 11:02:30 EDT
Changed ActionDescriptor to suit.
Comment 2 DJ Houghton CLA 2001-10-29 19:08:40 EST
PRODUCT VERSION:
0.9