Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Finding a trim contribution
Finding a trim contribution [message #335532] Mon, 13 April 2009 14:18 Go to next message
Kent Beck is currently offline Kent Beck
Messages: 11
Registered: July 2009
Junior Member
Once I have contributed an item to the status line trim, how can I find it
programmatically?

I have:

<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:org.eclipse.ui.trim.status">
<toolbar id="org.junit.max.ui.trim.toolbar">
<control
id="org.junit.max.ui.trim.widget"
class="org.junit.max.ui.internal.TrimContribution">
</control>
</toolbar>
</menuContribution>
</extension>

And my contribution is showing up just fine. I would like to find it later
with something like findView(String id).

Regards,

Kent Beck
Three Rivers Consulting, Inc.
Author of JUnit Max
Re: Finding a trim contribution [message #335546 is a reply to message #335532] Tue, 14 April 2009 08:25 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

Kent Beck wrote:
>
> And my contribution is showing up just fine. I would like to find it
> later with something like findView(String id).

There is no API to find the contributions later. The pattern that is
most prevalent in eclipse is that the control contribution (our status
contribution, for example) gets its data from a manager. ex:

protected Control createControl(Composite parent) {
final ImageHyperlink hyperlink = new ImageHyperlink(parent, SWT.NONE);
IStatusManager m = Activator.getDefault().getStatusManager();
hyperlink.setText(m.getLinkText());
m.addStatusListener(this);
return hyperlink;
}

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Enabling content assist using template proposals
Next Topic:Reload org.eclipse.ui.workbench.prefs in 3.4?
Goto Forum:
  


Current Time: Mon Apr 21 05:39:11 EDT 2014

Powered by FUDForum. Page generated in 0.01599 seconds