Skip to main content


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 18:18 Go to next message
Kent Beck is currently offline Kent BeckFriend
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 12:25 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
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: Thu Mar 28 21:42:17 GMT 2024

Powered by FUDForum. Page generated in 0.02358 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top