|
Re: Can't edit cell in sirius table after getting error [message #1798216 is a reply to message #1798214] |
Wed, 14 November 2018 09:50 |
|
Hello
Once you get the error dialog box it is too late and moreover you do not want to see that awful dialog box.
So I would agree with your second proposition that is using a service to check the value and to manage wrong matching with the requested value type.
Peering your Value Interpreted Expression, it seems that you miswrote the arg0 argument. You used opening and closing parenthesis instead of 0 digit.
Regards
Laurent
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Can't edit cell in sirius table after getting error [message #1798436 is a reply to message #1798384] |
Mon, 19 November 2018 04:34 |
Prajna VG Messages: 54 Registered: July 2018 |
Member |
|
|
Hi Laurent,
Yeah, That code I used is for setValue().
If I use setValue(arg0) I'm using
public static String setValue(EObject self,String arg) {
//self
System.out.println(self.toString());
System.out.println(arg.toString());
return "22";
}
But I am getting NPE. It is not displaying those sysout statements in console also. So I guess it is not considering that method even though I pass a String arg!!
I tried by this also
public static String setValue(EObject self,String args[]) {
//self
System.out.println(self.toString());
return "22";
}
How can I give a method so that it returns integer data type.
[Updated on: Mon, 19 November 2018 05:03] Report message to a moderator
|
|
|
Re: Can't edit cell in sirius table after getting error [message #1798626 is a reply to message #1798436] |
Wed, 21 November 2018 09:57 |
|
Prajna VG wrote on Mon, 19 November 2018 05:34Hi Laurent,
Yeah, That code I used is for setValue().
If I use setValue(arg0) I'm using
public static String setValue(EObject self,String arg) {
//self
System.out.println(self.toString());
System.out.println(arg.toString());
return "22";
}
But I am getting NPE.
How can we help if you do not give us actual details about the NPE (e.g. a stack trace)?
Quote:
It is not displaying those sysout statements in console also. So I guess it is not considering that method even though I pass a String arg!!
I tried by this also
public static String setValue(EObject self,String args[]) {
//self
System.out.println(self.toString());
return "22";
}
The documentation page Laurent already pointed you at clearly mentions that "array types are not supported" for the arguments of service methods.
Quote:
How can I give a method so that it returns integer data type.
I just tested, and a service method which returns an int works perfectly fine.
public int nodeBorderSize(EClass klass) {
return klass.getName().length();
}
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Can't edit cell in sirius table after getting error [message #1800137 is a reply to message #1798626] |
Thu, 20 December 2018 11:12 |
Prajna VG Messages: 54 Registered: July 2018 |
Member |
|
|
Hi Pierre,
I tried using service method it is working for integer value if I set value expression service:setValue(arg0)
But if I enter alphabetical value we are getting java.lang.IllegalArgumentException
Below is the stack trace of my code.
!ENTRY org.eclipse.ui 4 0 2018-12-20 16:33:56.629
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalArgumentException: The value 'hn' is invalid. java.lang.NumberFormatException: For input string: "hn"
at org.eclipse.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:470)
at autosar40.genericstructure.generaltemplateclasses.primitivetypes.impl.PrimitivetypesFactoryImpl.createPositiveIntegerFromString(PrimitivetypesFactoryImpl.java:886)
at autosar40.genericstructure.generaltemplateclasses.primitivetypes.impl.PrimitivetypesFactoryImpl.createFromString(PrimitivetypesFactoryImpl.java:163)
at org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport.setValue(DFeatureColumnEditingSupport.java:245)
at org.eclipse.jface.viewers.EditingSupport.saveCellEditorValue(EditingSupport.java:113)
at org.eclipse.jface.viewers.ColumnViewerEditor.saveEditorValue(ColumnViewerEditor.java:453)
at org.eclipse.jface.viewers.ColumnViewerEditor.applyEditorValue(ColumnViewerEditor.java:309)
at org.eclipse.jface.viewers.ColumnViewerEditor.handleEditorActivationEvent(ColumnViewerEditor.java:436)
at org.eclipse.jface.viewers.ColumnViewer.triggerEditorActivationEvent(ColumnViewer.java:677)
at org.eclipse.sirius.table.ui.tools.internal.editor.DTableTreeViewer.triggerEditorActivationEvent(DTableTreeViewer.java:109)
at org.eclipse.jface.viewers.ColumnViewer.handleMouseDown(ColumnViewer.java:652)
at org.eclipse.jface.viewers.ColumnViewer.access$0(ColumnViewer.java:648)
at org.eclipse.jface.viewers.ColumnViewer$1.mouseDoubleClick(ColumnViewer.java:103)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:197)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.NumberFormatException: For input string: "hn"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.valueOf(Unknown Source)
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.emf.ecore.impl.EFactoryImpl.createFromString(EFactoryImpl.java:454)
... 40 more
and after we can not edit that cell. Can anyone help me on how I can enable that cell after getting that error.
[Updated on: Thu, 20 December 2018 11:13] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04726 seconds