Bug 2672 - [UI] EC: Action delegate's concrete action should have same ID (1GHUJUZ)
Summary: [UI] EC: Action delegate's concrete action should have same ID (1GHUJUZ)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Unknown User CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:41 EDT by Nick Edgar CLA
Modified: 2005-01-18 16:45 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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