Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Databinding to map entry
Databinding to map entry [message #1691087] Thu, 02 April 2015 08:54
Dollyn Sun is currently offline Dollyn SunFriend
Messages: 68
Registered: July 2009
Location: China
Member

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
Previous Topic:EMF Notification
Next Topic:EMF Cross platform:/plugin Resource Persistence
Goto Forum:
  


Current Time: Fri Apr 26 20:25:45 GMT 2024

Powered by FUDForum. Page generated in 0.03000 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top