Bug 476587

Summary: Impossible to define a label edit for a column mapped on an EEnum
Product: [Modeling] Sirius Reporter: Stéphane Thibaudeau <stephane.thibaudeau>
Component: TableAssignee: Project Inbox <sirius.table-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.fasani, maxime.porhel
Version: 2.0.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Stéphane Thibaudeau CLA 2015-09-03 12:20:11 EDT
I have an edition table with a feature column mapped on an EAttribute using an EEnum as its type.
If I define no label edit tool, everything works : when I try to edit, a dropdown with all EEnum values is displayed and when I pick a value it is correctly set.

But it's impossible to define a label edit tool on this column and have it working. When I try to edit the column, the following exception occurs :

org.eclipse.core.runtime.AssertionFailedException: assertion failed: 
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:96)
	at org.eclipse.jface.viewers.TextCellEditor.doSetValue(TextCellEditor.java:231)
	at org.eclipse.sirius.table.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport$3.doSetValue(DFeatureColumnEditingSupport.java:438)
Comment 1 Maxime Porhel CLA 2015-09-04 03:52:21 EDT
The TextCellEditor expects a String, not an Integer. 
 . if a label expression is used in the VSM, the oest.ui.tools.internal.editor.provider.DFeatureColumnEditingSupport.getValue(Object) returns -1
 . if the edit plugin properties have been modified, the displayed name does not correspond to a literal name any more and getValue will also return -1


I think we need to: 
 . handle the EEnum case cell editor initialization for EEnum typed features to avoid exceptions
 . it should be great to add the inputLabelExpression as in diagram to let the specififer init the text to edit.
 . provide a new EEnumDirectEdit able to display the combo but let the specifier add operations: the EEnum has been used to restrict/define the choice of valid values for the feature.