|
Re: Model child, child editpart and child figure best practice [message #191654 is a reply to message #191002] |
Wed, 10 August 2005 18:10 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
"Steve Jones" <steve@istech.demon.co.uk> wrote in message
news:dd798j$mj$1@news.eclipse.org...
> Hi,
>
> In my application I have model elements with associated editparts and
> figures. These edit parts implement NodeEditPart and can be moved
connected
> etc in the normal way without any problem.
>
> The model elements have children. I would like to represent these visually
> as child figures (labels and icons and text fields typically) that are
> children of the parent node figure. In order to get the desired visual
> effect the layout of these child figures I will need to use nested
> containers and several types of layout manager. A typical SWT layout
> exercise.
>
> My concern is that this nesting breaks the one-to-one MVC pattern the is
at
> the core of GEF. In many cases my child figures will have parent
containers
> that are not the node figure.
There is no one-to-one restriction, and it can often make sense to not do
that. An EditPart can correspond to a complex combination of figures, and
not just a singe figure. The children figures are always added to the
figure that is returned by your EditPart's getContentPane() method.
>
> I can see two possible approaches. I could overload the node edit parts
> addChildVisual() method and drill down through the containers to find the
> correct figure in which to add the child or I could introduce "dummy"
model
> elements and edit parts that represent the containers I need to use in the
> layout of the real children.
>
> I'm not sure of the possible side effects of the first approach and the
> second seems to be very messy.
>
> Any ideas on how best to approach this would be very mush appreciated.
>
> Thanks Steve.
>
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03306 seconds