refresh child [message #161325] |
Mon, 13 December 2004 09:07  |
Eclipse User |
|
|
|
Originally posted by: paolo.banfi.fastwebnet.it
I've a container classthet represent an uml class
attributes are repreented as a list
I've the problem that when I add an attribute via GEF command the
graphical parts are not refreshed.
how can I solve this problem?
tanks
cK
|
|
|
|
|
|
|
Re: refresh child [message #161793 is a reply to message #161622] |
Thu, 16 December 2004 13:53   |
Eclipse User |
|
|
|
Originally posted by: paolo.banfi.fastwebnet.it
ok, if I refresh the edit part everything works correctly
But now I'm curious: what is causes of this behavior?
Why in your example the lists returned by getModelChildren() are
different from the lists returned by getChildren().getModel()
(debugging the code of your example i've noticed that this is the
difference)?
Sorry if I'm boring you with my question and thank you for your help
cK
On Wed, 15 Dec 2004 16:42:02 -0500, "Pratik Shah" <ppshah@us.ibm.com>
wrote:
>Here's probably what's happening. When the attribute is added, the class
>edit part is refreshed. But it still returns the same two lists (of
>attributes and operations) and hence nothing gets refreshed. What you want
>to do is refresh the child edit part (i.e., the ListEditPart). Look at
>ClassEditPart#handlePropertyChanged().
>
>"cerealk" <paolo.banfi@fastwebnet.it> wrote in message
>news:b8g0s0lo4bcdv8iidcsklklapodhd5d4iq@4ax.com...
>> I'll try to explain my problem in a better way
>>
>> I've a class that represent an UML classifier
>> it contains UML fields and UML methods in two separated EMF ELists
>>
>> to display each class, fields and methods in GEF I've created tree
>> edit part:
>>
>> ClassifierEditPart
>> ListEditPart
>> LabelEditPart
>>
>> the I use the ListEditPart to represent the fields and the methods of
>> a class in different "box" of the image
>>
>> the method ClassifierEditPart.getModelChildren() returns a list
>> containing two elements: the EList of fields and the EList of methods
>>
>> the method ListEditPart returns the list of fields/methods
>>
>> I tried to recreate the same structure thet is found in
>> org.eclipse.gef.examples.edigram
>>
>> My ListEditPart is the same as the one found in the example
>>
>> The problem is that when I add a field or a method (by using the
>> palette for example) the model is modified but not refreshed.
>>
>> thanks
>>
>> cK
>>
>>
>> On Mon, 13 Dec 2004 10:56:17 -0500, "Pratik Shah" <ppshah@us.ibm.com>
>> wrote:
>>
>> >Does your getModelChildren() method return an updated list which includes
>> >the newly added attribute?
>> >
>> >"cerealk" <paolo.banfi@fastwebnet.it> wrote in message
>> >news:1t8rr0leqpb4f98p710vnn3lo0t7k8urd9@4ax.com...
>> >> Ok
>> >> debugging the code i see that the
>> >>
>> >> refreshChildren()
>> >>
>> >> is called but that the interested parts are not correctly refreshed
>> >>
>> >> any idea?
>> >>
>> >> cK
>> >>
>> >>
>> >>
>> >> On Mon, 13 Dec 2004 15:07:10 +0100, cerealk
>> >> <paolo.banfi@fastwebnet.it> wrote:
>> >>
>> >> >I've a container classthet represent an uml class
>> >> >attributes are repreented as a list
>> >> >
>> >> >I've the problem that when I add an attribute via GEF command the
>> >> >graphical parts are not refreshed.
>> >> >
>> >> >how can I solve this problem?
>> >> >
>> >> >tanks
>> >> >
>> >> >cK
>> >>
>> >
>>
>
|
|
|
Re: refresh child [message #161808 is a reply to message #161793] |
Thu, 16 December 2004 15:42  |
Eclipse User |
|
|
|
In the EDiagram example, the two lists (of attributes and operations) are
the model for the two CompartmentEditParts (equivalent to your
ListEditPart). The point to realize here is that the although the
attribute/operation has changed, the list containing it has not changed. If
you call refreshChildren() on the ClassEditPart, it will check to see if
EditParts exist for all the model children (which are the two lists). Since
they do, it won't make any change. Ideally, you'd want the notification of
the change in attributes/operation to go directly to the ListEditPart.
"cerealk" <paolo.banfi@fastwebnet.it> wrote in message
news:kgl3s0hklap0mbeqt3j3j98u81lgetvrh2@4ax.com...
> ok, if I refresh the edit part everything works correctly
> But now I'm curious: what is causes of this behavior?
> Why in your example the lists returned by getModelChildren() are
> different from the lists returned by getChildren().getModel()
> (debugging the code of your example i've noticed that this is the
> difference)?
>
> Sorry if I'm boring you with my question and thank you for your help
>
> cK
>
> On Wed, 15 Dec 2004 16:42:02 -0500, "Pratik Shah" <ppshah@us.ibm.com>
> wrote:
>
> >Here's probably what's happening. When the attribute is added, the class
> >edit part is refreshed. But it still returns the same two lists (of
> >attributes and operations) and hence nothing gets refreshed. What you
want
> >to do is refresh the child edit part (i.e., the ListEditPart). Look at
> >ClassEditPart#handlePropertyChanged().
> >
> >"cerealk" <paolo.banfi@fastwebnet.it> wrote in message
> >news:b8g0s0lo4bcdv8iidcsklklapodhd5d4iq@4ax.com...
> >> I'll try to explain my problem in a better way
> >>
> >> I've a class that represent an UML classifier
> >> it contains UML fields and UML methods in two separated EMF ELists
> >>
> >> to display each class, fields and methods in GEF I've created tree
> >> edit part:
> >>
> >> ClassifierEditPart
> >> ListEditPart
> >> LabelEditPart
> >>
> >> the I use the ListEditPart to represent the fields and the methods of
> >> a class in different "box" of the image
> >>
> >> the method ClassifierEditPart.getModelChildren() returns a list
> >> containing two elements: the EList of fields and the EList of methods
> >>
> >> the method ListEditPart returns the list of fields/methods
> >>
> >> I tried to recreate the same structure thet is found in
> >> org.eclipse.gef.examples.edigram
> >>
> >> My ListEditPart is the same as the one found in the example
> >>
> >> The problem is that when I add a field or a method (by using the
> >> palette for example) the model is modified but not refreshed.
> >>
> >> thanks
> >>
> >> cK
> >>
> >>
> >> On Mon, 13 Dec 2004 10:56:17 -0500, "Pratik Shah" <ppshah@us.ibm.com>
> >> wrote:
> >>
> >> >Does your getModelChildren() method return an updated list which
includes
> >> >the newly added attribute?
> >> >
> >> >"cerealk" <paolo.banfi@fastwebnet.it> wrote in message
> >> >news:1t8rr0leqpb4f98p710vnn3lo0t7k8urd9@4ax.com...
> >> >> Ok
> >> >> debugging the code i see that the
> >> >>
> >> >> refreshChildren()
> >> >>
> >> >> is called but that the interested parts are not correctly refreshed
> >> >>
> >> >> any idea?
> >> >>
> >> >> cK
> >> >>
> >> >>
> >> >>
> >> >> On Mon, 13 Dec 2004 15:07:10 +0100, cerealk
> >> >> <paolo.banfi@fastwebnet.it> wrote:
> >> >>
> >> >> >I've a container classthet represent an uml class
> >> >> >attributes are repreented as a list
> >> >> >
> >> >> >I've the problem that when I add an attribute via GEF command the
> >> >> >graphical parts are not refreshed.
> >> >> >
> >> >> >how can I solve this problem?
> >> >> >
> >> >> >tanks
> >> >> >
> >> >> >cK
> >> >>
> >> >
> >>
> >
>
|
|
|
Powered by
FUDForum. Page generated in 0.04507 seconds