Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Advice for reordering tree items using AbstractTreeEditPart & policies??
Advice for reordering tree items using AbstractTreeEditPart & policies?? [message #45056] Fri, 22 November 2002 23:58 Go to next message
Erik Johnson is currently offline Erik JohnsonFriend
Messages: 36
Registered: July 2009
Member
I have a GEF editor that uses a TreeViewer (actually a
GraphicalTreeViewer -- I extended TreeViewer and implemented the
GraphicalViewer interface) & AbstractTreeEditParts. The only functionality
that is currently lacking is the ability to reorder/move tree items around
(by dragging). ie. I have tree:
root
A
B
C

I'd like the ability to drag C to be before A:
root
C
A
B

I've installed edit policies for the COMPONENT_ROLE and TREE_CONTAINER_ROLE
(container_role doesn't seem necessary since I have the
tree_container_role).

It seems that AbstractTreeContainerEditPolicy never calls
getMoveChildrenCommand (I'm not sure if this is a bug or not--everywhere
else in the class it is testing against REQ_MOVE, however in getCommand it
tests if the request is REQ_MOVE_CHILDREN). I tried overriding getCommand
to explictly call getMoveChildrenCommand; but then the attributes of the
command don't seem to provide the information I need to actually perform the
move.

Can anyone point me in the right direction for what I need to use?

I'm using GEF build 200211191621 on Eclipse 2.0.1 build 200208291828

Thanks in advance!
Erik
Re: Advice for reordering tree items using AbstractTreeEditPart & policies?? [message #45068 is a reply to message #45056] Sat, 23 November 2002 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

Did you try this in the Logic example? It works there.

"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:arme2l$6pr$1@rogue.oti.com...
> I have a GEF editor that uses a TreeViewer (actually a
> GraphicalTreeViewer -- I extended TreeViewer and implemented the
> GraphicalViewer interface) & AbstractTreeEditParts. The only
functionality
> that is currently lacking is the ability to reorder/move tree items around
> (by dragging). ie. I have tree:
> root
> A
> B
> C
>
> I'd like the ability to drag C to be before A:
> root
> C
> A
> B
>
> I've installed edit policies for the COMPONENT_ROLE and
TREE_CONTAINER_ROLE
> (container_role doesn't seem necessary since I have the
> tree_container_role).
>
> It seems that AbstractTreeContainerEditPolicy never calls
> getMoveChildrenCommand (I'm not sure if this is a bug or not--everywhere
> else in the class it is testing against REQ_MOVE, however in getCommand it
> tests if the request is REQ_MOVE_CHILDREN). I tried overriding getCommand
> to explictly call getMoveChildrenCommand; but then the attributes of the
> command don't seem to provide the information I need to actually perform
the
> move.
>
> Can anyone point me in the right direction for what I need to use?
>
> I'm using GEF build 200211191621 on Eclipse 2.0.1 build 200208291828
>
> Thanks in advance!
> Erik
>
>
Re: Advice for reordering tree items using AbstractTreeEditPart & policies?? [message #1833896 is a reply to message #45068] Tue, 27 October 2020 08:16 Go to previous message
Dinko Ivanov is currently offline Dinko IvanovFriend
Messages: 27
Registered: July 2009
Junior Member
Had the same problem, the Logic Example in GEF did great job. Thank you unknown Eclipse user!
Previous Topic:Add LayoutAlgorithm in MinMap example
Next Topic:How to package my RCP app to work with GEF 5 and honor licensing terms
Goto Forum:
  


Current Time: Sat Oct 05 10:42:42 GMT 2024

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

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

Back to the top