Databinding to map entry [message #1691087] |
Thu, 02 April 2015 08:54 |
|
My EMF class has a feature of type EMap, I want to bind one of the
key-value pair to a swt Text control:
EStructuralFeature feature = xxxx;
IObservableMap observableMap =
EMFEditProperties.map(domain, feature).observe(info);
IObservableValue model =
Observables.observeMapEntry(observableMap,"key");
context.bindValue(SWTObservables.observeText(control, events), model);
But this does not work, when I type something in the Text control, the
value just cannot be set back to the map entry.
And I find out that in the EMFEditMapProperty class, the doSetMap method
like this:
protected void doSetMap(Object source, Map map, MapDiff diff)
{
EObject eObject = (EObject)source;
Command command = SetCommand.create(editingDomain, eObject,
getFeature(), map);
editingDomain.getCommandStack().execute(command);
}
it use a "SetCommand" to set the EMap feature, but this does not work.
And I find out that infact, EMap is not a java.util.Map, but is a
List... I think this could be a bug here, or I have mis-used this class?
Dollyn
|
|
|
Powered by
FUDForum. Page generated in 0.03631 seconds