Bug 36446 - [Contributions] widgets: Associating Actions with Buttons
Summary: [Contributions] widgets: Associating Actions with Buttons
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P5 enhancement with 1 vote (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2003-04-14 08:28 EDT by Joseph Khalil CLA
Modified: 2007-12-11 10:38 EST (History)
2 users (show)

See Also:


Attachments

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