How do I programatically open an editor during startup? [message #289519] |
Sun, 07 August 2005 11:20 |
Eclipse User |
|
|
|
Originally posted by: mehow.remove.neurosoft.net
Hi,
I want my plugin to open some editor during Eclipse startup (based on
command line arguments), so I registered a class using
org.eclipse.ui.startup extension point. The problem is that although
PlatformUI.getWorkbench() returns a workbench in earlyStartup() method,
workbench.getActiveWorkbenchWindow() returns null (no window has been
created yet). Thus I cannot use IWorkbenchPage.openEditor() method to
open the editor. So what is the right way to execute the code after the
workbench is completely restored?
Any help would be appreciated.
Michal
|
|
|
|
Re: How do I programatically open an editor during startup? [message #289523 is a reply to message #289520] |
Sun, 07 August 2005 15:46 |
Eclipse User |
|
|
|
Originally posted by: mehow.remove.neurosoft.net
Thanks!
The plugin will open an editor only if it is instructed to do so with
command line arguments. On the other hand editors are often opened at
startup as part of workbench restoration and I find it useful rather
than irritating :)
Michal
Sunil Kamath wrote:
> "Michał Tkacz" <mehow.remove@neurosoft.net> wrote in message
> news:dd4qpq$n51$1@news.eclipse.org...
>
>>Hi,
>>
>>I want my plugin to open some editor during Eclipse startup (based on
>>command line arguments), so I registered a class using
>>org.eclipse.ui.startup extension point. The problem is that although
>>PlatformUI.getWorkbench() returns a workbench in earlyStartup() method,
>>workbench.getActiveWorkbenchWindow() returns null (no window has been
>>created yet). Thus I cannot use IWorkbenchPage.openEditor() method to open
>>the editor. So what is the right way to execute the code after the
>>workbench is completely restored?
>>
>>Any help would be appreciated.
>>
>
> Schedule a UIJob.
> However, are you absolutely certain you want to open the editor everytime
> the user opens the workbench?
> That could quickly get irritating for the end user.
> ---
> Sunil
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03278 seconds