tags:

views:

13

answers:

1

Hi!

I'm writing an Eclipse plug-in and I've bumped into an issue. Amongst others I'm creating a new custom perspective. I need to execute some code when the workbench loads. I'm using a WorkbenchAdvisor and putting the code in the initialize method. However as it is now it's not being called...

Apparently I need to call this PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor(); but I don't know where to put this... I can't put it in the createInitialLayout of the perspective because this is only called when the perspective is created for the first time.

Any ideas please? Thanks and regards, Krt_Malta

+1  A: 

You can use the startup extension point to run code before your plugin is loaded. You should place the extension in an seperate plugin, as all code inside the plugin with the startup extension is loaded after the workbench is started.

The interface to look for is org.eclipse.ui.IStartup.

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_startup.html

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/IStartup.html

Arne
I'm not sure about this... I think I need to load before/while the workbench is started.
Krt_Malta
On second thoughts, this worked :) Thanks a real lot! :)
Krt_Malta