Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Pespective entry in Application.e4xmi
Pespective entry in Application.e4xmi [message #653929] Fri, 11 February 2011 22:27 Go to next message
Holger Sachse is currently offline Holger Sachse
Messages: 12
Registered: February 2011
Location: Hamburg
Junior Member
Question: On perspective level in the Application.e4xmi one can set values for label, tool tip and icon URI but these never show up when the UI is rendered, bug or unimplemented feature?

Holger Sachse
Re: Pespective entry in Application.e4xmi [message #654163 is a reply to message #653929] Mon, 14 February 2011 12:51 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/11/2011 05:27 PM, Holger Sachse wrote:
> Question: On perspective level in the Application.e4xmi one can set
> values for label, tool tip and icon URI but these never show up when the
> UI is rendered, bug or unimplemented feature?

What are you using for a perspective switcher or perspective bar?

PW


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


Re: Pespective entry in Application.e4xmi [message #654171 is a reply to message #653929] Mon, 14 February 2011 13:31 Go to previous messageGo to next message
Holger Sachse is currently offline Holger Sachse
Messages: 12
Registered: February 2011
Location: Hamburg
Junior Member
Paul,
none of them. My assumption is/ was that all data filed in the Application.e4xmi would be handled by the framework. In special I thought that this applies to the rendering of all elements having a visibility flag. For example label data filed in the perspective screen in the Application.e4xmi editor would be shown in the same way this happens for a part.

In the documentation I read up to now I did not find any indication that I have to programming to make it visible. If this does not explain my point I have to rephrase my wording.

Holger

Re: Pespective entry in Application.e4xmi [message #654198 is a reply to message #654171] Mon, 14 February 2011 15:00 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/14/2011 08:31 AM, Holger Sachse wrote:
> Paul,
> none of them. My assumption is/ was that all data filed in the
> Application.e4xmi would be handled by the framework. In special I
> thought that this applies to the rendering of all elements having a
> visibility flag. For example label data filed in the perspective screen
> in the Application.e4xmi editor would be shown in the same way this
> happens for a part.

The perspective is being rendered. But you need to provide something in
order to switch between them.

We use an add-on
org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.Persp ectiveSwitcher
from
/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/u i/workbench/addons/perspectiveswitcher/PerspectiveSwitcher.j ava

But this uses constants from the 3.x compatibility layer, and so cannot
be consumed by an e4 app as-is. It would need to be copied and modified.

/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo /SwitchPerspectiveHandler.java
is an example handler that switch perspectives.

PW

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


Re: Pespective entry in Application.e4xmi [message #654262 is a reply to message #654198] Mon, 14 February 2011 19:43 Go to previous messageGo to next message
Holger Sachse is currently offline Holger Sachse
Messages: 12
Registered: February 2011
Location: Hamburg
Junior Member
Paul,
checked your references and still not getting the result I am talking about.

I took the photo demo and added in the application model under label "Photo P1" for the perspective entry. I left the demo with one perspective only, so no need to switch anything. If I run the demo I would expect that this label content shows up in a tab folder like representation (like in the e4 IDE there on the right side) or in any other one.

But I do not see anything.

I took also the perspective switch handler example and build it in my training application. It works exchanging the perspectives but leaving no information (see the reference to the perspective tab folders) about the other open perspectives. Is this what you mean with the reference to the IBM code?

Holger

P.S. Can somebody give me the rigths to make attachements to add examples?!

[Updated on: Mon, 14 February 2011 19:50]

Report message to a moderator

Re: Pespective entry in Application.e4xmi [message #654268 is a reply to message #654262] Mon, 14 February 2011 20:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/14/2011 02:43 PM, Holger Sachse wrote:
> I took also the perspective switch handler example and build it in my
> training application. It works exchanging the perspectives but leaving
> no information (see the reference to the perspective tab folders) about
> the other open perspectives. Is this what you mean with the reference to
> the IBM code?

The perspective model element (as rendered by the PerspectiveRenderer)
doesn't have a visible indication.

The PerspectiveSwitcher example that I cited creates a toolbar to be
placed in the trim, with one radio tool item per MPerspective. ex:
org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.Persp ectiveSwitcher.addPerspectiveItem(MPerspective)
It just uses too much of the compatibility layer to be used in a
simple e4 RCP app. But it can be adapted to provide a simple
perspective switcher.

PW


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


Re: Pespective entry in Application.e4xmi [message #654842 is a reply to message #654268] Thu, 17 February 2011 11:53 Go to previous messageGo to next message
Holger Sachse is currently offline Holger Sachse
Messages: 12
Registered: February 2011
Location: Hamburg
Junior Member
Paul,

I had a more detailed look at the code of your mentioned reference. Before I start to do my own implementation I have some questions which may influence the way how to do it:

1. What is the plan of the e4 development regarding this point? Provision as part of the framework in future for a pure e4 solution add-on or has this to be done by each developer?

2. In case of the first option: Because of the dependencies to "org.eclipse.ui.internal" has this to be cloned in a pure e4 package is there code available? In case of the first, how should it be named? In case of the second, where to search?

3. What is the equivalent for closing a perspective? Set "to be rendered" or "is visible" to false?

4. Can you give me a hint for the case "reset perspective"? My understanding is that I have to go through the model for a perspective and set all "to be rendered" or "is visible" entries in the tree to true!

While testing your small proposal I discovered a strange behavior while switching between two perspectives:

1. In the "Application.e4xmi" I set the "Selected Element" to "Perspective 1"

2. Switching between the two perspectives works!

3. Closing the application and opening the "Application.e4xmi"in the IDE the "Selected Element" shows "Perspective 1" even it was set to "Perspective 2" by the application.

4. Running the application once more it starts with "Perspective 2".
Does the model modification work in a local copy per user?

Holger
Re: Pespective entry in Application.e4xmi [message #654843 is a reply to message #654842] Thu, 17 February 2011 12:06 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5422
Registered: July 2009
Senior Member
[...]
> While testing your small proposal I discovered a strange behavior while
> switching between two perspectives:
>
> 1. In the "Application.e4xmi" I set the "Selected Element" to
> "Perspective 1"
>
> 2. Switching between the two perspectives works!
>
> 3. Closing the application and opening the "Application.e4xmi"in the
> IDE the "Selected Element" shows "Perspective 1" even it was set to
> "Perspective 2" by the application.
>
> 4. Running the application once more it starts with "Perspective 2".
> Does the model modification work in a local copy per user?
>

The original model gets unmodified. We are recording delta changes while
you'll have the application running an apply them on the next start.

The process of the e4 model creation is like this:
* Load the Application.e4xmi
* Merge in changes from fragment.e4xmi contributed through extension
point
* apply deltas recorded in the last session

You can find the deltas recorded in a your
workspace/.metadata/org.eclipse.e4.workbench/delta.xml

Tom
Re: Pespective entry in Application.e4xmi [message #654877 is a reply to message #654842] Thu, 17 February 2011 13:48 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 02/17/2011 06:53 AM, Holger Sachse wrote:
> Paul,
>
> I had a more detailed look at the code of your mentioned reference.
> Before I start to do my own implementation I have some questions which
> may influence the way how to do it:
>
> 1. What is the plan of the e4 development regarding this point?
> Provision as part of the framework in future for a pure e4 solution
> add-on or has this to be done by each developer?

There was some discussion on providing a simple, pure-e4 version. One
of the reasons it's not there currently ... there's no notion of a
perspective factory. In e4 perspectives work if you create one with
TBR==true and the others with TBR==false all in your e4xmi. The
perspective switcher can the switch between open ones, and open and
close ones by setting TBR==true/false.

Another options might be to have a perspective factory == a model
fragment, so that it could be used to create a Perspective (similar to a
perspective factory).


> 4. Can you give me a hint for the case "reset perspective"? My
> understanding is that I have to go through the model for a perspective
> and set all "to be rendered" or "is visible" entries in the tree to true!

There's no notion of a perspective reset, however, because you have no
perspective template.


Later,
PW


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


Re: Perspective entry in Application.e4xmi [message #655851 is a reply to message #654843] Tue, 22 February 2011 20:38 Go to previous messageGo to next message
Holger Sachse is currently offline Holger Sachse
Messages: 12
Registered: February 2011
Location: Hamburg
Junior Member
I followed Tom's last hint about "deltas.xml" and checked the application behavior a little bit further. From my point of view there may be under certain circumstances a situation which needs a lot of clean up in an application with its next start.

For example in my environment (e4.1 m5) the "new mail" function of Tom's tutorial crashes. In case I close the main window by the exit menu entry without touching the trunk of the "new mail" window it opens again. In case the trunk will be closed by using window's "x" button it never pops up again. Only deleting the "deltas.xml" helps.

For sure there are some methods which will clean up the situation but I am not a friend of overloading a business application with this kind of stuff. Can somebody considered to bring this into the specification of future e4 framework releases, or may I get back a "file a bug please"?

Holger
Re: Perspective entry in Application.e4xmi [message #656022 is a reply to message #655851] Wed, 23 February 2011 19:23 Go to previous message
Remy Suen is currently offline Remy Suen
Messages: 462
Registered: July 2009
Senior Member
Holger Sachse wrote on Tue, 22 February 2011 15:38
For example in my environment (e4.1 m5) the "new mail" function of Tom's tutorial crashes. In case I close the main window by the exit menu entry without touching the trunk of the "new mail" window it opens again. In case the trunk will be closed by using window's "x" button it never pops up again. Only deleting the "deltas.xml" helps.

This probably means the window's 'toBeRendered' flag has been set to 'false'.

Quote:
For sure there are some methods which will clean up the situation but I am not a friend of overloading a business application with this kind of stuff. Can somebody considered to bring this into the specification of future e4 framework releases, or may I get back a "file a bug please"?

I don't understand what you are asking for here.
Previous Topic:edit/delete matching html tags
Next Topic:Trouble with visible when
Goto Forum:
  


Current Time: Sat Oct 25 00:08:42 GMT 2014

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

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