Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » placeholders and references to parts
placeholders and references to parts [message #1069149] Mon, 15 July 2013 09:10 Go to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 22
Registered: March 2013
Junior Member
Hi, I just wanted to share with something I spotted.

In my application I use placeholders in the perspective and I hold all parts in the sharedElements area of the main window, as I don't want those parts to be opened more than once.

When I tried to undock a placeholder and leave it outside the main window, after restarting application clicking on any of its toolbar's or menu's element, was crushing the part. It was weird, because when the placeholder was left inside main window, everything was working properly. I must add, that into all of those elements I inject preferences and parameters, etc. (test application, where after clicking some element the message was popping up, was working properly).

After debugging it appeared that parts in outside windows of current perspective have different id than their equivalents in sharedElements area.

Conclusion: the way how I work around that is to scan for all placeholders in all perspectives and their windows and set references to the parts from sharedElements area.

This was really driving me bananas, so if anyone has similar problem, you may want to use this solution.
Re: placeholders and references to parts [message #1072430 is a reply to message #1069149] Mon, 22 July 2013 18:48 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member
You should only have to set up the placeholder's 'ref' once, usually when it's initially created. By convention we use the view's id for its placeholder as well (perhaps we have a defect that forces this? In any case you might do the same...). Ids don't change based on where the placeholder is (and the 'shared' part never changes).

How do you create the 'outside' windows ? Note that if these are for a particular perspective then the new window should be added to the MPerspective's 'windows' list rather than that of the top level MTrimmedWindow.
Re: placeholders and references to parts [message #1072747 is a reply to message #1072430] Tue, 23 July 2013 12:15 Go to previous message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 22
Registered: March 2013
Junior Member
To create the "outside" windows a simply drag and drop a part out from the MTrimmedWindow. Yes, this part is then in a window that is listed in the MPerspective.getWindows(), so it is associated to a perspective, as I would like it to have.

OK, I know why I had to change those references at every start-up. It is the side effect of using the processor that extends elemented id of perspectives by ".merged" suffix (http://www.eclipse.org/forums/index.php/t/458845/), so that they would persist their state.

Parts from perspectives from fragments have the same ID as parts from sharedElements area, but parts from .merged perspectives, have different one. That's why I had to replace them every time and not only in placeholders from perspectives' windows (which I spotted recently), but also in placeholders that are in MTrimmedWindow, but in different perspectives (which apparently I spotted some time ago and made that change, but haven't thought about windows).

I hope it makes any sens to anyone, as I feel already a bit lost when reading what I've just written;]
Previous Topic:White foreground and black background?
Next Topic:ClearPersistedState in code
Goto Forum:
  


Current Time: Wed Nov 26 22:03:04 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