ControlContribution from toolbar:org.eclipse.ui.main.toolbar#dynamic [message #494596] |
Sat, 31 October 2009 21:16 |
Vuk Messages: 5 Registered: July 2009 |
Junior Member |
|
|
Hello all,
I'm intrested in providing a ControlContribution to my RCP application from a seperate plugin. So far I have a command button that is added to the toolbar via toolbar:org.eclipse.ui.main.toolbar#command. The button works fine. However when I try toolbar:org.eclipse.ui.main.toolbar#dynamic then I create a class that extends ControlContribution overriding createControl(). When the application launches I get:
org.eclipse.core.runtime.CoreException: Plug-in "xts.encdec" was unable to instantiate class "xts.encdec.PrimaryContributionControl".
Part of Plugin.xml
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions ">
<toolbar
id="xts.encdec.toolbars.main">
<command
commandId="xts.encdec.commands.go"
id="xts.encdec.menu.commands.go"
label="Go"
tooltip="Go">
</command>
<dynamic
class="xts.encdec.PrimaryContributionControl"
id="xts.encdec.menu.primarycontributioncontrol">
</dynamic>
</toolbar>
</menuContribution>
</extension>
PrimaryContributionControl.java:
package xts.encdec;
import org.apache.log4j.Logger;
import org.eclipse.jface.action.ControlContribution;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
import dtv.xts.log.TracerLevel;
public class PrimaryContributionControl extends ControlContribution {
private static final Logger LOG = Logger.getLogger(PrimaryContributionControl.class);
public PrimaryContributionControl(String id) {
super(id);
LOG.log(TracerLevel.GUI, "Calling private constructor.");
}
@Override
protected Control createControl(Composite parent) {
LOG.log(TracerLevel.GUI, "Creating toolbar for EncDec Plug-in...");
//Text text = new Text(parent, SWT.BORDER);
//return text;
return null;
}
}
Any insight to this error would be great. Ultimately I want a plugin to provide a combo box textfield etc from a seperate plugin, but I would like to define this from plugin.xml if at all possible. I hope I explained myself well enough, still new to the RCP scene.
Thanks!
Oh I should add I don't want to go through ApplicationActionBarAdvisor#fillCoolBar because this plugin may be removed from my RCP app at any time.
[Updated on: Sat, 31 October 2009 21:19] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03215 seconds