Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » drag from parent to parent
drag from parent to parent [message #163701] Wed, 12 January 2005 14:53 Go to next message
Eclipse UserFriend
Originally posted by: mmaercker.tripper-bullet.com

Hi,

I have an editor where each element can have subelements that can be dragged
around within their parent (hierarchy of IFigures).

The parents, like the content root grandparent, all have derivates of
XYLayoutEditPolicy installed as policies for the layout role. This works
well as far as moving the children around within the parent is concerned.

I would like to be able to drag the children from one parent to another,
though. When I do this, the layout policy appears to cancel the drag (circle
with diagonal line icon). How can I change this behaviour?

In general, is there a commonly accepted way of dragging hierarchically
organized elements from one parent to another in a GEF editor? Does anyone
have any recommendations or ideas on the best way to do this?


Any help greatly appreciated,

Martin Maercker
Re: drag from parent to parent [message #163752 is a reply to message #163701] Wed, 12 January 2005 21:08 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
When you're dragging from one parent to the other, in essence, you're
removing a child from the old parent (REQ_ORPHAN_CHILDREN) and adding it to
the new parent (REQ_ADD). The container that supports children being
dragged out of it, needs a policy that can provide a command to orphan
children, and the container that supports children being added to it needs a
policy that can provide a command to add children. So, your
XYLayoutEditPolicies would have to override getOrphanChildrenCommand() and
getAddCommand() as needed.

The logic example already does this. Look at
LogicXYLayoutEditPolicy#getAddCommand() and
LogicContainerEditPolicy#getOrphanChildrenCommand().


"Martin Maercker" <mmaercker@tripper-bullet.com> wrote in message
news:cs3dio$510$1@www.eclipse.org...
> Hi,
>
> I have an editor where each element can have subelements that can be
dragged
> around within their parent (hierarchy of IFigures).
>
> The parents, like the content root grandparent, all have derivates of
> XYLayoutEditPolicy installed as policies for the layout role. This works
> well as far as moving the children around within the parent is concerned.
>
> I would like to be able to drag the children from one parent to another,
> though. When I do this, the layout policy appears to cancel the drag
(circle
> with diagonal line icon). How can I change this behaviour?
>
> In general, is there a commonly accepted way of dragging hierarchically
> organized elements from one parent to another in a GEF editor? Does anyone
> have any recommendations or ideas on the best way to do this?
>
>
> Any help greatly appreciated,
>
> Martin Maercker
>
>
Re: drag from parent to parent [message #163759 is a reply to message #163752] Wed, 12 January 2005 21:15 Go to previous message
Eclipse UserFriend
Originally posted by: mmaercker.tripper-bullet.com

OK, I'll give the logic example's edit policies another look.

Thanks a lot!

Martin

"Pratik Shah" <ppshah@us.ibm.com> schrieb im Newsbeitrag
news:cs43ke$sub$1@www.eclipse.org...
> When you're dragging from one parent to the other, in essence, you're
> removing a child from the old parent (REQ_ORPHAN_CHILDREN) and adding it
to
> the new parent (REQ_ADD). The container that supports children being
> dragged out of it, needs a policy that can provide a command to orphan
> children, and the container that supports children being added to it needs
a
> policy that can provide a command to add children. So, your
> XYLayoutEditPolicies would have to override getOrphanChildrenCommand() and
> getAddCommand() as needed.
>
> The logic example already does this. Look at
> LogicXYLayoutEditPolicy#getAddCommand() and
> LogicContainerEditPolicy#getOrphanChildrenCommand().
>
>
> "Martin Maercker" <mmaercker@tripper-bullet.com> wrote in message
> news:cs3dio$510$1@www.eclipse.org...
> > Hi,
> >
> > I have an editor where each element can have subelements that can be
> dragged
> > around within their parent (hierarchy of IFigures).
> >
> > The parents, like the content root grandparent, all have derivates of
> > XYLayoutEditPolicy installed as policies for the layout role. This
works
> > well as far as moving the children around within the parent is
concerned.
> >
> > I would like to be able to drag the children from one parent to another,
> > though. When I do this, the layout policy appears to cancel the drag
> (circle
> > with diagonal line icon). How can I change this behaviour?
> >
> > In general, is there a commonly accepted way of dragging hierarchically
> > organized elements from one parent to another in a GEF editor? Does
anyone
> > have any recommendations or ideas on the best way to do this?
> >
> >
> > Any help greatly appreciated,
> >
> > Martin Maercker
> >
> >
>
>
Previous Topic:Trivial question on BufferedGraphicsSource.getGraphics()
Next Topic:DND feedback problem
Goto Forum:
  


Current Time: Thu Apr 25 16:59:42 GMT 2024

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

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

Back to the top