plugin is not run [message #437267] |
Mon, 26 September 2005 15:58 |
Eclipse User |
|
|
|
Originally posted by: merkuriev_sergey.mail.ru
I try to uderstand how to wite Eclipse plugins and I found one problem.
When I run my code then I can see only Exlipse "simple" application
without main plugin. None methods inside my code did not run.
Details:
I had writen plugin for Eclipse. Created new configuration to run in
"Eclipse application" branch and had set following options:
1. There is Runtime tab the "Exported packages" of project settings had
set to com.swtjface.RCPExample.
2. There is Main tab "run an application" had set to
org.eclipse.ui.ide.workbench
3. There is Plug-ins tab selected only main plugin and required plugins
and validated plug-in set:
Workspase plug-ins
com.swtjface.RCPExample
External Plug-ins
org.eclipse.ant.core
org.eclipse.core.commands
org.eclipse.core.extensions
org.eclipse.core.resources
org.eclipse.core.resources.compatibility
org.eclipse.core.win32
org.eclipse.core.runtime
org.eclipse.help
org.eclipse.jface
org.eclipse.osgi
org.eclipse.swt
org.eclipse.swt.win32.win32.x86
org.eclipse.ui
org.eclipse.ui.forms
org.eclipse.ui.ide
org.eclipse.ui.views
org.eclipse.ui.workbench
org.eclipse.ui.workbench.compatibility
org.eclipse.update.configurator
org.eclipse.update.core
org.eclipse.update.ui
This is main "plugin.xml" file:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="com.swtjface.RCPExample"
name="RCPExample Plug-in"
version="1.0.0"
provider-name="SWTJFACE"
class="com.swtjface.RCPExample.RCPExamplePlugin">
<runtime>
<library name="RCPExample.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.ui.forms"/>
</requires>
<extension point="org.eclipse.core.runtime.applications"
id="ExampleApplication">
<application>
<run class="com.swtjface.RCPExample.ExampleApplication"/>
</application>
</extension>
<extension point="org.eclipse.ui.views">
<view id="com.swtjface.RCPExample.ExampleView"
name="ExampleView"
class="com.swtjface.RCPExample.ExampleView">
</view>
</extension>
<extension point="org.eclipse.ui.perspectives">
<perspective
id="com.swtjface.RCPExample.ExamplePerspective"
name="ExamplePerspective"
class="com.swtjface.RCPExample.ExamplePerspective"/>
</extension>
</plugin>
/*---------------------------------------------------------- ---*/
public class ExampleApplication implements IPlatformRunnable {
public Object run(Object args) throws Exception {
WorkbenchAdvisor advisor = new ExampleAdvisor();
Display display = PlatformUI.createDisplay();
int code = PlatformUI.createAndRunWorkbench(display, advisor);
if (code == PlatformUI.RETURN_RESTART)
return IPlatformRunnable.EXIT_RESTART;
else
return IPlatformRunnable.EXIT_OK;
}
}
/*---------------------------------------------------------- ---*/
public class ExampleView extends ViewPart {
public void createPartControl(Composite parent) {
FormToolkit kit = new FormToolkit(parent.getDisplay());
Form form = kit.createForm(parent);
ColumnLayout layout = new ColumnLayout();
form.getBody().setLayout(layout);
ExpandableComposite exComp = kit.createExpandableComposite(form
.getBody(), ExpandableComposite.TWISTIE);
exComp.setText("The Eclipse Forms toolset is:");
exComp.setExpanded(true);
FormText ft = kit.createFormText(exComp, true);
exComp.setClient(ft);
String html = "<form><li>Useful</li><li>Powerful</li>"
+ "<li>Simple</li></form>";
ft.setText(html, true, false);
}
public void setFocus() {
}
}
/*---------------------------------------------------------- ---*/
public class ExamplePerspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editor = layout.getEditorArea();
layout.addView("RCPExample.ExampleView", IPageLayout.RIGHT, 0f, editor);
layout.setEditorAreaVisible(false);
layout.setFixed(true);
}
}
/*---------------------------------------------------------- ---*/
public class ExampleAdvisor extends WorkbenchAdvisor {
public String getInitialWindowPerspectiveId() {
return "com.swtjface.RCPExample.ExamplePerspective";
}
public void preWindowOpen(IWorkbenchWindowConfigurer configurer) {
configurer.setTitle("RCPExample");
configurer.setInitialSize(new Point(225, 250));
configurer.setShowMenuBar(false);
configurer.setShowStatusLine(false);
configurer.setShowCoolBar(false);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03506 seconds