Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » rcp and plugin startup code
rcp and plugin startup code [message #333485] Mon, 15 December 2008 10:42 Go to next message
Markus Schindler is currently offline Markus SchindlerFriend
Messages: 30
Registered: July 2009
Member
Hello,

what is to best way to run initializing code in a rcp application and in
plugins?
I read that IStartup should not be used, so what is the prefered way?

For example I like to contribute a menu with IMenuService. This menu
should be avaible after startup.
Should I start this via a extension point from my rcp and if so, from
which method I should invoke this? Or should I start this via the plugins
activator (inside a WorkbenchJob)?

Any hints are welcome!

regards,
Markus
Re: rcp and plugin startup code [message #333499 is a reply to message #333485] Mon, 15 December 2008 19:34 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Markus Schindler wrote:
> Hello,
>
> what is to best way to run initializing code in a rcp application and in
> plugins?
> I read that IStartup should not be used, so what is the prefered way?
>
> For example I like to contribute a menu with IMenuService. This menu
> should be avaible after startup.

Well, normally you would simply contribute via org.eclipse.ui.menus ...
when it is necessary to instantiate it (as with a user showing a menu)
eclipse will). Why is this form of delayed startup not sufficient?

> Should I start this via a extension point from my rcp and if so, from
> which method I should invoke this? Or should I start this via the
> plugins activator (inside a WorkbenchJob)?

Within an RCP app you can always execute code in the WorkbenchAdvisor or
WorkbenchWindowAdvisor pre and post methods, so you don't usually need
to start up anything.

org.eclipse.ui.startup can be used if code really needs to start up (it
is run after that last post-startup advisor code) but usually you take
care to only run framework level startup (the less UI code you have in
an early startup plugin, the better). We generally discourage it since
early startup plugins are not good IDE citizens.

--
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:Actions and command handlers
Next Topic:Edit menu options do not get enabled for all views
Goto Forum:
  


Current Time: Tue Jul 16 10:58:26 GMT 2024

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

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

Back to the top