Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4 app based on Contact demo has problem with IEclipseContext
e4 app based on Contact demo has problem with IEclipseContext [message #572499] Thu, 01 April 2010 08:02 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4598
Registered: July 2009
Senior Member

I cloned the Contacts demo for my own app. I get an error with the IEclipseContext on selecting from the ListView as follows:

Exception occurred
java.lang.IllegalArgumentException: Variable selection is not modifiable in the context Anonymous Context
at .internalModify(
at .modify(
at com.hsbcib.grds.testui.views.ListViewer$1.selectionChanged(L
at org.eclipse.jface.viewers.Viewer$
at org.eclipse.jface.util.SafeRunnable$ 128)
at 5)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
at org.eclipse.jface.viewers.StructuredViewer.updateSelection(S
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:222)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate
at org.eclipse.swt.widgets.EventTable.sendEvent( :84)
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4037)
at org.eclipse.swt.widgets.Display.readAndDispatch( :3628)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine $
at org.eclipse.core.databinding.observable.Realm.runWithDefault (
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .run(
at org.eclipse.e4.workbench.ui.internal.E4Workbench.createAndRu nUI(
at org.eclipse.e4.ui.workbench.swt.internal.E4Application.start (
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
at java.lang.reflect.Method.invoke(
at org.eclipse.equinox.launcher.Main.invokeFramework( 619)
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

the method looks like this

public ListViewer(Composite parent) {
// Table composite (because of TableColumnLayout)
final Composite tableComposite = new Composite(parent, SWT.NONE);
tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
final TableColumnLayout tableColumnLayout = new TableColumnLayout();

// Table viewer
testCaseViewer = new TableViewer(tableComposite, SWT.FULL_SELECTION);
// contactsViewer.getTable().setLinesVisible(true);
testCaseViewer.setComparator(new TestCaseViewerComparator());

new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
context.modify(IServiceConstants.SELECTION, selection.getFirstElement());

The exception only occurs on the 2nd or later seelction of an item in the list. Unlike the Contacts demo the List only has one column. The difficulty with an @Inject is it is hard to see the larger context for a problem like this. Any suggestions?


Re: e4 app based on Contact demo has problem with IEclipseContext [message #572559 is a reply to message #572499] Thu, 01 April 2010 14:52 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If you are using modify then your model has to list that variable in its
variables attribute. Have a look at the matching model entry in the
contacts demo for the ListViewer.


Paul Webster .platform.doc.isv/guide/workbench.htm

Previous Topic:Remote javascript debugger
Next Topic:Nested XWT
Goto Forum:

Current Time: Sat Nov 28 00:51:04 GMT 2015

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

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