Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Register PespectiveListener
Register PespectiveListener [message #120196] Fri, 30 January 2009 10:52 Go to next message
Eclipse UserFriend
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 12:34 Go to previous messageGo to next message
Eclipse UserFriend
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 06:37 Go to previous messageGo to next message
Eclipse UserFriend
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 06:47 Go to previous messageGo to next message
Eclipse UserFriend
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 06:09 Go to previous message
Eclipse UserFriend
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 Apr 30 23:14:08 EDT 2025

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

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

Back to the top