Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » how to share View in Multi Perspective
icon12.gif  how to share View in Multi Perspective [message #1007099] Mon, 04 February 2013 13:07 Go to next message
jim liu is currently offline jim liuFriend
Messages: 37
Registered: February 2011
Location: shanghai
Member
I use Application.e4xmi to define UI.
I have a View defined two times by Part in two perspective.
When change Pespective,the View content changed.
What I want is ,when perspective changed,view content not changed.
Any suggestion?thanks


java eclipse Search
http://javafind.appspot.com/
Re: how to share View in Multi Perspective [message #1007288 is a reply to message #1007099] Tue, 05 February 2013 11:40 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

I'm not sure I understood. You want an area (MArea?) not to move when you change perspectives? Much like the place where eclipse ide places the editors (java,xml etc)?
Re: how to share View in Multi Perspective [message #1065494 is a reply to message #1007099] Wed, 26 June 2013 06:15 Go to previous messageGo to next message
syed mehtab is currently offline syed mehtabFriend
Messages: 1
Registered: July 2012
Junior Member
I am too facing a similar problem as jim.
I am looking for a way to share a part(or view) across multiple perspectives in a e4 RCP application, till now I did not find any tutorial or example explaining about shared elements. Can anyone please explain briefly about how to share elements in e4.

@jim did u find a solution to your problem ?
Re: how to share View in Multi Perspective [message #1065969 is a reply to message #1065494] Fri, 28 June 2013 14:14 Go to previous messageGo to next message
Daniel Rolka is currently offline Daniel RolkaFriend
Messages: 4
Registered: March 2013
Junior Member
What about adding the parts to the MWindow.getSharedElements() collection? I haven't checked it, but it can solve the issue

Daniel
Re: how to share View in Multi Perspective [message #1066571 is a reply to message #1007099] Wed, 03 July 2013 08:35 Go to previous messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 22
Registered: March 2013
Junior Member
Daniel is right.

As far as I understand, if the part is declared in each perspective, then it is created multiple times, but if you declare it in sharedElements, then you can use PlaceHolders in any perspective and set reference to this single part. In this case, there is always only one instance of the part (well, unless you close all placeholders, then this part is destroyed, but still can be created when you open it again).

Note: if you create a new perspective in different plugin and you put there a placeholder and you want to set reference to the part from sharedElements of the main app, you might not find there anything. I can't remember what was the problem, I believe there is some issue with the "find", that it only search within current plugin, while it should seatch also withing plugins, on which current project depends. Anyway, what I do, is to create a separate addon in which I manually set references to the placeholder.

You you still need some example, I may try to prepare one for you within next few days.
Re: how to share View in Multi Perspective [message #1376458 is a reply to message #1066571] Fri, 23 May 2014 12:25 Go to previous messageGo to next message
Guillaume Helle is currently offline Guillaume HelleFriend
Messages: 6
Registered: February 2014
Junior Member
Hello Mateusz,

If you have an example to have a single view instance in multiple perspective, can you post it?
I have tried to implement it without success...

Thanks for you help!
Best regards

Guillaume
Re: how to share View in Multi Perspective [message #1384004 is a reply to message #1376458] Tue, 27 May 2014 19:34 Go to previous messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 22
Registered: March 2013
Junior Member
Hi Guillaume!

I created a small example with two perspectives and single part. You may notice that text which you type, will appear in both perspectives, as they have placeholders which hold reference to single part implementation.
I hope this helps you!

Cheers,
Mateusz
Re: how to share View in Multi Perspective [message #1384879 is a reply to message #1384004] Mon, 02 June 2014 18:00 Go to previous message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member

There's some magic to re-establishing the reference from an MPlaceholder to its MPart; use the *same* id. If you create an MPlaceholder and leave its ref as 'null' but give it the id of the mpart then the renderer will establish the reference 'on demand'...
Previous Topic:How to dynamically fill a parameter to a popup menu
Next Topic:CSS & Layouts
Goto Forum:
  


Current Time: Sat Nov 29 01:44:10 GMT 2014

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

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