Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How do I programatically open an editor during startup?
How do I programatically open an editor during startup? [message #289519] Sun, 07 August 2005 11:20 Go to next message
Eclipse UserFriend
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 #289520 is a reply to message #289519] Sun, 07 August 2005 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Micha
Re: How do I programatically open an editor during startup? [message #289523 is a reply to message #289520] Sun, 07 August 2005 15:46 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:How could I draw connection lines between two TreeItems
Next Topic:How to achive movable TableColumns in a TableViewer
Goto Forum:
  


Current Time: Sat Apr 20 04:26:48 GMT 2024

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

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

Back to the top