Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: [JFace Databinding] Bind EMap value to Text
Re: [JFace Databinding] Bind EMap value to Text [message #427374] Sun, 15 February 2009 17:38 Go to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Hi Kai,

I don't think there's direct support for this currently. The only
possibility i see currently is to create a volatile transient feature
(height) whenever the height changes you fire a notification for the
height feature.

If you have further question please we should discuss on the
EMF-Newsgroup - I think with the 3.5 properties API one can also observe
map-attributes but I'm not 100% sure.

Tom

Kai Schlamp schrieb:
> Hello.
>
> I want to observe a map (better to say a specific value belonging to a
> specific key) that is a child of an EMF EObject.
>
> Example (Pseudocode):
>
> Datastructure:
>
> class Building extends EObject {
> EMap properties
> }
>
> Binding:
>
> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>
> So how do I bind, let's say myBuilding.getProperties.get("height") to
> myTextField?
>
> Best regards,
> Kai
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427376 is a reply to message #427374] Sun, 15 February 2009 23:28 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Comments below.

Tom Schindl schrieb:
> Hi Kai,
>
> I don't think there's direct support for this currently. The only
> possibility i see currently is to create a volatile transient feature
> (height) whenever the height changes you fire a notification for the
> height feature.

This won't be an option as there are quite many entries in my map that I
want to bind Text's to.

> If you have further question please we should discuss on the
> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
> map-attributes but I'm not 100% sure.

Does someone have a clue how to do that? I am not aware of the 3.5
properties API (althought I am using the current 3.5 milestone release).

>
> Tom
>
> Kai Schlamp schrieb:
>> Hello.
>>
>> I want to observe a map (better to say a specific value belonging to a
>> specific key) that is a child of an EMF EObject.
>>
>> Example (Pseudocode):
>>
>> Datastructure:
>>
>> class Building extends EObject {
>> EMap properties
>> }
>>
>> Binding:
>>
>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>
>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>> myTextField?
>>
>> Best regards,
>> Kai
>>
>>
>
>
Re: [JFace Databinding] Bind EMap value to Text [message #427377 is a reply to message #427376] Mon, 16 February 2009 09:00 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Hi Kai,

What one would need to write is an ObservableValue implementation for a
Map-Entry (as the current EMFObservables.observeMap() is for multi
valued features).

I'll take a look into how EMap-works and how it fires events so that one
could write an ObservableValue implementation for a specific key.

Something like this:

EMFObservables#observeMapEntry(
EObject obj,
EStructuralFeature feature,
String key)


I've never used EMap before but does it fire events on map changes?

The properties API I mentioned before isn't a solution and when using
EMF you could not use it because I'm still working on the EMF-port [1]
or if you prefer a workspace setup of the appropriate modules (I had to
patch the databinding.core which I need to recode soon) and see example
usage[2].

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
[2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter

Kai Schlamp schrieb:
> Comments below.
>
> Tom Schindl schrieb:
>> Hi Kai,
>>
>> I don't think there's direct support for this currently. The only
>> possibility i see currently is to create a volatile transient feature
>> (height) whenever the height changes you fire a notification for the
>> height feature.
>
> This won't be an option as there are quite many entries in my map that I
> want to bind Text's to.
>
>> If you have further question please we should discuss on the
>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>> map-attributes but I'm not 100% sure.
>
> Does someone have a clue how to do that? I am not aware of the 3.5
> properties API (althought I am using the current 3.5 milestone release).
>
>>
>> Tom
>>
>> Kai Schlamp schrieb:
>>> Hello.
>>>
>>> I want to observe a map (better to say a specific value belonging to a
>>> specific key) that is a child of an EMF EObject.
>>>
>>> Example (Pseudocode):
>>>
>>> Datastructure:
>>>
>>> class Building extends EObject {
>>> EMap properties
>>> }
>>>
>>> Binding:
>>>
>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>
>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>> myTextField?
>>>
>>> Best regards,
>>> Kai
>>>
>>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427381 is a reply to message #427377] Mon, 16 February 2009 12:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30688
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010005070204030908040903
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Guys,

An EMap is effectively just a list of EObjects that implement
Map.Entry. There's no generated API/interface for the map entry EClass,
but the usual meta data for it exists in the generated package and such
an EClass will always have a "key" and a "value" feature. So you should
be able to observe the one entry in the usual way. You could use
eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
you could cast it to EObject...


Tom Schindl wrote:
> Hi Kai,
>
> What one would need to write is an ObservableValue implementation for a
> Map-Entry (as the current EMFObservables.observeMap() is for multi
> valued features).
>
> I'll take a look into how EMap-works and how it fires events so that one
> could write an ObservableValue implementation for a specific key.
>
> Something like this:
>
> EMFObservables#observeMapEntry(
> EObject obj,
> EStructuralFeature feature,
> String key)
>
>
> I've never used EMap before but does it fire events on map changes?
>
> The properties API I mentioned before isn't a solution and when using
> EMF you could not use it because I'm still working on the EMF-port [1]
> or if you prefer a workspace setup of the appropriate modules (I had to
> patch the databinding.core which I need to recode soon) and see example
> usage[2].
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>
> Kai Schlamp schrieb:
>
>> Comments below.
>>
>> Tom Schindl schrieb:
>>
>>> Hi Kai,
>>>
>>> I don't think there's direct support for this currently. The only
>>> possibility i see currently is to create a volatile transient feature
>>> (height) whenever the height changes you fire a notification for the
>>> height feature.
>>>
>> This won't be an option as there are quite many entries in my map that I
>> want to bind Text's to.
>>
>>
>>> If you have further question please we should discuss on the
>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>> map-attributes but I'm not 100% sure.
>>>
>> Does someone have a clue how to do that? I am not aware of the 3.5
>> properties API (althought I am using the current 3.5 milestone release).
>>
>>
>>> Tom
>>>
>>> Kai Schlamp schrieb:
>>>
>>>> Hello.
>>>>
>>>> I want to observe a map (better to say a specific value belonging to a
>>>> specific key) that is a child of an EMF EObject.
>>>>
>>>> Example (Pseudocode):
>>>>
>>>> Datastructure:
>>>>
>>>> class Building extends EObject {
>>>> EMap properties
>>>> }
>>>>
>>>> Binding:
>>>>
>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>
>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>> myTextField?
>>>>
>>>> Best regards,
>>>> Kai
>>>>
>>>>
>>>>
>>>
>
>
>

--------------010005070204030908040903
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guys,<br>
<br>
An EMap is effectively just a list of EObjects that implement
Map.Entry.
Re: [JFace Databinding] Bind EMap value to Text [message #427402 is a reply to message #427381] Mon, 16 February 2009 22:01 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Thanks for the explanations, Ed.
Do you have a simple example when using a bindingContext?

Lets assume the simple data structure from my first posting:

class Building extends EObject {
EMap props
}

and now I need the IObservableValue of myBuilding.getProps.get("height")
for example to bind it to a text.

EMFObservables.observeValue(myBuilding.getProps, ???)

Thanks,
Kai

Ed Merks schrieb:
> Guys,
>
> An EMap is effectively just a list of EObjects that implement
> Map.Entry. There's no generated API/interface for the map entry EClass,
> but the usual meta data for it exists in the generated package and such
> an EClass will always have a "key" and a "value" feature. So you should
> be able to observe the one entry in the usual way. You could use
> eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
> you could cast it to EObject...
>
>
> Tom Schindl wrote:
>> Hi Kai,
>>
>> What one would need to write is an ObservableValue implementation for a
>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>> valued features).
>>
>> I'll take a look into how EMap-works and how it fires events so that one
>> could write an ObservableValue implementation for a specific key.
>>
>> Something like this:
>>
>> EMFObservables#observeMapEntry(
>> EObject obj,
>> EStructuralFeature feature,
>> String key)
>>
>>
>> I've never used EMap before but does it fire events on map changes?
>>
>> The properties API I mentioned before isn't a solution and when using
>> EMF you could not use it because I'm still working on the EMF-port [1]
>> or if you prefer a workspace setup of the appropriate modules (I had to
>> patch the databinding.core which I need to recode soon) and see example
>> usage[2].
>>
>> Tom
>>
>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>
>> Kai Schlamp schrieb:
>>
>>> Comments below.
>>>
>>> Tom Schindl schrieb:
>>>
>>>> Hi Kai,
>>>>
>>>> I don't think there's direct support for this currently. The only
>>>> possibility i see currently is to create a volatile transient feature
>>>> (height) whenever the height changes you fire a notification for the
>>>> height feature.
>>>>
>>> This won't be an option as there are quite many entries in my map that I
>>> want to bind Text's to.
>>>
>>>
>>>> If you have further question please we should discuss on the
>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>>> map-attributes but I'm not 100% sure.
>>>>
>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>> properties API (althought I am using the current 3.5 milestone release).
>>>
>>>
>>>> Tom
>>>>
>>>> Kai Schlamp schrieb:
>>>>
>>>>> Hello.
>>>>>
>>>>> I want to observe a map (better to say a specific value belonging to a
>>>>> specific key) that is a child of an EMF EObject.
>>>>>
>>>>> Example (Pseudocode):
>>>>>
>>>>> Datastructure:
>>>>>
>>>>> class Building extends EObject {
>>>>> EMap properties
>>>>> }
>>>>>
>>>>> Binding:
>>>>>
>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>>
>>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>>> myTextField?
>>>>>
>>>>> Best regards,
>>>>> Kai
>>>>>
>>>>>
>>>>>
>>>>
>>
>>
>>
Re: [JFace Databinding] Bind EMap value to Text [message #427403 is a reply to message #427381] Mon, 16 February 2009 23:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Hi Ed,

I just looked how an feature modeled as an EMap works and I'm sorry but
I think I don't get it. An EMap is an ordinary java.util.Map and it
doesn't fire events. Do you by change talk about an EFeatureMap?

So I don't see a chance to provide an ObservableValue implementation for
an entry in the map.


Tom


Ed Merks schrieb:
> Guys,
>
> An EMap is effectively just a list of EObjects that implement
> Map.Entry. There's no generated API/interface for the map entry EClass,
> but the usual meta data for it exists in the generated package and such
> an EClass will always have a "key" and a "value" feature. So you should
> be able to observe the one entry in the usual way. You could use
> eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
> you could cast it to EObject...
>
>
> Tom Schindl wrote:
>> Hi Kai,
>>
>> What one would need to write is an ObservableValue implementation for a
>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>> valued features).
>>
>> I'll take a look into how EMap-works and how it fires events so that one
>> could write an ObservableValue implementation for a specific key.
>>
>> Something like this:
>>
>> EMFObservables#observeMapEntry(
>> EObject obj,
>> EStructuralFeature feature,
>> String key)
>>
>>
>> I've never used EMap before but does it fire events on map changes?
>>
>> The properties API I mentioned before isn't a solution and when using
>> EMF you could not use it because I'm still working on the EMF-port [1]
>> or if you prefer a workspace setup of the appropriate modules (I had to
>> patch the databinding.core which I need to recode soon) and see example
>> usage[2].
>>
>> Tom
>>
>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>
>> Kai Schlamp schrieb:
>>
>>> Comments below.
>>>
>>> Tom Schindl schrieb:
>>>
>>>> Hi Kai,
>>>>
>>>> I don't think there's direct support for this currently. The only
>>>> possibility i see currently is to create a volatile transient feature
>>>> (height) whenever the height changes you fire a notification for the
>>>> height feature.
>>>>
>>> This won't be an option as there are quite many entries in my map that I
>>> want to bind Text's to.
>>>
>>>
>>>> If you have further question please we should discuss on the
>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>>> map-attributes but I'm not 100% sure.
>>>>
>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>> properties API (althought I am using the current 3.5 milestone release).
>>>
>>>
>>>> Tom
>>>>
>>>> Kai Schlamp schrieb:
>>>>
>>>>> Hello.
>>>>>
>>>>> I want to observe a map (better to say a specific value belonging to a
>>>>> specific key) that is a child of an EMF EObject.
>>>>>
>>>>> Example (Pseudocode):
>>>>>
>>>>> Datastructure:
>>>>>
>>>>> class Building extends EObject {
>>>>> EMap properties
>>>>> }
>>>>>
>>>>> Binding:
>>>>>
>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>>
>>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>>> myTextField?
>>>>>
>>>>> Best regards,
>>>>> Kai
>>>>>
>>>>>
>>>>>
>>>>
>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427416 is a reply to message #427402] Tue, 17 February 2009 16:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30688
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010701050905050605080100
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Kai,

Comments below.

Kai Schlamp wrote:
> Thanks for the explanations, Ed.
> Do you have a simple example when using a bindingContext?
Unfortunately not.
>
> Lets assume the simple data structure from my first posting:
>
> class Building extends EObject {
> EMap props
> }
>
> and now I need the IObservableValue of
> myBuilding.getProps.get("height") for example to bind it to a text.
This should yield you an EObject you can observe like all the other
examples:

(EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))

Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
feature for that map entry...
>
> EMFObservables.observeValue(myBuilding.getProps, ???)
>
> Thanks,
> Kai
>
> Ed Merks schrieb:
>> Guys,
>>
>> An EMap is effectively just a list of EObjects that implement
>> Map.Entry. There's no generated API/interface for the map entry
>> EClass, but the usual meta data for it exists in the generated
>> package and such an EClass will always have a "key" and a "value"
>> feature. So you should be able to observe the one entry in the usual
>> way. You could use eMap.indexOf(key) and then eMap.get(index) to get
>> the Map.Entry and then you could cast it to EObject...
>>
>>
>> Tom Schindl wrote:
>>> Hi Kai,
>>>
>>> What one would need to write is an ObservableValue implementation for a
>>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>>> valued features).
>>>
>>> I'll take a look into how EMap-works and how it fires events so that
>>> one
>>> could write an ObservableValue implementation for a specific key.
>>>
>>> Something like this:
>>>
>>> EMFObservables#observeMapEntry(
>>> EObject obj,
>>> EStructuralFeature feature,
>>> String key)
>>>
>>>
>>> I've never used EMap before but does it fire events on map changes?
>>>
>>> The properties API I mentioned before isn't a solution and when using
>>> EMF you could not use it because I'm still working on the EMF-port [1]
>>> or if you prefer a workspace setup of the appropriate modules (I had to
>>> patch the databinding.core which I need to recode soon) and see example
>>> usage[2].
>>>
>>> Tom
>>>
>>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>>
>>> Kai Schlamp schrieb:
>>>
>>>> Comments below.
>>>>
>>>> Tom Schindl schrieb:
>>>>
>>>>> Hi Kai,
>>>>>
>>>>> I don't think there's direct support for this currently. The only
>>>>> possibility i see currently is to create a volatile transient feature
>>>>> (height) whenever the height changes you fire a notification for the
>>>>> height feature.
>>>>>
>>>> This won't be an option as there are quite many entries in my map
>>>> that I
>>>> want to bind Text's to.
>>>>
>>>>
>>>>> If you have further question please we should discuss on the
>>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also
>>>>> observe
>>>>> map-attributes but I'm not 100% sure.
>>>>>
>>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>>> properties API (althought I am using the current 3.5 milestone
>>>> release).
>>>>
>>>>
>>>>> Tom
>>>>>
>>>>> Kai Schlamp schrieb:
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> I want to observe a map (better to say a specific value belonging
>>>>>> to a
>>>>>> specific key) that is a child of an EMF EObject.
>>>>>>
>>>>>> Example (Pseudocode):
>>>>>>
>>>>>> Datastructure:
>>>>>>
>>>>>> class Building extends EObject {
>>>>>> EMap properties
>>>>>> }
>>>>>>
>>>>>> Binding:
>>>>>>
>>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null,
>>>>>> null);
>>>>>>
>>>>>> So how do I bind, let's say
>>>>>> myBuilding.getProperties.get("height") to
>>>>>> myTextField?
>>>>>>
>>>>>> Best regards,
>>>>>> Kai
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>>>
>>>

--------------010701050905050605080100
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Kai,<br>
<br>
Comments below.<br>
<br>
Kai Schlamp wrote:
<blockquote cite="mid:gncno2$jco$1@build.eclipse.org" type="cite">Thanks
for the explanations, Ed.
<br>
Do you have a simple example when using a bindingContext?
<br>
</blockquote>
Unfortunately not.<br>
<blockquote cite="mid:gncno2$jco$1@build.eclipse.org" type="cite"><br>
Lets assume the simple data structure from my first posting:
<br>
<br>
class Building extends EObject {
<br>
Re: [JFace Databinding] Bind EMap value to Text [message #427417 is a reply to message #427403] Tue, 17 February 2009 16:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30688
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010903070500010801010803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Tom,

Comments below.

Tom Schindl wrote:
> Hi Ed,
>
> I just looked how an feature modeled as an EMap works and I'm sorry but
> I think I don't get it.
I thought it was totally self-evident. :-P
> An EMap is an ordinary java.util.Map and it
> doesn't fire events.
No, it's not. It's a containment EList with all the other methods on a
java.util.Map, and you can get a Map view of it.
> Do you by change talk about an EFeatureMap?
>
FeatureMap is a different thing. No one asked about that yet I don't think.
> So I don't see a chance to provide an ObservableValue implementation for
> an entry in the map.
>
Yes because the Map.Entry instances implement EObject (because the EMap
is just a containment list).
>
> Tom
>
>
> Ed Merks schrieb:
>
>> Guys,
>>
>> An EMap is effectively just a list of EObjects that implement
>> Map.Entry. There's no generated API/interface for the map entry EClass,
>> but the usual meta data for it exists in the generated package and such
>> an EClass will always have a "key" and a "value" feature. So you should
>> be able to observe the one entry in the usual way. You could use
>> eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
>> you could cast it to EObject...
>>
>>
>> Tom Schindl wrote:
>>
>>> Hi Kai,
>>>
>>> What one would need to write is an ObservableValue implementation for a
>>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>>> valued features).
>>>
>>> I'll take a look into how EMap-works and how it fires events so that one
>>> could write an ObservableValue implementation for a specific key.
>>>
>>> Something like this:
>>>
>>> EMFObservables#observeMapEntry(
>>> EObject obj,
>>> EStructuralFeature feature,
>>> String key)
>>>
>>>
>>> I've never used EMap before but does it fire events on map changes?
>>>
>>> The properties API I mentioned before isn't a solution and when using
>>> EMF you could not use it because I'm still working on the EMF-port [1]
>>> or if you prefer a workspace setup of the appropriate modules (I had to
>>> patch the databinding.core which I need to recode soon) and see example
>>> usage[2].
>>>
>>> Tom
>>>
>>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>>
>>> Kai Schlamp schrieb:
>>>
>>>
>>>> Comments below.
>>>>
>>>> Tom Schindl schrieb:
>>>>
>>>>
>>>>> Hi Kai,
>>>>>
>>>>> I don't think there's direct support for this currently. The only
>>>>> possibility i see currently is to create a volatile transient feature
>>>>> (height) whenever the height changes you fire a notification for the
>>>>> height feature.
>>>>>
>>>>>
>>>> This won't be an option as there are quite many entries in my map that I
>>>> want to bind Text's to.
>>>>
>>>>
>>>>
>>>>> If you have further question please we should discuss on the
>>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>>>> map-attributes but I'm not 100% sure.
>>>>>
>>>>>
>>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>>> properties API (althought I am using the current 3.5 milestone release).
>>>>
>>>>
>>>>
>>>>> Tom
>>>>>
>>>>> Kai Schlamp schrieb:
>>>>>
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> I want to observe a map (better to say a specific value belonging to a
>>>>>> specific key) that is a child of an EMF EObject.
>>>>>>
>>>>>> Example (Pseudocode):
>>>>>>
>>>>>> Datastructure:
>>>>>>
>>>>>> class Building extends EObject {
>>>>>> EMap properties
>>>>>> }
>>>>>>
>>>>>> Binding:
>>>>>>
>>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>>>
>>>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>>>> myTextField?
>>>>>>
>>>>>> Best regards,
>>>>>> Kai
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
>

--------------010903070500010801010803
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tom,<br>
<br>
Comments below.<br>
<br>
Tom Schindl wrote:
<blockquote cite="mid:gncsse$67u$1@build.eclipse.org" type="cite">
<pre wrap="">Hi Ed,

I just looked how an feature modeled as an EMap works and I'm sorry but
I think I don't get it.</pre>
</blockquote>
I thought it was totally self-evident. :-P<br>
<blockquote cite="mid:gncsse$67u$1@build.eclipse.org" type="cite">
<pre wrap=""> An EMap is an ordinary java.util.Map and it
doesn't fire events.</pre>
</blockquote>
No, it's not.
Re: [JFace Databinding] Bind EMap value to Text [message #427426 is a reply to message #427417] Tue, 17 February 2009 18:30 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Hi,

Could you guys please provide me with a simple .ecore so that I generate
the code and write an ObservableValue implementation which should be
quite easy?

Tom

Ed Merks schrieb:
> Tom,
>
> Comments below.
>
> Tom Schindl wrote:
>> Hi Ed,
>>
>> I just looked how an feature modeled as an EMap works and I'm sorry but
>> I think I don't get it.
> I thought it was totally self-evident. :-P
>> An EMap is an ordinary java.util.Map and it
>> doesn't fire events.
> No, it's not. It's a containment EList with all the other methods on a
> java.util.Map, and you can get a Map view of it.
>> Do you by change talk about an EFeatureMap?
>>
> FeatureMap is a different thing. No one asked about that yet I don't think.
>> So I don't see a chance to provide an ObservableValue implementation for
>> an entry in the map.
>>
> Yes because the Map.Entry instances implement EObject (because the EMap
> is just a containment list).
>>
>> Tom
>>
>>
>> Ed Merks schrieb:
>>
>>> Guys,
>>>
>>> An EMap is effectively just a list of EObjects that implement
>>> Map.Entry. There's no generated API/interface for the map entry EClass,
>>> but the usual meta data for it exists in the generated package and such
>>> an EClass will always have a "key" and a "value" feature. So you should
>>> be able to observe the one entry in the usual way. You could use
>>> eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
>>> you could cast it to EObject...
>>>
>>>
>>> Tom Schindl wrote:
>>>
>>>> Hi Kai,
>>>>
>>>> What one would need to write is an ObservableValue implementation for a
>>>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>>>> valued features).
>>>>
>>>> I'll take a look into how EMap-works and how it fires events so that one
>>>> could write an ObservableValue implementation for a specific key.
>>>>
>>>> Something like this:
>>>>
>>>> EMFObservables#observeMapEntry(
>>>> EObject obj,
>>>> EStructuralFeature feature,
>>>> String key)
>>>>
>>>>
>>>> I've never used EMap before but does it fire events on map changes?
>>>>
>>>> The properties API I mentioned before isn't a solution and when using
>>>> EMF you could not use it because I'm still working on the EMF-port [1]
>>>> or if you prefer a workspace setup of the appropriate modules (I had to
>>>> patch the databinding.core which I need to recode soon) and see example
>>>> usage[2].
>>>>
>>>> Tom
>>>>
>>>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>>>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>>>
>>>> Kai Schlamp schrieb:
>>>>
>>>>
>>>>> Comments below.
>>>>>
>>>>> Tom Schindl schrieb:
>>>>>
>>>>>
>>>>>> Hi Kai,
>>>>>>
>>>>>> I don't think there's direct support for this currently. The only
>>>>>> possibility i see currently is to create a volatile transient feature
>>>>>> (height) whenever the height changes you fire a notification for the
>>>>>> height feature.
>>>>>>
>>>>>>
>>>>> This won't be an option as there are quite many entries in my map that I
>>>>> want to bind Text's to.
>>>>>
>>>>>
>>>>>
>>>>>> If you have further question please we should discuss on the
>>>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>>>>> map-attributes but I'm not 100% sure.
>>>>>>
>>>>>>
>>>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>>>> properties API (althought I am using the current 3.5 milestone release).
>>>>>
>>>>>
>>>>>
>>>>>> Tom
>>>>>>
>>>>>> Kai Schlamp schrieb:
>>>>>>
>>>>>>
>>>>>>> Hello.
>>>>>>>
>>>>>>> I want to observe a map (better to say a specific value belonging to a
>>>>>>> specific key) that is a child of an EMF EObject.
>>>>>>>
>>>>>>> Example (Pseudocode):
>>>>>>>
>>>>>>> Datastructure:
>>>>>>>
>>>>>>> class Building extends EObject {
>>>>>>> EMap properties
>>>>>>> }
>>>>>>>
>>>>>>> Binding:
>>>>>>>
>>>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>>>>
>>>>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>>>>> myTextField?
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Kai
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427427 is a reply to message #427426] Tue, 17 February 2009 19:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30688
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020502050807080607090901
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Tom,

Ecore.ecore has EAnnotation.details so you can do this directly with the
Ecore model. I'm not sure that anything that doesn't already exist is
needed...


Tom Schindl wrote:
> Hi,
>
> Could you guys please provide me with a simple .ecore so that I generate
> the code and write an ObservableValue implementation which should be
> quite easy?
>
> Tom
>
> Ed Merks schrieb:
>
>> Tom,
>>
>> Comments below.
>>
>> Tom Schindl wrote:
>>
>>> Hi Ed,
>>>
>>> I just looked how an feature modeled as an EMap works and I'm sorry but
>>> I think I don't get it.
>>>
>> I thought it was totally self-evident. :-P
>>
>>> An EMap is an ordinary java.util.Map and it
>>> doesn't fire events.
>>>
>> No, it's not. It's a containment EList with all the other methods on a
>> java.util.Map, and you can get a Map view of it.
>>
>>> Do you by change talk about an EFeatureMap?
>>>
>>>
>> FeatureMap is a different thing. No one asked about that yet I don't think.
>>
>>> So I don't see a chance to provide an ObservableValue implementation for
>>> an entry in the map.
>>>
>>>
>> Yes because the Map.Entry instances implement EObject (because the EMap
>> is just a containment list).
>>
>>> Tom
>>>
>>>
>>> Ed Merks schrieb:
>>>
>>>
>>>> Guys,
>>>>
>>>> An EMap is effectively just a list of EObjects that implement
>>>> Map.Entry. There's no generated API/interface for the map entry EClass,
>>>> but the usual meta data for it exists in the generated package and such
>>>> an EClass will always have a "key" and a "value" feature. So you should
>>>> be able to observe the one entry in the usual way. You could use
>>>> eMap.indexOf(key) and then eMap.get(index) to get the Map.Entry and then
>>>> you could cast it to EObject...
>>>>
>>>>
>>>> Tom Schindl wrote:
>>>>
>>>>
>>>>> Hi Kai,
>>>>>
>>>>> What one would need to write is an ObservableValue implementation for a
>>>>> Map-Entry (as the current EMFObservables.observeMap() is for multi
>>>>> valued features).
>>>>>
>>>>> I'll take a look into how EMap-works and how it fires events so that one
>>>>> could write an ObservableValue implementation for a specific key.
>>>>>
>>>>> Something like this:
>>>>>
>>>>> EMFObservables#observeMapEntry(
>>>>> EObject obj,
>>>>> EStructuralFeature feature,
>>>>> String key)
>>>>>
>>>>>
>>>>> I've never used EMap before but does it fire events on map changes?
>>>>>
>>>>> The properties API I mentioned before isn't a solution and when using
>>>>> EMF you could not use it because I'm still working on the EMF-port [1]
>>>>> or if you prefer a workspace setup of the appropriate modules (I had to
>>>>> patch the databinding.core which I need to recode soon) and see example
>>>>> usage[2].
>>>>>
>>>>> Tom
>>>>>
>>>>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>>>>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>>>>>
>>>>> Kai Schlamp schrieb:
>>>>>
>>>>>
>>>>>
>>>>>> Comments below.
>>>>>>
>>>>>> Tom Schindl schrieb:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi Kai,
>>>>>>>
>>>>>>> I don't think there's direct support for this currently. The only
>>>>>>> possibility i see currently is to create a volatile transient feature
>>>>>>> (height) whenever the height changes you fire a notification for the
>>>>>>> height feature.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> This won't be an option as there are quite many entries in my map that I
>>>>>> want to bind Text's to.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> If you have further question please we should discuss on the
>>>>>>> EMF-Newsgroup - I think with the 3.5 properties API one can also observe
>>>>>>> map-attributes but I'm not 100% sure.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> Does someone have a clue how to do that? I am not aware of the 3.5
>>>>>> properties API (althought I am using the current 3.5 milestone release).
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Tom
>>>>>>>
>>>>>>> Kai Schlamp schrieb:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hello.
>>>>>>>>
>>>>>>>> I want to observe a map (better to say a specific value belonging to a
>>>>>>>> specific key) that is a child of an EMF EObject.
>>>>>>>>
>>>>>>>> Example (Pseudocode):
>>>>>>>>
>>>>>>>> Datastructure:
>>>>>>>>
>>>>>>>> class Building extends EObject {
>>>>>>>> EMap properties
>>>>>>>> }
>>>>>>>>
>>>>>>>> Binding:
>>>>>>>>
>>>>>>>> bindingContext.bindValue(SWTObservables.observeText(myTextFi eld,
>>>>>>>> SWT.Modify), EMFObservables.observe???(myBuilding???, ???), null, null);
>>>>>>>>
>>>>>>>> So how do I bind, let's say myBuilding.getProperties.get("height") to
>>>>>>>> myTextField?
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Kai
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
>

--------------020502050807080607090901
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Tom,<br>
<br>
Ecore.ecore has EAnnotation.details so you can do this directly with
the Ecore model.
Re: [JFace Databinding] Bind EMap value to Text [message #427435 is a reply to message #427416] Tue, 17 February 2009 23:15 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Comment below

> This should yield you an EObject you can observe like all the other
> examples:
>
> (EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))
>
> Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
> feature for that map entry...

Yes, this works fine.

Here a little example of how a complete binding looks like:

bindingContext.bindValue(SWTObservables.observeText(textFiel d),
EMFObservables.observeValue((EObject)
document.getProperties().get(document.getProperties().indexO fKey( "title")),
DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE), null, null);

Thanks Ed.
Re: [JFace Databinding] Bind EMap value to Text [message #427441 is a reply to message #427435] Wed, 18 February 2009 07:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Should we provide this as part of our EMFObservables-API?

EMFObservables.observeMapValue(
myBuilding,
DocumentModelPackage.Literals.DOCUMENT_PROPERTY,
"title",
DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE
)


Tom

Kai Schlamp schrieb:
> Comment below
>
>> This should yield you an EObject you can observe like all the other
>> examples:
>>
>> (EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))
>>
>> Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
>> feature for that map entry...
>
> Yes, this works fine.
>
> Here a little example of how a complete binding looks like:
>
> bindingContext.bindValue(SWTObservables.observeText(textFiel d),
> EMFObservables.observeValue((EObject)
> document.getProperties().get(document.getProperties().indexO fKey( "title")),
> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE), null, null);
>
> Thanks Ed.


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427444 is a reply to message #427441] Wed, 18 February 2009 08:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Hi,

I added a factory method to my current working branch of EMF-Databinding
[1] (where I mainly implement the IProperty-Interfaces of 3.5).

You can fetch the sources from my public git repo [2] which also
provides a nice RCP Example Application showing many (if not all aspects
of Eclipse-Databinding with EMF).

If you are interested in EMF-Technologies (Ecore, Teneo, CDO) and RCP
I'll present all those concepts at EclipseCon 2009 [3].

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
[2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
[3]Mixing Eclipse Technologies to create Enterprise Ready
Database-RCP-Frontends - http://www.eclipsecon.org/2009/sessions?id=446


Tom Schindl schrieb:
> Should we provide this as part of our EMFObservables-API?
>
> EMFObservables.observeMapValue(
> myBuilding,
> DocumentModelPackage.Literals.DOCUMENT_PROPERTY,
> "title",
> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE
> )
>
>
> Tom
>
> Kai Schlamp schrieb:
>> Comment below
>>
>>> This should yield you an EObject you can observe like all the other
>>> examples:
>>>
>>> (EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))
>>>
>>> Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
>>> feature for that map entry...
>> Yes, this works fine.
>>
>> Here a little example of how a complete binding looks like:
>>
>> bindingContext.bindValue(SWTObservables.observeText(textFiel d),
>> EMFObservables.observeValue((EObject)
>> document.getProperties().get(document.getProperties().indexO fKey( "title")),
>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE), null, null);
>>
>> Thanks Ed.
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: [JFace Databinding] Bind EMap value to Text [message #427482 is a reply to message #427441] Wed, 18 February 2009 23:27 Go to previous messageGo to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Comments below.

Tom Schindl schrieb:
> Should we provide this as part of our EMFObservables-API?
>
> EMFObservables.observeMapValue(
> myBuilding,
> DocumentModelPackage.Literals.DOCUMENT_PROPERTY,
> "title",
> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE
> )

It looks indeed much cleaner and readable than the other code with
"indexOfKey" and so on. So in my opinion it would be useful.

Kai
Re: [JFace Databinding] Bind EMap value to Text [message #506276 is a reply to message #427444] Wed, 06 January 2010 18:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Thomas.Kowatsch.ruag.com

Hi Tom.
Do I miss something? I cannot find this method in the EMFObservable class.
--Thomas

Tom Schindl schrieb:
> Hi,
>
> I added a factory method to my current working branch of EMF-Databinding
> [1] (where I mainly implement the IProperty-Interfaces of 3.5).
>
> You can fetch the sources from my public git repo [2] which also
> provides a nice RCP Example Application showing many (if not all aspects
> of Eclipse-Databinding with EMF).
>
> If you are interested in EMF-Technologies (Ecore, Teneo, CDO) and RCP
> I'll present all those concepts at EclipseCon 2009 [3].
>
> Tom
>
> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
> [3]Mixing Eclipse Technologies to create Enterprise Ready
> Database-RCP-Frontends - http://www.eclipsecon.org/2009/sessions?id=446
>
>
> Tom Schindl schrieb:
>> Should we provide this as part of our EMFObservables-API?
>>
>> EMFObservables.observeMapValue(
>> myBuilding,
>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY,
>> "title",
>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE
>> )
>>
>>
>> Tom
>>
>> Kai Schlamp schrieb:
>>> Comment below
>>>
>>>> This should yield you an EObject you can observe like all the other
>>>> examples:
>>>>
>>>> (EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))
>>>>
>>>> Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
>>>> feature for that map entry...
>>> Yes, this works fine.
>>>
>>> Here a little example of how a complete binding looks like:
>>>
>>> bindingContext.bindValue(SWTObservables.observeText(textFiel d),
>>> EMFObservables.observeValue((EObject)
>>> document.getProperties().get(document.getProperties().indexO fKey( "title")),
>>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE), null, null);
>>>
>>> Thanks Ed.
>>
>
>
Re: [JFace Databinding] Bind EMap value to Text [message #506317 is a reply to message #506276] Wed, 06 January 2010 18:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6512
Registered: July 2009
Senior Member
Probably I removed it in later iterations (I really can't even remember
this very discussion) :-(. I guess you are in need of such a method right?

If you need something file a bugzilla and CC me on the bug. I hope I can
find some time and motivation (I'm trying hard to remotivate myself but
didn't fully succeeded yet) to spend on EMF-Databinding .

Tom

Am 06.01.10 19:18, schrieb Thomas Kowatsch:
> Hi Tom.
> Do I miss something? I cannot find this method in the EMFObservable class.
> --Thomas
>
> Tom Schindl schrieb:
>> Hi,
>>
>> I added a factory method to my current working branch of EMF-Databinding
>> [1] (where I mainly implement the IProperty-Interfaces of 3.5).
>>
>> You can fetch the sources from my public git repo [2] which also
>> provides a nice RCP Example Application showing many (if not all aspects
>> of Eclipse-Databinding with EMF).
>>
>> If you are interested in EMF-Technologies (Ecore, Teneo, CDO) and RCP
>> I'll present all those concepts at EclipseCon 2009 [3].
>>
>> Tom
>>
>> [1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=262160
>> [2] http://github.com/tomsontom/emf-databinding-example/tree/mas ter
>> [3]Mixing Eclipse Technologies to create Enterprise Ready
>> Database-RCP-Frontends - http://www.eclipsecon.org/2009/sessions?id=446
>>
>>
>> Tom Schindl schrieb:
>>> Should we provide this as part of our EMFObservables-API?
>>>
>>> EMFObservables.observeMapValue(
>>> myBuilding,
>>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY,
>>> "title",
>>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE
>>> )
>>>
>>>
>>> Tom
>>>
>>> Kai Schlamp schrieb:
>>>> Comment below
>>>>
>>>>> This should yield you an EObject you can observe like all the other
>>>>> examples:
>>>>>
>>>>>
>>>>> (EObject)myBuilding.getProps().get(getProps().indexOfKey("height "))
>>>>>
>>>>> Presumably there is a XyzPackage.Literals.STRING_TO_ABC_MAP__VALUE
>>>>> feature for that map entry...
>>>> Yes, this works fine.
>>>>
>>>> Here a little example of how a complete binding looks like:
>>>>
>>>> bindingContext.bindValue(SWTObservables.observeText(textFiel d),
>>>> EMFObservables.observeValue((EObject)
>>>> document.getProperties().get(document.getProperties().indexO fKey( "title")),
>>>>
>>>> DocumentModelPackage.Literals.DOCUMENT_PROPERTY_MAP__VALUE), null,
>>>> null);
>>>>
>>>> Thanks Ed.
>>>
>>
>>
Re: [JFace Databinding] Bind EMap value to Text [message #1115801 is a reply to message #506317] Tue, 24 September 2013 15:40 Go to previous messageGo to next message
Toni Koller is currently offline Toni KollerFriend
Messages: 1
Registered: September 2013
Junior Member
Hello,
i'm struggling with FeatureMaps and databinding. Can please someone show me an example how to do that or give me a hint, where i can find some documentation to this topic?

Thanks.
Re: [JFace Databinding] Bind EMap value to Text [message #1239495 is a reply to message #1115801] Tue, 04 February 2014 10:06 Go to previous message
Marco Descher is currently offline Marco DescherFriend
Messages: 164
Registered: October 2010
Location: Austria
Senior Member
Hy Tom,

got here after our e4-dev discussion on persistentState ... well very unfortunate you removed it, I could really use it to realize the binding to keys in the Map. Is this still an ongoing topic or did you completely cease work on this?

thanks,
marco
Previous Topic:OOM, ResourceSet, unload(), reloads (Xtext), IReferableElementsUnloader..
Next Topic:How to use 2 implementations of the same model ?
Goto Forum:
  


Current Time: Wed Dec 11 01:18:30 GMT 2019

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

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

Back to the top