conditional creation and DnD across parts [message #175601] |
Tue, 05 April 2005 13:43  |
Eclipse User |
|
|
|
Originally posted by: sidus68.yahoo.com
Hi!
I have a form which contains one or more containers, and each container
contains various components. The container and the various components are
available from the palette viewer for creation. The container may only be
a child of the form, but not of itself or any other component. Nor must it
be possible to create a component outside of a container (a component must
contain the container as a parent somewhere in its EditPart hierarchy).
- two questions:
(i) am I correct in assuming that a LAYOUT_ROLE with XYLayoutEditPolicy
appropriately subclassed such that getCreateCommand() returns null if the
parent of the container is not the form, or (when creating a component)
the parent is the form?
(ii) components can be dragged within or across containers, but not onto
the form - how do I facilitate this?
Many thanks!
|
|
|
Re: conditional creation and DnD across parts [message #175788 is a reply to message #175601] |
Wed, 06 April 2005 14:07   |
Eclipse User |
|
|
|
Originally posted by: sidus68.yahoo.com
well, I have solved the creation problems, but not sure if my approach is
correct. Have used the LAYOUT_ROLE with XYLayoutEditPolicy appropriately
subclassed such that getCreateCommand() returns null if the target parent
is invappropriate. Further, have removed orphan/add support from the form
to prevent components being dragged outside the container (across
containers works fine).
However, how do I prevent something form being a child of itself (a
container withinn a container)?
Many thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02878 seconds