Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » register a listener at workbench/plugin start
register a listener at workbench/plugin start [message #332105] Fri, 03 October 2008 08:20 Go to next message
Andre Ribeiro is currently offline Andre RibeiroFriend
Messages: 52
Registered: July 2009
Member
Hi!

What is the best to way to make a plugin that registers a selection
listener in a view from another plugin just as it starts?

Note that I want this plugin to start imediatly afert the workbench
starts, but i cannot register the selection listener in the start() or
earlyStart() methods since there is no SelectionService yet.

Cheers,
André
Re: register a listener at workbench/plugin start [message #332114 is a reply to message #332105] Sat, 04 October 2008 05:37 Go to previous messageGo to next message
Jiyul is currently offline JiyulFriend
Messages: 23
Registered: July 2009
Junior Member
Workbench provide a listener which provide event when workbench window
opening. Using this, you can make delayed activator.

André Ribeiro wrote:
> Hi!
>
> What is the best to way to make a plugin that registers a selection
> listener in a view from another plugin just as it starts?
>
> Note that I want this plugin to start imediatly afert the workbench
> starts, but i cannot register the selection listener in the start() or
> earlyStart() methods since there is no SelectionService yet.
>
> Cheers,
> André
Re: register a listener at workbench/plugin start [message #332123 is a reply to message #332114] Mon, 06 October 2008 10:52 Go to previous messageGo to next message
Andre Ribeiro is currently offline Andre RibeiroFriend
Messages: 52
Registered: July 2009
Member
could you point me where is it?

i just could find this one
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/reference/api/org/eclipse/ui/IWorkbenchListener.html

wich only has methods for shutdown events ...

Jiyul wrote:
> Workbench provide a listener which provide event when workbench window
> opening. Using this, you can make delayed activator.
>
> André Ribeiro wrote:
>> Hi!
>>
>> What is the best to way to make a plugin that registers a selection
>> listener in a view from another plugin just as it starts?
>>
>> Note that I want this plugin to start imediatly afert the workbench
>> starts, but i cannot register the selection listener in the start()
>> or earlyStart() methods since there is no SelectionService yet.
>>
>> Cheers,
>> André
Re: register a listener at workbench/plugin start [message #332144 is a reply to message #332123] Tue, 07 October 2008 02:22 Go to previous message
Jiyul is currently offline JiyulFriend
Messages: 23
Registered: July 2009
Junior Member
These are codes of mine. So remember, It is not given from eclipse, so
you may can't trust this method.


Plugin Activator codes:

public void start(BundleContext context) throws Exception {
super.start(context);

this.dynamicStateInitializer =
new DynamicCommandStateManager(getWorkbench());

dynamicStateInitializer.activate();
plugin = this;
}


DynamicCommandStateManager.activate():

public final void activate() {
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();

// What if workbench is ready, just activating now.
if (window != null) {
this.window = window;
_activate();
}

// If there is no Workbench window,
// register listener which will acitvate later.
else {
workbench.addWindowListener(delayedActivator);
}
}




André Ribeiro wrote:
> could you point me where is it?
>
> i just could find this one
> http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/reference/api/org/eclipse/ui/IWorkbenchListener.html
>
>
> wich only has methods for shutdown events ...
>
> Jiyul wrote:
>> Workbench provide a listener which provide event when workbench window
>> opening. Using this, you can make delayed activator.
>>
>> André Ribeiro wrote:
>>> Hi!
>>>
>>> What is the best to way to make a plugin that registers a selection
>>> listener in a view from another plugin just as it starts?
>>>
>>> Note that I want this plugin to start imediatly afert the workbench
>>> starts, but i cannot register the selection listener in the start()
>>> or earlyStart() methods since there is no SelectionService yet.
>>>
>>> Cheers,
>>> André
Previous Topic:Proper way to identify editor lifecycle events?
Next Topic:HTML2TextReader class
Goto Forum:
  


Current Time: Tue Nov 12 22:23:36 GMT 2024

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

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

Back to the top