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

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 =, feature).observe(info);

IObservableValue model =
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);

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?

Previous Topic:EMF Notification
Next Topic:EMF Cross platform:/plugin Resource Persistence
Goto Forum:

Current Time: Mon Dec 16 03:01:25 GMT 2019

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

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

Back to the top