Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » containers editparts - example-tutorial needed
containers editparts - example-tutorial needed [message #218543] Mon, 26 June 2006 15:39 Go to next message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
Hi! Well, I'll try to explain my problem in my poor english, so please be patient ;-)

I'm trying to implement a simple container for my gef editor. I have read the GEF-FAQ
and done what it says. Also I have looked the logic example source code, but when
moving a widget from a container to another an error occurs. Supose the edit part of
the container is called ContainerEditPart. Here is what i'm doing:

1) install CONTAINER and LAYOUT policies in ContainerEditPart.

2) implement getModelChildren() in ContainerEditPart

3) in the CONTAINER edit policy (extends ContainerEditPolicy), getOrphanChildrenCommand()
is responsably for returning a command that remove the element of the old parent

4) in the LAYOUT editPolicy (extends XYLayoutEditPolicy), getAddCommand() is responsably
for returning a command that adds the element to the new parent

5) these both returned commands modify the model correctly and fire propertyChange events
to corresponding editparts.

6) In editpart's propertyChange() method I do refreshChildren(). it's sufficient with
this or I have to do something else here?

The error manifestation: I think refreshChildren() creates new editparts but isn't
erasing the edit parts corresponding to the elements in the old parent. Still more:
When I try to visually manipulate the added element with the mouse, but it seems that
it is accessing to the old edit part and not the new one.

Well, I don't hope you understand me... but I do hope you correct the steps bellow
for implementing the container. Also It would be very nice if you point me to a very
simple example that implements containers (not logic-example, please) or a tutorial.

Thanks very much!

Sebastian Gurin
Re: containers editparts - example-tutorial needed [message #218708 is a reply to message #218543] Wed, 28 June 2006 08:46 Go to previous message
Sebastián Gurin is currently offline Sebastián GurinFriend
Messages: 43
Registered: July 2009
Member
Please ignore this message. I had an stupid error (bad reimplementation of EditPart.deactivate()).
Like always, gef was doing the right thing. My apologies.

On Mon, 26 Jun 2006 17:39:14 +0200
Sebastian Gurin <sgurin@montevideo.com.uy> wrote:

> Hi! Well, I'll try to explain my problem in my poor english, so please be patient ;-)
>
> I'm trying to implement a simple container for my gef editor. I have read the GEF-FAQ
> and done what it says. Also I have looked the logic example source code, but when
> moving a widget from a container to another an error occurs. Supose the edit part of
> the container is called ContainerEditPart. Here is what i'm doing:
>
> 1) install CONTAINER and LAYOUT policies in ContainerEditPart.
>
> 2) implement getModelChildren() in ContainerEditPart
>
> 3) in the CONTAINER edit policy (extends ContainerEditPolicy), getOrphanChildrenCommand()
> is responsably for returning a command that remove the element of the old parent
>
> 4) in the LAYOUT editPolicy (extends XYLayoutEditPolicy), getAddCommand() is responsably
> for returning a command that adds the element to the new parent
>
> 5) these both returned commands modify the model correctly and fire propertyChange events
> to corresponding editparts.
>
> 6) In editpart's propertyChange() method I do refreshChildren(). it's sufficient with
> this or I have to do something else here?
>
> The error manifestation: I think refreshChildren() creates new editparts but isn't
> erasing the edit parts corresponding to the elements in the old parent. Still more:
> When I try to visually manipulate the added element with the mouse, but it seems that
> it is accessing to the old edit part and not the new one.
>
> Well, I don't hope you understand me... but I do hope you correct the steps bellow
> for implementing the container. Also It would be very nice if you point me to a very
> simple example that implements containers (not logic-example, please) or a tutorial.
>
> Thanks very much!
>
> Sebastian Gurin
>
Previous Topic:"One model - many edit parts" problem!
Next Topic:wrong direction of scrollbars
Goto Forum:
  


Current Time: Sat Apr 27 03:39:47 GMT 2024

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

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

Back to the top