Bug 476587 - Impossible to define a label edit for a column mapped on an EEnum
Summary: Impossible to define a label edit for a column mapped on an EEnum
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Table (show other bugs)
Version: 2.0.5   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-09-03 12:20 EDT by Stéphane Thibaudeau CLA
Modified: 2015-09-11 09:44 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.