placeholders and references to parts [message #1069149] |
Mon, 15 July 2013 09:10 |
Mateusz Malinowski 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 #1072747 is a reply to message #1072430] |
Tue, 23 July 2013 12:15 |
Mateusz Malinowski 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;]
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02404 seconds