SimpleIDE example: problem with selection [message #544873] |
Mon, 05 July 2010 15:08  |
Eclipse User |
|
|
|
Hi all
i am trying a little bit with the e4 example SimpleIDE. I can select
different resources in the navigator without any problem. Then i open the
Context Menu View and select one of the items there. If i now try to select
a resource in the navigator i get the following exception:
java.lang.IllegalArgumentException: Variable selection is not modifiable in
the context PerspectiveImpl (simpleide.perspective.default) Context
at
org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:367)
at
org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:377)
at
org.eclipse.e4.core.internal.contexts.EclipseContext.modify( EclipseContext.java:357)
at
org.eclipse.e4.demo.simpleide.navigator.internal.ResourceNav igator$2.selectionChanged(ResourceNavigator.java:132)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.jface.util.SafeRunnable$1.run(SafeRunnable.java: 128)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2162)
at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1190)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1220)
at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:228)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:389)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:664)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:589)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:103)
at
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:124)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
The problem seams to be in the method SelectionServiceImpl.setSelection:
serviceRoot.getContext().set(IServiceConstants.ACTIVE_SELECT ION,
selection);
What is the difference between using
"context.modify(IServiceConstants.ACTIVE_SELECTION, ...)" and
"setSelection(selection)" on the ESelectionService instance?
Thanks for information
|
|
|
|
Re: SimpleIDE example: problem with selection [message #544895 is a reply to message #544889] |
Mon, 05 July 2010 18:11  |
Eclipse User |
|
|
|
Hi,
It looks like the code in SimpleIDE was not following the best practice
that has been defined through ESelectionService (it was using an old
technic to propagate the selection)
I've fixed the problem now.
Tom
Am 05.07.10 23:52, schrieb Tom Schindl:
> Hi,
>
> This looks like something is messing up the IEclipseContext. The
> difference between:
>
> IEclipseContext#set() and IEclipseContext#modify() is that the selection
> information is stored in the WindowContext. With modify we are search up
> the hierarchy until we find the variable-name. IEclipseContext#set()
> only sets the value in the current context and doesn't search up in the
> hierarchy.
>
> It looks like something is declaring an variable named "selection" in
> the perspective context!
>
> Tom
>
> Am 05.07.10 21:08, schrieb Reto Urfer:
>> Hi all
>> i am trying a little bit with the e4 example SimpleIDE. I can select
>> different resources in the navigator without any problem. Then i open
>> the Context Menu View and select one of the items there. If i now try to
>> select a resource in the navigator i get the following exception:
>>
>> java.lang.IllegalArgumentException: Variable selection is not modifiable
>> in the context PerspectiveImpl (simpleide.perspective.default) Context
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:367)
>>
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:377)
>>
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.modify( EclipseContext.java:357)
>>
>> at
>> org.eclipse.e4.demo.simpleide.navigator.internal.ResourceNav igator$2.selectionChanged(ResourceNavigator.java:132)
>>
>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>> at org.eclipse.jface.util.SafeRunnable$1.run(SafeRunnable.java: 128)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>> at
>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2162)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1190)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1220)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:228)
>>
>> at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
>> at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:389)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:664)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:589)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:103)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:124)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>>
>>
>> The problem seams to be in the method SelectionServiceImpl.setSelection:
>> serviceRoot.getContext().set(IServiceConstants.ACTIVE_SELECT ION,
>> selection);
>>
>>
>> What is the difference between using
>> "context.modify(IServiceConstants.ACTIVE_SELECTION, ...)" and
>> "setSelection(selection)" on the ESelectionService instance?
>>
>> Thanks for information
>
|
|
|
Re: SimpleIDE example: problem with selection [message #578563 is a reply to message #544873] |
Mon, 05 July 2010 17:52  |
Eclipse User |
|
|
|
Hi,
This looks like something is messing up the IEclipseContext. The
difference between:
IEclipseContext#set() and IEclipseContext#modify() is that the selection
information is stored in the WindowContext. With modify we are search up
the hierarchy until we find the variable-name. IEclipseContext#set()
only sets the value in the current context and doesn't search up in the
hierarchy.
It looks like something is declaring an variable named "selection" in
the perspective context!
Tom
Am 05.07.10 21:08, schrieb Reto Urfer:
> Hi all
> i am trying a little bit with the e4 example SimpleIDE. I can select
> different resources in the navigator without any problem. Then i open
> the Context Menu View and select one of the items there. If i now try to
> select a resource in the navigator i get the following exception:
>
> java.lang.IllegalArgumentException: Variable selection is not modifiable
> in the context PerspectiveImpl (simpleide.perspective.default) Context
> at
> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:367)
>
> at
> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:377)
>
> at
> org.eclipse.e4.core.internal.contexts.EclipseContext.modify( EclipseContext.java:357)
>
> at
> org.eclipse.e4.demo.simpleide.navigator.internal.ResourceNav igator$2.selectionChanged(ResourceNavigator.java:132)
>
> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
> at org.eclipse.jface.util.SafeRunnable$1.run(SafeRunnable.java: 128)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at
> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
> at
> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2162)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1190)
>
> at
> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1220)
>
> at
> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:228)
>
> at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
> at
> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:389)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:664)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:589)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:103)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:124)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>
>
> The problem seams to be in the method SelectionServiceImpl.setSelection:
> serviceRoot.getContext().set(IServiceConstants.ACTIVE_SELECT ION,
> selection);
>
>
> What is the difference between using
> "context.modify(IServiceConstants.ACTIVE_SELECTION, ...)" and
> "setSelection(selection)" on the ESelectionService instance?
>
> Thanks for information
|
|
|
Re: SimpleIDE example: problem with selection [message #578588 is a reply to message #544889] |
Mon, 05 July 2010 18:11  |
Eclipse User |
|
|
|
Hi,
It looks like the code in SimpleIDE was not following the best practice
that has been defined through ESelectionService (it was using an old
technic to propagate the selection)
I've fixed the problem now.
Tom
Am 05.07.10 23:52, schrieb Tom Schindl:
> Hi,
>
> This looks like something is messing up the IEclipseContext. The
> difference between:
>
> IEclipseContext#set() and IEclipseContext#modify() is that the selection
> information is stored in the WindowContext. With modify we are search up
> the hierarchy until we find the variable-name. IEclipseContext#set()
> only sets the value in the current context and doesn't search up in the
> hierarchy.
>
> It looks like something is declaring an variable named "selection" in
> the perspective context!
>
> Tom
>
> Am 05.07.10 21:08, schrieb Reto Urfer:
>> Hi all
>> i am trying a little bit with the e4 example SimpleIDE. I can select
>> different resources in the navigator without any problem. Then i open
>> the Context Menu View and select one of the items there. If i now try to
>> select a resource in the navigator i get the following exception:
>>
>> java.lang.IllegalArgumentException: Variable selection is not modifiable
>> in the context PerspectiveImpl (simpleide.perspective.default) Context
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:367)
>>
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.interna lModify(EclipseContext.java:377)
>>
>> at
>> org.eclipse.e4.core.internal.contexts.EclipseContext.modify( EclipseContext.java:357)
>>
>> at
>> org.eclipse.e4.demo.simpleide.navigator.internal.ResourceNav igator$2.selectionChanged(ResourceNavigator.java:132)
>>
>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>> at org.eclipse.jface.util.SafeRunnable$1.run(SafeRunnable.java: 128)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>> at
>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2162)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1190)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1220)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:228)
>>
>> at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
>> at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:389)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:664)
>>
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:589)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:103)
>>
>> at
>> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:124)
>>
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
>>
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>>
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>>
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>>
>>
>> The problem seams to be in the method SelectionServiceImpl.setSelection:
>> serviceRoot.getContext().set(IServiceConstants.ACTIVE_SELECT ION,
>> selection);
>>
>>
>> What is the difference between using
>> "context.modify(IServiceConstants.ACTIVE_SELECTION, ...)" and
>> "setSelection(selection)" on the ESelectionService instance?
>>
>> Thanks for information
>
|
|
|
Powered by
FUDForum. Page generated in 0.35782 seconds