Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Moving children figures
Moving children figures [message #225938] Fri, 03 November 2006 19:04 Go to next message
Eclipse UserFriend
Originally posted by: jan.rachwalik.gmail.com

Hi

I have parent figures and some children figures inside. I would like to
move a children figure to another parent. How to set where the child
figure can be moved and where it can't?

Thanks
Re: Moving children figures [message #225995 is a reply to message #225938] Fri, 03 November 2006 21:23 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi Jariq,

Your parent edit parts should have ContainerEditPolicy (or any of its
subclasses) installed on them to be able to add any edit parts as children
(when you drag children edit parts and drop them inside the parent). If
this is the case, one way of allowing/disallowing addition of various edit
parts to the parent would be overriding the getAddCommand(GroupRequest
request) method from ContainerEditPolicy. The request has a list of edit
parts to be dropped inside the parent edit part, hence you could iterate
through them and test each edit part for permission to be added to the
parent edit part. If some of the edit parts are not allowed to be added to
the parent then return a null or unexecutable command, otherwise create
the command to add the children to the parent.

Cheers,
Alex
Re: Moving children figures [message #226091 is a reply to message #225938] Sun, 05 November 2006 19:18 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi Jariq,

Another way to check this would be through the add command that you
probably have. The add command (at least in the logic example) adds a
child to the parent model element. In the canExecute() method of your add
command you could add a check in one model element can be added as a child
to another one.

Cheers,
Alex
Previous Topic:FixedConnectionAnchor not having editpart problem
Next Topic:Placing child figure at fixed relative position
Goto Forum:
  


Current Time: Tue Apr 16 15:24:24 GMT 2024

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

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

Back to the top