|
Re: [EMF Forms] ComboBox CellEditor [message #1700832 is a reply to message #1700597] |
Tue, 07 July 2015 13:31 |
|
Hi,
Databinding here works as follows:
EMFForms will call getValueProperty#observe and will hand in an instance of the ComboBoxCellEditor, which is to be observed, as the source.
This will be bound to the edited model value. When either the model or the target changes, the UpdateValueStrategy will be used to set the values on the target/model.
As far as I can see the problem with your code is, that in the TargetToModelStrategy a String is returned in the convert method. However you can't set a string as the enum value on the model, so you end up with an unexecutable command. You have to convert this String and return the result.
You can set a break point in the convert method and follow the execution path to see how the model is updated.
Best regards
Johannes
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
Re: [EMF Forms] ComboBox CellEditor [message #1701389 is a reply to message #1701289] |
Mon, 13 July 2015 08:06 |
|
Hi,
I think the easiest way is to directly set all possible Enumerators as the input of the combo and set a suitable label provider.
You can get the Enumerators from the EEnum like this:
final EEnum eEnum = (EEnum) feature.getEType();
final List<Enumerator> input = new ArrayList<Enumerator>();
for (final EEnumLiteral literal : eEnum.getELiterals()) {
input.add(literal.getInstance());
}
But you could also use the other EEnum methods to get a specific EEnumLiteral based on your String and use getInstance to get the Enumerator.
Cheers,
Johannes
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.03816 seconds