Posts Tagged ‘rcp’

Disable splash screen on your Netbeans Application

Wednesday, November 19th, 2008

Just add

run.args.extra=–nosplash

to the project.properties file

Netbeans Paint Application

Thursday, February 21st, 2008

My first try with the Netbeans Paint Application tutorial didn´t work as expected. For some reasong I got this stack trace when I tried to run it:

java.lang.IllegalStateException: Module was supposed to be OK: StandardModule:org.netbeans.modules.projectuiapi jarFile: C:\Program Files\NetBeans 6.0\ide8\modules\org-netbeans-modules-projectuiapi.jar
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1087)
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1104)
       at org.netbeans.ModuleManager.maybeAddToEnableList(ModuleManager.java:1104)
       at org.netbeans.ModuleManager.simulateEnable(ModuleManager.java:1048)
       at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:379)
       at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:341)
       at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:275)
       at org.netbeans.core.startup.Main.getModuleSystem(Main.java:171)
       at org.netbeans.core.startup.Main.start(Main.java:322)
[catch] at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
       at java.lang.Thread.run(Thread.java:619)

I managed to solve it although I don´t really know the cause.

  1. Download netbeans-6.0.1-200801291616-ml-platform.zip
  2. Unpack it in c:\netbeans (so there´s a c:\netbeans\platform7)
  3. Go to Tools -> Netbeans Platforms
  4. Click on Add platform
  5. Select c:\netbeans
  6. Finish
  7. Right click on PaintApp project and select Properties
  8. On the Libraries tab. Change the Netbeans Plaform to Netbeans Platform Dev (Build 200801291616)
  9. Select all modules but Core UI and Platform
  10. Rebuild and run

Eclipse Preference Page Extension Wizard troubleshooting

Friday, June 29th, 2007

Today I tried to add a Preference Page to an RCP application that I’m working on with no luck. After executing the Extension -> Add -> Extension Wizards -> Preference Page I end up with 3 new classes. But 2 of then have compilation errors, they refer to an unexisting PreferenceClass. After googling a bit I found this message in a mailing list describing the same exact problem:

Hello,

I ‘ve added preference page in my application using plugin.xml extensions template. Then, in a new package, Eclipse created 3 classes (Template preferences page extending FieldEditorPreferencePage, a preference constants class and a preference initializer class).

The template preferences page uses a PreferenceClass which doesn’t already exists… I suppose this class has to initialize the preference store, in the preference template class constructor, unsing the plugin instance of the product :

“setPreferenceStore(PreferenceClass.getDefault().getPreferenceStore());”

I’ve tried to extend the AbstractUIPlugin (I’ve read in differents articles from eclipse.org) to catch the plugin instance when it is created, but without succes (when to catch this single instance during startup of eclispe core runtime ?). Then I’ve found the existance of the WorkBenchPlugin class which holds this static instance, I used it, discarding PreferenceClass , but Eclispe tells me that the use of this class is discouraged.

Why ? How is it possible to store the plugin instance at startup ?

Thanks a lot for your help, frank

Then I found the solution, if you haven’t defined an Activator for the plugin yet it will not work. After creating an Activator for the plugin and rerunning the wizard all went fine.

New views don’t show up when using Eclipse RCP setSaveAndRestore

Monday, April 23rd, 2007

If you add a new view to an Eclipse RCP and when launch it the new view is not there you probably hit the problem described in this CT Arrington’s Weblog post.

The IWorkbenchConfigurer.setSaveAndRestore(true) called from your WorkbenchAdvisor can be the source of the problem. The Eclipse RCP platform is trying to restore the perspective from the serialized version stored on disk so it fails to load you new changes. You have several solutions [from the CT Arrington's Weblog post].

  1. Delete the target platform workspace data. tipically
...runtime-EclipseApplication\.metadata\.plugins\org.eclipse.ui.workbench\workbench.xml
  1. Set the Clear workspace data before launching in the run configuration. Run -> Run… -> Eclipse Application -> Main -> Workspace Data -> Clear workspace data before launching