Bug 153625

Summary: [JFace] Action class needs setData/getData API
Product: [Eclipse Project] Platform Reporter: Brannon <brannonking>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P5 CC: susan
Version: 3.2Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Brannon CLA 2006-08-11 14:44:37 EDT
Whereas the Action class has a run function, it would be useful to have setData/getData functions available to reduce the need to extend the class.
Comment 1 Brannon CLA 2006-08-11 16:04:49 EDT
I should clarify that by "Action" I mean org.eclipse.jface.action.Action. And I apologize for posting this under the SWT component; I'm not sure where this issue belongs.
Comment 2 Boris Bokowski CLA 2006-08-15 11:24:34 EDT
Why don't you create your own subclass of Action that adds this capability?
Comment 3 Brannon CLA 2006-08-15 12:00:54 EDT
Subclassing Action to include getData/setData functionality is certainly the best workaround. I think, though, most people create a little class for each action where they pass in the parameters through the constructor. This leads to unnecessary code bloat. Adding setData/getData commands and support for the associated listeners to a class is not exactly easy when you cannot extend the existing SWT Widget class. I guess you could make a class that extends Widget that has an Action member.

Also, I have come to expect the SWT interface to exist on most objects I use in Eclipse, whether or not they are actually SWT. "Action" is very similar to "Widget". I think it would be a nice feature if we can make the jface widgets share the SWT interfaces where possible. This lowers the learning curve.
Comment 4 Susan McCourt CLA 2006-08-15 12:29:38 EDT
I'm not sure we want to introduce this feature to Action given that the long-term (hopefully 3.3) plan is that actions migrate to the Commands/Handlers story.  Commands do have the ability to be parameterized.

Assigning this bug to PW for comment re: commands and if this is a valid request for Actions it should be forwarded to Duong.
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:13:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.