Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Load my plugin at startup in particular order
Load my plugin at startup in particular order [message #334525] Mon, 16 February 2009 04:55 Go to next message
Nayna Jain is currently offline Nayna JainFriend
Messages: 23
Registered: July 2009
Junior Member
Hi all,

I have written my own plugin to ask for some authentication required in
our case.

I wanted this plugin to run before any other plugin starts like CDT, JDT
etc.

When eclipse gets launched and is loading its other workbench plugins as
UI plugin, the same time I want it to start my plugin as well which is
supposed to be run as UI plugin.

I have used startup extension and implemented IStartup interface and
earlystartup() method of it. Though it runs when Eclipse gets launched but
I am facing following issues :-

1. It is started as one of the Worker thread, but I want it to be started
from UI thread i.e. (main / workebench) thread.
2. When Eclipse is launched with existing C/C++ projects in it, there is
no guarantee that my auth plugin gets loaded before CDT plugins. But I
want to assure that my plugin gets loaded first (though after core
platform plugins) and then CDT or other tool plugins. So, I want to ensure
this order.
3. I want this plugin to be launched always as part of UI thread.

Please help me out how can I achieve this ?


Thanks & Regards,
Re: Load my plugin at startup in particular order [message #334539 is a reply to message #334525] Mon, 16 February 2009 22:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/15/2009 11:55 PM, Nayna wrote:
> Hi all,
>
> I have written my own plugin to ask for some authentication required in
> our case.
>
> I wanted this plugin to run before any other plugin starts like CDT, JDT
> etc.
>
> When eclipse gets launched and is loading its other workbench plugins as
> UI plugin, the same time I want it to start my plugin as well which is
> supposed to be run as UI plugin.
>
> I have used startup extension and implemented IStartup interface and
> earlystartup() method of it. Though it runs when Eclipse gets launched
> but I am facing following issues :-
>
> 1. It is started as one of the Worker thread, but I want it to be
> started from UI thread i.e. (main / workebench) thread.
> 2. When Eclipse is launched with existing C/C++ projects in it, there is
> no guarantee that my auth plugin gets loaded before CDT plugins. But I
> want to assure that my plugin gets loaded first (though after core
> platform plugins) and then CDT or other tool plugins. So, I want to
> ensure this order.
> 3. I want this plugin to be launched always as part of UI thread.

First of all, you can use Display.asyncExec() to run a job on the UI thread.
Second, Eclipse does not allow for specifying particular ordering for
plugin activation. It is designed to be loosely coupled and
lazy-loading; ordering of plugins does not agree with those goals.
If you are building an RCP as opposed to just plugins that can be
installed into any Eclipse, there are some options to trigger
authentication at the "beginning," but it is not clear if that is what
you are doing.

Eric
Re: Load my plugin at startup in particular order [message #334565 is a reply to message #334525] Wed, 18 February 2009 11:21 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi,

With 3.5 M5 you can set start levels.

see http://download.eclipse.org/eclipse/downloads/drops/S-3.5M5- 200902021535/eclipse-news-M5.html

May be it was available before and the enhancement for M5 provides only a GUI, I don't know.

Regards,

Mariot


Nayna a écrit :
> Hi all,
>
> I have written my own plugin to ask for some authentication required in
> our case.
>
> I wanted this plugin to run before any other plugin starts like CDT, JDT
> etc.
>
> When eclipse gets launched and is loading its other workbench plugins as
> UI plugin, the same time I want it to start my plugin as well which is
> supposed to be run as UI plugin.
>
> I have used startup extension and implemented IStartup interface and
> earlystartup() method of it. Though it runs when Eclipse gets launched
> but I am facing following issues :-
>
> 1. It is started as one of the Worker thread, but I want it to be
> started from UI thread i.e. (main / workebench) thread.
> 2. When Eclipse is launched with existing C/C++ projects in it, there is
> no guarantee that my auth plugin gets loaded before CDT plugins. But I
> want to assure that my plugin gets loaded first (though after core
> platform plugins) and then CDT or other tool plugins. So, I want to
> ensure this order.
> 3. I want this plugin to be launched always as part of UI thread.
>
> Please help me out how can I achieve this ?
>
>
> Thanks & Regards,
>
Re: Load my plugin at startup in particular order [message #334594 is a reply to message #334525] Thu, 19 February 2009 15:29 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You need to do some auth ... and interact with the user (as in request a
password) or simply do calculations? Are you an RCP app or a plugin?

For an RCP app that needs to do something (like check a license) you can
set the startlevel for that plugin to start before most of the workbench
(but after OSGi) and do your calculations. Split out the auth part from
the UI part, so the UI part happens later.

If you need to open some kind of login dialog (user/password) consider
doing it in the Splash screen ... there are already examples of this.

There's also the option of using http://eclipse-jaas.sourceforge.net/
which I believe performs some authentication and then can prevent
plugins from loading (or control them).

If you are simply an eclipse plugin that expects to run in the SDK (IDE)
then you are limited in what you can do.

For non-ui license checking, you might still be able to specify your
start level. You won't have access to the splash screen, and you would
have to check eclipse-jaas to see what it supports in an IDE environment
(where you don't control the application or product yourself).

org.eclipse.ui.startup will start your plugin in a non-UI thread after
the workbench has been initialized, so it's common to use an
asyncExec(*) or UIJob(preferred) to post your actions to the UI thread.
The startup will be in no particular order, and almost always after
many of the standard components (CDT, JDT) have started.

Later,
PW

--
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:getService() without the UI?!
Next Topic:Wrapping broken in ScrolledForm with GridLayout?
Goto Forum:
  


Current Time: Sun Jun 30 13:51:28 GMT 2024

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

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

Back to the top