Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 36446

Summary: [Contributions] widgets: Associating Actions with Buttons
Product: [Eclipse Project] Platform Reporter: Joseph Khalil <jkhalil>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: peter, remy.suen
Version: 2.1Keywords: helpwanted
Target Milestone: 3.4 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Joseph Khalil CLA 2003-04-14 08:28:32 EDT
Actions can be associated with Menu items , and tool bar items using 
MenuManager and ToolBarManager
but there is not way to associate Action with a regular button and obtaining a 
reference to that button
the closest thing is creating an ActionContributionItem with the desired action 
in its constructor , then filling the parent composite with 
ActionContributionItem.fill(Control parent)

this creats the button , but it doesn't return a reference to that button , so 
for example i can't give it any layout data
i suggest the ActionContributionItem.fill(Control parent) returns the created 
widget
Comment 1 Michael Van Meekeren CLA 2006-04-21 13:56:45 EDT
Moving Dougs bugs
Comment 2 Paul Webster CLA 2007-04-05 19:02:14 EDT
Assigning to component owner
PW
Comment 3 Peter Centgraf CLA 2007-11-14 20:17:47 EST
Changing the IContributionItem API seems like a bad idea.  The same result could be achieved by adding a getWidget() method to ActionContributionItem.  This would have a minimal impact on other consumers and would be in line with other methods available on this class.

	/**
	 * Returns the widget associated with this contribution item.
	 * 
	 * @return the widget
	 */
	public Widget getWidget() {
		return widget;
	}
Comment 4 Paul Webster CLA 2007-11-30 11:53:34 EST
Fixed in HEAD >20071130
PW
Comment 5 Paul Webster CLA 2007-12-11 10:38:22 EST
In I20071211-0010
PW