Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Perspective and UI Questions
Perspective and UI Questions [message #735] Thu, 28 May 2009 22:43 Go to next message
Jesse Riggins is currently offline Jesse Riggins
Messages: 24
Registered: July 2009
Junior Member
Hi all,

Only just a few hours into the E4 docs and examples so hopefully my
questions make sense.

In E4 are/will there be support for Perspectives? If not, could somewhat
similar behavior be implemented by having a Handler that manages the
visibility of Parts? If so, is there a way to get a handle to the UI
Model from within a Handler?

Please feel free to just point me in the direction of existing docs if
that is appropriate.

Exciting stuff!

Thanks,
Jesse
Re: Perspective and UI Questions [message #739 is a reply to message #735] Thu, 28 May 2009 23:15 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5332
Registered: July 2009
Senior Member
Hi,

Yes there are perspectives. They are part of the Workbench-Model.

Tom

Jesse Riggins schrieb:
> Hi all,
>
> Only just a few hours into the E4 docs and examples so hopefully my
> questions make sense.
>
> In E4 are/will there be support for Perspectives? If not, could
> somewhat similar behavior be implemented by having a Handler that
> manages the visibility of Parts? If so, is there a way to get a handle
> to the UI Model from within a Handler?
>
> Please feel free to just point me in the direction of existing docs if
> that is appropriate.
>
> Exciting stuff!
>
> Thanks,
> Jesse
>
Re: Perspective and UI Questions [message #744 is a reply to message #739] Fri, 29 May 2009 00:42 Go to previous messageGo to next message
Jesse Riggins is currently offline Jesse Riggins
Messages: 24
Registered: July 2009
Junior Member
Ahh I see it there in the Workbench. Thanks!

How about the other question. How does one get a handle to the UI model
when working in the context of a Handler?
Re: Perspective and UI Questions [message #749 is a reply to message #744] Fri, 29 May 2009 18:58 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

A lot of this is still up in the air, but ...

If your execute method takes an MWindow as an argument, or an
MContributedPart (depending on where you expect your handler to be
executed) you should get that model part.

You can also ask for MApplication to get the root model object.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Perspective and UI Questions [message #754 is a reply to message #749] Sat, 30 May 2009 01:30 Go to previous messageGo to next message
Jesse Riggins is currently offline Jesse Riggins
Messages: 24
Registered: July 2009
Junior Member
Thanks. It's good to know what's still up in the air and what's more
concrete. This is really neat stuff, by the way.

Yet another question. Tom showed me where the Workbench was in the model,
but now I have a few more follow up questions:

How do I create an RCP Application that makes use of the Workbench model?
In particular, I'm looking for the Perspectives. I realize that
MWorkbench contains MWorkbenchWindows which are themselves MWindows. So I
believe that means that they may somehow be able to be incorporated into
the MApplication container, but I can't figure out how my *.xmi file
should look (especially when trying to use the *.xmi editor).

Also, how do you create an *.xmi from scratch? I ended up bringing in the
org.eclipse.e4.ui.model.workbench code into my workspace and generating
and running the editor from it, but is there a better way?

Thanks,
Jesse
Re: Perspective and UI Questions [message #759 is a reply to message #754] Mon, 01 June 2009 13:38 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

As for to set it up in the editor, I'm not sure. You should be able to
create an .xmi file that references both Application and Workbench Ecore
to get access to all of the model elements.

But what you would want is and MApplication that contains an
MWorkbenchWindow which contains one or more* MPerspectives.

* only one perspective is supported at the moment.

If you are feeling adventurous you can figure out how to change the
MPerspective processing code to work more like the StackModelFactory.
Multiple perspectives would then be "contained" within a CTabFolder ...
not pretty, perhaps, but it would provide multiple perspectives with
code similar to existing code.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Perspective and UI Questions [message #561298 is a reply to message #735] Thu, 28 May 2009 23:15 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5332
Registered: July 2009
Senior Member
Hi,

Yes there are perspectives. They are part of the Workbench-Model.

Tom

Jesse Riggins schrieb:
> Hi all,
>
> Only just a few hours into the E4 docs and examples so hopefully my
> questions make sense.
>
> In E4 are/will there be support for Perspectives? If not, could
> somewhat similar behavior be implemented by having a Handler that
> manages the visibility of Parts? If so, is there a way to get a handle
> to the UI Model from within a Handler?
>
> Please feel free to just point me in the direction of existing docs if
> that is appropriate.
>
> Exciting stuff!
>
> Thanks,
> Jesse
>
Re: Perspective and UI Questions [message #561313 is a reply to message #739] Fri, 29 May 2009 00:42 Go to previous message
Jesse Riggins is currently offline Jesse Riggins
Messages: 24
Registered: July 2009
Junior Member
Ahh I see it there in the Workbench. Thanks!

How about the other question. How does one get a handle to the UI model
when working in the context of a Handler?
Re: Perspective and UI Questions [message #561328 is a reply to message #744] Fri, 29 May 2009 18:58 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

A lot of this is still up in the air, but ...

If your execute method takes an MWindow as an argument, or an
MContributedPart (depending on where you expect your handler to be
executed) you should get that model part.

You can also ask for MApplication to get the root model object.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Perspective and UI Questions [message #561345 is a reply to message #749] Sat, 30 May 2009 01:30 Go to previous message
Jesse Riggins is currently offline Jesse Riggins
Messages: 24
Registered: July 2009
Junior Member
Thanks. It's good to know what's still up in the air and what's more
concrete. This is really neat stuff, by the way.

Yet another question. Tom showed me where the Workbench was in the model,
but now I have a few more follow up questions:

How do I create an RCP Application that makes use of the Workbench model?
In particular, I'm looking for the Perspectives. I realize that
MWorkbench contains MWorkbenchWindows which are themselves MWindows. So I
believe that means that they may somehow be able to be incorporated into
the MApplication container, but I can't figure out how my *.xmi file
should look (especially when trying to use the *.xmi editor).

Also, how do you create an *.xmi from scratch? I ended up bringing in the
org.eclipse.e4.ui.model.workbench code into my workspace and generating
and running the editor from it, but is there a better way?

Thanks,
Jesse
Re: Perspective and UI Questions [message #561364 is a reply to message #754] Mon, 01 June 2009 13:38 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

As for to set it up in the editor, I'm not sure. You should be able to
create an .xmi file that references both Application and Workbench Ecore
to get access to all of the model elements.

But what you would want is and MApplication that contains an
MWorkbenchWindow which contains one or more* MPerspectives.

* only one perspective is supported at the moment.

If you are feeling adventurous you can figure out how to change the
MPerspective processing code to work more like the StackModelFactory.
Multiple perspectives would then be "contained" within a CTabFolder ...
not pretty, perhaps, but it would provide multiple perspectives with
code similar to existing code.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Perspective and UI Questions
Next Topic:news
Goto Forum:
  


Current Time: Tue Sep 23 10:38:08 GMT 2014

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

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