Skip to main content



      Home
Home » Modeling » EMF » ECP SWT ViewRenderer
ECP SWT ViewRenderer [message #1410315] Wed, 20 August 2014 07:52 Go to next message
Eclipse UserFriend
Hello,



I'm developing an RCP App with the corresponding EMF Forms for every tableViewer entry.

As I checked if the shown informations are correct(by clicking on every single one of them), I got a java.lang.ArrayIndexOutOfBoundsException.

Somehow everytime I get the EMF Forms for my entries and I click away, it deletes the before clicked entry.

To be able to tell why, I did this: System.err.println(elements.length + " " + selectedIndex);

By clicking the entries I get different elements.length values and at the end its value was 0.


Why does the render method remove the object from its parent?Does anybody know how can I fix this?





!ENTRY org.eclipse.ui 4 0 2014-08-20 13:43:56.659
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: 2
at reiseapp.swt.TableClass$5.handleEvent(TableClass.java:414)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at reiseapp.swt.Application.start(Application.java:20)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)



TableClass row 414: EObject selected = (EObject) elements[selectedIndex];

[Updated on: Wed, 20 August 2014 08:23] by Moderator

Re: ECP SWT ViewRenderer [message #1410613 is a reply to message #1410315] Thu, 21 August 2014 03:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
could you please paste the full stackTrace? I think that there should be a caused by block after the ArrayOutOfIndexException.
Could you also verify, that you have the org.eclipse.emf.ecp.view.validation bundle active in your run configuration?

Cheers,
Re: ECP SWT ViewRenderer [message #1412120 is a reply to message #1410613] Mon, 25 August 2014 06:35 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

thanks for the answer! I added the org.eclipse.emf.ecp.view.validation bundle in my run configuration and the error is gone. But I still can't save or update via EMF Forms. As far as I know, I need to override the ECPReferenceServiceImpl methods. Is that right?

Madalina

[Updated on: Mon, 25 August 2014 07:32] by Moderator

Re: ECP SWT ViewRenderer [message #1412568 is a reply to message #1412120] Tue, 26 August 2014 09:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
what do you mean by save or update EMFForms?
The ECPReferenceService is only needed if you have links in your application, e.g. an element which points to another element.

Cheers,
Eugen
Re: ECP SWT ViewRenderer [message #1412571 is a reply to message #1412568] Tue, 26 August 2014 09:39 Go to previous messageGo to next message
Eclipse UserFriend
Hello,


well, I have a TableViewer in my App and if I click on the table entries it shows the corresponding informations with EMF Forms.
What I mean by update or save is to modify the given informations inside the EMF Forms and update it in the tableViewer.


Thanks,
Madalina
Re: ECP SWT ViewRenderer [message #1412594 is a reply to message #1412571] Tue, 26 August 2014 10:48 Go to previous message
Eclipse UserFriend
Hi,
has your TableViewer Databinding?
EMFForms uses databinding and thus changes the domain model when you change the values in the ui. TextFields trigger the update on focusout. Please check if your model is really not changed, e.g. add a contentAdapter to your model.

EMFForms also has a TableViewer build in which is databound. A new feature for the TableViewer which does exactly what you want to achieve will be available with the 1.4.0 release see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=442068
The RC1 will be available on friday.

Cheers,
Previous Topic:Character Encoding
Next Topic:DelegatingWrapperItemProvider : how change the order of the properties
Goto Forum:
  


Current Time: Sat May 24 11:43:49 EDT 2025

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

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

Back to the top