Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Layout edit policy for external node
Layout edit policy for external node [message #1404717] Tue, 05 August 2014 09:20
Mickael ADAM is currently offline Mickael ADAMFriend
Messages: 31
Registered: February 2014

For my development, I need to add on an EditPart an external node with a custom layout edit policy.
The issue is that this edit policy is not taking into account. In fact the parent EditPart installs layout policies for their children(On method createLayoutEditPolicy()). In the case of the external node, it is no verification if a layout policy exists and set a BorderItemSelectionEditPolicy by default:

case ExternalNameEditPart.VISUAL_ID:
	return new BorderItemSelectionEditPolicy() {

		protected List<?> createSelectionHandles() {
		MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
		return Collections.singletonList(mh);

So I would like to know if there is a reason that it's the parent which manage the layout policy of their children and if it will have side effect if I force to take into account layout policy of children with for example:

EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
     if(result == null) {return new BorderItemSelectionEditPolicy...} else return result

thank you.
Previous Topic:Create Multiple Children in one command
Next Topic:No property sheets after changing NS URI
Goto Forum:

Current Time: Wed Mar 21 03:23:42 GMT 2018

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

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