| Register PespectiveListener [message #120196] | 
Fri, 30 January 2009 10:52   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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 #120283 is a reply to message #120231] | 
Tue, 03 February 2009 06:09   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
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  
>> 
>>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.31956 seconds