Using JFace data binding with an EMF List which maby be null [message #1429804] |
Tue, 23 September 2014 19:41  |
Eclipse User |
|
|
|
Hi,
I am using JFace data binding to bind an EMF list to another observable list. The problem I'm having (I think) is that the list is null before any items are added. Is there an easy way to do the databinding so that it creates the list when the first element is being added to it? Is there a way to null out the list when the last item is removed?
Thanks in advance for any help.
|
|
|
Re: Using JFace data binding with an EMF List which maby be null [message #1429855 is a reply to message #1429804] |
Tue, 23 September 2014 20:56   |
Eclipse User |
|
|
|
El 23/09/2014 21:41, Justin Weir escribió:
> Hi,
>
> I am using JFace data binding to bind an EMF list to another observable
> list. The problem I'm having (I think) is that the list is null before
> any items are added.
EMF generated code will make sure the list is not null when you access it.
> Is there an easy way to do the databinding so that
> it creates the list when the first element is being added to it? Is
> there a way to null out the list when the last item is removed?
Do you want to decrease footprint or get your databinding working? :)
Felix
|
|
|
Re: Using JFace data binding with an EMF List which maby be null [message #1430125 is a reply to message #1429804] |
Wed, 24 September 2014 04:06  |
Eclipse User |
|
|
|
Justin,
Comments below.
On 23/09/2014 9:41 PM, Justin Weir wrote:
> Hi,
>
> I am using JFace data binding to bind an EMF list to another
> observable list. The problem I'm having (I think) is that the list is
> null before any items are added.
I doubt that's a problem. The getter for a multi-valued feature always
returns a list. Internally, the field will be null until the first time
the getter is called, but no one can see that via the API...
> Is there an easy way to do the databinding so that it creates the list
> when the first element is being added to it?
How is the list accessed that anyone would ever see null?
> Is there a way to null out the list when the last item is removed?
No, because you can't ever know who else has asked for the list and is
still referencing it. The list itself is the state of the model instance.
>
> Thanks in advance for any help.
|
|
|
Powered by
FUDForum. Page generated in 0.03027 seconds