Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Problems with contributing a perspective via fragment
Problems with contributing a perspective via fragment [message #1018241] Wed, 13 March 2013 13:22 Go to next message
techteam is currently offline techteamFriend
Messages: 54
Registered: September 2010
Member
Hi,
I try to add a new perspective from an other bundle via the fragment.e4xmi.
My application bundle was build with the "Eclipse E4 Application
Project" wizard.
There I only delete the existing perspective from the perspective stack.

As long as I start the whole app with the -clearPersistedState option,
it looks and works fine.

Because I also do persist some preferences I now try to start my app
without these option, I've got the following stacktrace:

What am I doing wrong?

Greetings
Heiko



Stacktrace:

!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2013-03-13 13:38:03.937
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.e4.ui.workbench.swt".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.e4.ui.model.internal.ModelUtils.getContainingContext(ModelUtils.java:181)
at
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getContainingContext(ModelServiceImpl.java:280)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.getContext(PartRenderingEngine.java:674)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:727)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59)
at
org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:644)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:641)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:987)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-03-13 13:38:03.952
!MESSAGE Exception occurred while rendering:
org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveImpl@1cf7aa0
(elementId: de.icc.perspective.twitter, tags: [], contributorURI:
platform:/plugin/de.icc.twitter.ui) (widget: null, renderer: null,
toBeRendered: true, onTop: false, visible: true, containerData: null,
accessibilityPhrase: null) (label: Twitter, iconURI: null, tooltip:
null, context: null, variables: null)
!STACK 0
java.lang.NullPointerException
at
org.eclipse.e4.ui.model.internal.ModelUtils.getContainingContext(ModelUtils.java:181)
at
org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getContainingContext(ModelServiceImpl.java:280)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.getContext(PartRenderingEngine.java:674)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:727)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59)
at
org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:644)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:641)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:987)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2013-03-13 13:38:03.952
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.e4.ui.workbench.swt".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showTab(LazyStackRenderer.java:156)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:109)
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59)
at
org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:644)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:641)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:987)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-03-13 13:38:03.952
!MESSAGE Exception occurred while rendering:
org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl@192ad7e
(elementId: de.icc.perspectiveStack, tags: [], contributorURI:
platform:/plugin/de.icc.application) (widget: Composite {}, renderer:
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer@12f6fe9,
toBeRendered: true, onTop: false, visible: true, containerData: null,
accessibilityPhrase: null)
!STACK 0
java.lang.NullPointerException
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showTab(LazyStackRenderer.java:156)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:109)
at
org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:98)
at
org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:59)
at
org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:644)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:641)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:731)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:702)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:696)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:681)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:987)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Re: Problems with contributing a perspective via fragment [message #1018857 is a reply to message #1018241] Thu, 14 March 2013 15:19 Go to previous messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 23
Registered: March 2013
Junior Member
Hello,

I recently encountered a similar problem. I'm also looking for a solution. Here are my observations:

1. When I contribute a perspective via fragment it is shown, but whenever I select it, close an application and start it again, the perspective isn't selected. I have to reselect it manually. In console it throws a problem with "org.eclipse.e4.ui.workbench.swt" plugin.

2. To overcome it, I created empty perspectives in the application model and then my fragments are contributing to them. The processor just checks if the perspective has children. If has, then it is added to the menu.

But contributing parts to perspective with a fragment might have more problems. Later I moved all parts to sharedElements to use placeholders (why they don't see shared elements from application model?), so that I could open any part in any perspective. Now I can see all perspectives with their children, but the perspectives, to which I contributed placeholders from fragments, don't remember their state after reloading the application. Only the main perspective, created in the application model, restores everything as should.
To investigate it, I created another processor that runs before merging fragments with the application model. What's interesting:
- before merging all perspectives remember their state from previous session,
- after merging the perspectives are restored to the state as declared in the fragment model.
It shouldn't be that way, should it?

So I'm just thinking, it those problems aren't connected. Perhaps adding whole perspectives from a fragment doesn't work, because something odd is going on during merging?
I also found that placeholders that are added to perspectives during the run, loses their references after reloading the application. All contributions to the sharedElements area is OK, just the added placeholders have bull reference which forces me to manually check every placeholder and repair the reference in the processor. Can it be that there is something wrong with the *e4.ui.workbench.swt plugin?

I would be grateful for any advices.
Cheers,
Mateusz
Re: Problems with contributing a perspective via fragment [message #1018930 is a reply to message #1018857] Thu, 14 March 2013 18:05 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
Maybe this Bug has something to do with it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389663
Re: Problems with contributing a perspective via fragment [message #1019181 is a reply to message #1018930] Fri, 15 March 2013 07:30 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Yes I think this is the problem - this brute force always replacing is
causeing all those issues.

Tom

Am 14.03.13 19:05, schrieb Christoph Keimel:
> Maybe this Bug has something to do with it:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=389663
Re: Problems with contributing a perspective via fragment [message #1019794 is a reply to message #1018241] Sat, 16 March 2013 17:37 Go to previous messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 23
Registered: March 2013
Junior Member
When there is a need, there is a way.

I managed to solve the problem with contributing perspectives and they persist their state. To do so:
a) create a processor that runs after fragments,
b) after merging a perspective expand its ID by, e.g., ".merged",
c) when checking perspectives in the loop:
- if current perspective's ID contains "merged", leave it,
- if there is a perspective, which ID is the current perspective's ID expanded by "merged", save the current perspective in the list toBeDeleted,
- if nothing above is true, merge the perspective
d) delete perspectives from toBeDeleted list

Moreover, if we want to reset the perspective (or remerge it), we simply have to remove the ".merged" part from its ID (I haven't added this functionality, but should be easy).

Nevertheless, I look forward for solution to this merging issue.

Cheers,
Mateusz

edit: I believe that in the similar way it is possible to solve a problem, when fragments are not contributing whole perspective, but just some parts to part stack/stashes.

[Updated on: Sat, 16 March 2013 17:39]

Report message to a moderator

Re: Problems with contributing a perspective via fragment [message #1053892 is a reply to message #1019794] Wed, 08 May 2013 06:45 Go to previous messageGo to next message
Jon Boley is currently offline Jon BoleyFriend
Messages: 1
Registered: May 2013
Junior Member
Mateusz,

Very nice processor.

Jon
Re: Problems with contributing a perspective via fragment [message #1061933 is a reply to message #1018241] Tue, 04 June 2013 20:49 Go to previous messageGo to next message
Patrick Rusk is currently offline Patrick RuskFriend
Messages: 35
Registered: June 2012
Member
+1 on your solution. This got me out of a pretty bad bind. Thank you very much!
Re: Problems with contributing a perspective via fragment [message #1064125 is a reply to message #1061933] Mon, 17 June 2013 18:18 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member
Nice work on the '.merged' processing...

A slightly cleaner approach would be to add a "Merged" tag to the perspective rather than changing the id itself (which might affect other code trying to 'find' the perspective...

We're looking at the fragment life cycle in Luna and we'll likely adopt something along these lines to fix the issue (watch the New and Noteworthy...Wink.
Re: Problems with contributing a perspective via fragment [message #1067188 is a reply to message #1018241] Sun, 07 July 2013 12:08 Go to previous messageGo to next message
Mateusz Malinowski is currently offline Mateusz MalinowskiFriend
Messages: 23
Registered: March 2013
Junior Member
I just tested it with adding the tag as you suggested, but still, perspectives from fragments override perspectives witch "Merged" tag. So when I was debugging after second startup, the main perpsective had the tag, but the other hadn't.

What I actually did, was (all in the processor):
change line 55 to
perspective.getTags().add("Merged");

and change method isAlreadeMerged
private int isAlreadeMerged(MPerspective perspective)
{
    if (perspective.getTags().contains("Merged"))
        return 1;
    for (MPerspective pers : perspectiveStack.getChildren())
    {
        if (pers.getElementId().equals(perspective.getElementId()) && pers.getTags().contains("Merged"))
	    return 0;
    }
    return -1;
}


Maybe I'm doing something wrong, or maybe it just won't work. Nevertheless, I will stay with my solution for now and I'll be looking forward to provided fixes in Luna Smile
Re: Problems with contributing a perspective via fragment [message #1067289 is a reply to message #1067188] Mon, 08 July 2013 08:22 Go to previous message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member

[Updated on: Mon, 08 July 2013 08:25]

Report message to a moderator

Previous Topic:keybindings and bindingcontext
Next Topic:[Kepler] Cannot resolve org.eclipse.e4.ui.model.application.*
Goto Forum:
  


Current Time: Thu Dec 18 02:26:08 GMT 2014

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

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