Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Register PespectiveListener
Register PespectiveListener [message #120196] Fri, 30 January 2009 15:52 Go to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi,

I would like to register PerspectiveListener an open an editor if a special
perspective becomes activated.
Normally I do this in my Activator.start() method. But I get the
"IllegalStateException" because no context ist available. I also tried it
with UICallBack.runNonUIThreadWithFakeContext() but since this method also
needs a Display I get the same Exception.
Am I doing something wrong? Is there a better place to register my Listener
at where it works better?

Regards,

Markus
Re: Register PespectiveListener [message #120208 is a reply to message #120196] Fri, 30 January 2009 17:34 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Markus,

Markus Krüger wrote:
> I would like to register PerspectiveListener an open an editor if a special
> perspective becomes activated.
> Normally I do this in my Activator.start() method. But I get the
> "IllegalStateException" because no context ist available. I also tried it
> with UICallBack.runNonUIThreadWithFakeContext() but since this method also
> needs a Display I get the same Exception.
> Am I doing something wrong? Is there a better place to register my Listener
> at where it works better?

Think again. Let's say you have 23 active users. How many workbench
instances do you have? And how many active bundles? How many of those
listeners do you need?

Ralf
Re: Register PespectiveListener [message #120220 is a reply to message #120208] Mon, 02 February 2009 11:37 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Hi Ralf,

I think I need 23 listeners, one per workbench/user. Well I guess that you
mean that the bundle is only started once, so this is the wrong place to add
the listener.
But where else can I add it, so that there is one listener per
workbench/user?

Regards,
Markus

"Ralf Sternberg" <rsternberg@eclipsesource.com> schrieb im Newsbeitrag
news:glvdmf$l7k$1@build.eclipse.org...
> Hi Markus,
>
> Markus Kr
Re: Register PespectiveListener [message #120231 is a reply to message #120220] Mon, 02 February 2009 11:47 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Markus,

the entrypoint is the first place which is session-aware for your
application as the entrypoint implementation is loaded on a per-user base.

BUT it's not the right place either for a perspective listener. In RCP
it is common that the workbench is already running when your plugin
loads. In RAP the workbench is started with the user session and thus
may not be available immediately. I would suggest to use the workbench
window advisor do to stuff like that.

Cheers
Benny

Markus Krüger wrote:
> Hi Ralf,
>
> I think I need 23 listeners, one per workbench/user. Well I guess that you
> mean that the bundle is only started once, so this is the wrong place to add
> the listener.
> But where else can I add it, so that there is one listener per
> workbench/user?
>
> Regards,
> Markus
>
> "Ralf Sternberg" <rsternberg@eclipsesource.com> schrieb im Newsbeitrag
> news:glvdmf$l7k$1@build.eclipse.org...
>> Hi Markus,
>>
>> Markus Krüger wrote:
>>> I would like to register PerspectiveListener an open an editor if a
>>> special
>>> perspective becomes activated.
>>> Normally I do this in my Activator.start() method. But I get the
>>> "IllegalStateException" because no context ist available. I also tried it
>>> with UICallBack.runNonUIThreadWithFakeContext() but since this method
>>> also
>>> needs a Display I get the same Exception.
>>> Am I doing something wrong? Is there a better place to register my
>>> Listener
>>> at where it works better?
>> Think again. Let's say you have 23 active users. How many workbench
>> instances do you have? And how many active bundles? How many of those
>> listeners do you need?
>>
>> Ralf
>
>
Re: Register PespectiveListener [message #120283 is a reply to message #120231] Tue, 03 February 2009 11:09 Go to previous message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi again,

you could even use an IStartup implementation contributed by an
extension to org.eclipse.ui.startup.

Greets
Benny

Benjamin Muskalla wrote:
> Hi Markus,
>
> the entrypoint is the first place which is session-aware for your
> application as the entrypoint implementation is loaded on a per-user base.
>
> BUT it's not the right place either for a perspective listener. In RCP
> it is common that the workbench is already running when your plugin
> loads. In RAP the workbench is started with the user session and thus
> may not be available immediately. I would suggest to use the workbench
> window advisor do to stuff like that.
>
> Cheers
> Benny
>
> Markus Krüger wrote:
>> Hi Ralf,
>>
>> I think I need 23 listeners, one per workbench/user. Well I guess that
>> you mean that the bundle is only started once, so this is the wrong
>> place to add the listener.
>> But where else can I add it, so that there is one listener per
>> workbench/user?
>>
>> Regards,
>> Markus
>>
>> "Ralf Sternberg" <rsternberg@eclipsesource.com> schrieb im Newsbeitrag
>> news:glvdmf$l7k$1@build.eclipse.org...
>>> Hi Markus,
>>>
>>> Markus Krüger wrote:
>>>> I would like to register PerspectiveListener an open an editor if a
>>>> special
>>>> perspective becomes activated.
>>>> Normally I do this in my Activator.start() method. But I get the
>>>> "IllegalStateException" because no context ist available. I also
>>>> tried it
>>>> with UICallBack.runNonUIThreadWithFakeContext() but since this
>>>> method also
>>>> needs a Display I get the same Exception.
>>>> Am I doing something wrong? Is there a better place to register my
>>>> Listener
>>>> at where it works better?
>>> Think again. Let's say you have 23 active users. How many workbench
>>> instances do you have? And how many active bundles? How many of those
>>> listeners do you need?
>>>
>>> Ralf
>>
>>
Previous Topic:Problem with setBlockOnOpen in Dialog
Next Topic:Using Drawable interface for class binary compability
Goto Forum:
  


Current Time: Wed Nov 13 18:08:30 GMT 2024

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

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

Back to the top