Skip to main content


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: 36
Registered: March 2013
Location: Bristol
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 messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 36
Registered: March 2013
Location: Bristol
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;]
Re: placeholders and references to parts [message #1732193 is a reply to message #1072747] Fri, 13 May 2016 11:33 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

(deleted; wrong post)

[Updated on: Fri, 13 May 2016 11:40]

Report message to a moderator

Re: placeholders and references to parts [message #1732195 is a reply to message #1732193] Fri, 13 May 2016 11:40 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Haven't done that for a while and I don't find the sample right now. But I think I got it working somehow. Not sure about every detail.

Do you contribute the perspective as a snippet? This is necessary for the compat mode.
Regarding the placeholders, I think they need to be imported to the fragment.
Re: placeholders and references to parts [message #1732197 is a reply to message #1732195] Fri, 13 May 2016 11:43 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Sorry, I replyed to the wrong topic. Now in https://www.eclipse.org/forums/index.php/m/1732196/
Previous Topic:Import/Export Perspectives
Next Topic:Adding a Part from another plug-in to a Perspective
Goto Forum:
  


Current Time: Fri Apr 19 16:16:29 GMT 2024

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

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

Back to the top