|
|
Re: How to open an editor in createInitialLayout [message #447593 is a reply to message #447558] |
Tue, 11 April 2006 13:02 |
|
Ravi wrote:
> Hi,
>
> The article "Inside the Workbench, A guide to the workbench internals"
> quotes the following -
> "The page owns a set of perspectives. Perspectives contain a layout and
> information about what action sets to enable. Although perspectives
> appear to contain views and the editor area, they only own a layout."
>
> Shouldn't the page be created before the createInitialLayout method of
> the Perspective class?
Actually it's the opposite, createInitialLayout() is filling in layout
data. That's not tied to a page, but must be used by the perspective in
a page to create the page layout.
createInitialLayout() will almost always be called before page creation
on startup.
Layout is responsible for where the editor area shows up, not what
editors are open.
What about attaching a perspective listener to the workbench window.
Check when your perspective is opened, and open the editor then.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Re: How to open an editor in createInitialLayout [message #447674 is a reply to message #447613] |
Wed, 12 April 2006 11:55 |
|
Ravi wrote:
> Hi Paul,
>
> Thanks for the reply.
> I tried attaching a perspective listener to the workbench window. The
> addPerspectiveListener method doesn't have a return value. I cannot
> check if my perspective is opened and hence cannot open the editor. Any
> suggestions?
Sorry, why didn't you just listen for the perspectiveOpened() event?
Check out IPerspectiveListener/2/3/4
> When does the page get created? I understand that createInitialLayout
> defines the layout of a perspective. To display a perspective you need a
> page. Any ideas what is the sequence?
The page gets created and then the perspective gets created in the page.
The createInitialLayout() can happen any time before the perspective
gets created. Some of them never get called, since they only get
instantiated when someone tries to open their perspective.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Powered by
FUDForum. Page generated in 0.03263 seconds