Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Loading ready event
Loading ready event [message #331059] Fri, 22 August 2008 10:51 Go to next message
Klaus Schaefers is currently offline Klaus SchaefersFriend
Messages: 24
Registered: July 2009
Junior Member
Hi,

If would like to write a kind of "OnEditorOpen" listener. It should be
implemented as an IPartListener. I found out how to register it like this:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPart Listener(new
MyListener());

But I'm facing two problems now:

1) When I call this method too early, it crashes Eclipse. So I guess I can
only do the call when eclipse is loaded completely. How can I find out
that it is? Is there a hook or extension point?

2) If there is now extension point, how can I enforce that my plugin is
loaded?

Kind regards
Re: Loading ready event [message #331060 is a reply to message #331059] Fri, 22 August 2008 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mario.winterer.gmx.net

Klaus,

if you want to force your plugin to be activated on platform startup,
simple use the extension point "org.eclipse.ui.startup" in plugin
"org.eclipse.ui".

Mario


Klaus Schaefers schrieb:
> Hi,
>
> If would like to write a kind of "OnEditorOpen" listener. It should be
> implemented as an IPartListener. I found out how to register it like this:
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPart Listener(new
> MyListener());
>
> But I'm facing two problems now:
>
> 1) When I call this method too early, it crashes Eclipse. So I guess I
> can only do the call when eclipse is loaded completely. How can I find
> out that it is? Is there a hook or extension point?
>
> 2) If there is now extension point, how can I enforce that my plugin is
> loaded?
>
> Kind regards
>
Re: Loading ready event [message #331227 is a reply to message #331060] Thu, 28 August 2008 14:35 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Mario Winterer wrote:
> Klaus,
>
> if you want to force your plugin to be activated on platform startup,
> simple use the extension point "org.eclipse.ui.startup" in plugin
> "org.eclipse.ui".

And that being said, don't use org.eclipse.ui.startup ... See the other
thread on "Surpress Lazy loading of a plugin?"

It's really best not to use it. In RCP apps, you have other options
like the pre and post startup/open methods in your WorkbenchAdvisor and
WorkbenchWindowAdvisor.

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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Loading ready event [message #331259 is a reply to message #331227] Thu, 28 August 2008 15:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mario.winterer.gmx.net

Oh. Sorry. Didn't know!
But when this extension point shouldn't be used, how is not possible to
write a plugin for existing applications that requires early startup for
some reason (the usage data collection plugin
"org.eclipse.epp.usagedata.recording" uses this extension point too for
exactly that reason how I believe...)

Mario

Paul Webster schrieb:
> Mario Winterer wrote:
>> Klaus,
>>
>> if you want to force your plugin to be activated on platform startup,
>> simple use the extension point "org.eclipse.ui.startup" in plugin
>> "org.eclipse.ui".
>
> And that being said, don't use org.eclipse.ui.startup ... See the other
> thread on "Surpress Lazy loading of a plugin?"
>
> It's really best not to use it. In RCP apps, you have other options
> like the pre and post startup/open methods in your WorkbenchAdvisor and
> WorkbenchWindowAdvisor.
>
> PW
>
Re: Loading ready event [message #331274 is a reply to message #331259] Thu, 28 August 2008 17:55 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Mario Winterer wrote:
> Oh. Sorry. Didn't know!
> But when this extension point shouldn't be used, how is not possible to
> write a plugin for existing applications that requires early startup for
> some reason (the usage data collection plugin
> "org.eclipse.epp.usagedata.recording" uses this extension point too for
> exactly that reason how I believe...)

There are some valid reasons to use it (although most reasons mentioned
in this newsgroup are not appropriate, which is why we strongly
encourage people not to use it).

You are correct, if there was some application data that needed to be
recorded from startup onward, it would seem org.eclipse.ui.startup would
be a good way to start your plugin if it was to be an eclipse plugin (in
RCP you can use the advisors or actually control the OSGi bundle start
order).

The best practice in this case is to make sure that the started plugin
is the minimal set of managers, listeners, and datamodel to record the
needed information. It should not include an UI elements, and probably
not the entire "set of plugins" data model either.

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:Using CommonViewer in dialogs
Next Topic:Plugins exploded vs jar formats after export
Goto Forum:
  


Current Time: Sat Dec 21 16:53:47 GMT 2024

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

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

Back to the top