Bug 481770 - Edition table - impossible to edit an enum Feature column.
Summary: Edition table - impossible to edit an enum Feature column.
Status: CLOSED INVALID
Alias: None
Product: Sirius
Classification: Modeling
Component: Table (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-11-09 15:13 EST by Yariv Amar CLA
Modified: 2015-11-23 08:37 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yariv Amar CLA 2015-11-09 15:13:29 EST
When double clicking on feature column that is enum type i get the following exception. But, editing the same column (feature) via the Properties view is working fine.


!ENTRY org.eclipse.ui 4 0 2015-11-09 22:07:08.666
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport.getBestCellEditor(DFeatureColumnEditingSupport.java:375)
	at org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport.getCellEditor(DFeatureColumnEditingSupport.java:168)
	at org.eclipse.jface.viewers.ColumnViewerEditor.activateCellEditor(ColumnViewerEditor.java:170)
	at org.eclipse.jface.viewers.ColumnViewerEditor.handleEditorActivationEvent(ColumnViewerEditor.java:452)
	at org.eclipse.jface.viewers.ColumnViewer.triggerEditorActivationEvent(ColumnViewer.java:676)
	at org.eclipse.sirius.table.ui.tools.internal.editor.DTableTreeViewer.triggerEditorActivationEvent(DTableTreeViewer.java:109)
	at org.eclipse.jface.viewers.ColumnViewer.handleMouseDown(ColumnViewer.java:651)
	at org.eclipse.jface.viewers.ColumnViewer.access$0(ColumnViewer.java:647)
	at org.eclipse.jface.viewers.ColumnViewer$1.mouseDoubleClick(ColumnViewer.java:102)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	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:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	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:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Comment 1 Maxime Porhel CLA 2015-11-16 08:08:59 EST
Bug 476587 might be related to this.
Comment 2 Maxime Porhel CLA 2015-11-16 08:19:13 EST
It seems Sirius did not find any org.eclipse.emf.edit.provider.IItemPropertyDescriptor for the EObject behind the line of the current clicked cell. Without this, it is not able to create the direct edit combo.

Could you check that you have the EMF generated edit plugin corresponding to your metamodel in your environment ?
Comment 3 Yariv Amar CLA 2015-11-16 11:32:52 EST
(In reply to Maxime Porhel from comment #2)
> It seems Sirius did not find any
> org.eclipse.emf.edit.provider.IItemPropertyDescriptor for the EObject behind
> the line of the current clicked cell. Without this, it is not able to create
> the direct edit combo.
> 
> Could you check that you have the EMF generated edit plugin corresponding to
> your metamodel in your environment ?

I'm not sure i know what to check. What do you mean by " EMF generated edit plugin "?
I'm using xText to define a DSL which generates the ecore model. I then use Sirius on top of the generated ecore.
For every enum that i define in xText, i see an ecore enum class like that:

public enum MyTypeEnum implements org.eclipse.emf.common.util.Enumerator
{
  VALUE_1(0, "VALUE_1", "VALUE_1"),
  VALUE_2(1, "VALUE_2", "VALUE_2");
....
}

in addition, when I click the row/column in Sirius table, the default properties is showing the enum correctly, and i can modify it's value from the drop-down.
Comment 4 Maxime Porhel CLA 2015-11-17 08:46:03 EST
You can have a look to [1] as indicated by Laurent 
on the forum for your question about "icons in table rows" [2]:

> You need to generate the edit plugin associated to the metamodel. 
> You can have a look to [1] Integration with EMF, especially "...From the derived 
> Ecore model and its generator model, we generated the edit plug-in (needed by GMF) 
> and added some fancier icons..." 

The EMF.edit plugin generated from your ecore/genmodel files will contain generated IPropertyDescriptor corresponding to your metamodel.



Regards, 

Maxime


[1] https://eclipse.org/Xtext/documentation/308_emf_integration.html
[2]
Comment 5 Yariv Amar CLA 2015-11-23 08:37:25 EST
yes, that's the solution.

on the xText project, right click on the generated *.genmodel and create the edit plugin. Then enums are editable properly in tables.