Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag & drop in parent - child relation
Drag & drop in parent - child relation [message #1760572] Fri, 28 April 2017 13:36 Go to next message
Thomas Oberle is currently offline Thomas OberleFriend
Messages: 11
Registered: April 2017
Junior Member
Hi everybody,

I am trying to implement drag & drop functionality to my GEF4 application.

I have parent nodes (SWComponent) and child nodes (SWFunction). SWFunctions can be added to SWComponents.

Drag & drop works fine if I implement it for SWComponentPart or SWFunctionPart only. Therefore I use:

adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(FXTransformPolicy.class);
adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(FXTranslateSelectedOnDragPolicy.class);

But If I implement it for both SWComponent and SWFunction I get a lot of errors if I try to drag a SWFunction within a SWComponent.
(Draging a SWFunction or SWComponent within RootPart still works)

The first Error occures in AbstractTransactionPolicy -> checkUninitialized() and says "Already initialized"
I suppose this happens because I bind FXTransformPolicy to both SWComponentPart and SWFunctionPart?
Is this not allowed?
What do I have to do to enable drag and drop for SWFunctions within SWComponents while SWComponents can still be dragged.

Thanks,
Thomas

Re: Drag & drop in parent - child relation [message #1760595 is a reply to message #1760572] Fri, 28 April 2017 17:49 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
You will need to replace the default ITargetPolicyResoler (GEF4) resp. IHandlerResolver (GEF 5.0) with a custom implementation that prevents that both parts are drag targets.

Your resolver will probably have to only resolve the function part as target when its located inside a component part (and exclude the component part).
Re: Drag & drop in parent - child relation [message #1760791 is a reply to message #1760595] Wed, 03 May 2017 06:01 Go to previous messageGo to next message
Thomas Oberle is currently offline Thomas OberleFriend
Messages: 11
Registered: April 2017
Junior Member
Thanks, that did the trick Smile
Re: Drag & drop in parent - child relation [message #1760792 is a reply to message #1760595] Wed, 03 May 2017 06:02 Go to previous messageGo to next message
Thomas Oberle is currently offline Thomas OberleFriend
Messages: 11
Registered: April 2017
Junior Member
Thanks, that did the trick Smile
Re: Drag & drop in parent - child relation [message #1760793 is a reply to message #1760595] Wed, 03 May 2017 06:02 Go to previous message
Thomas Oberle is currently offline Thomas OberleFriend
Messages: 11
Registered: April 2017
Junior Member
Thanks, that did the trick Smile
Previous Topic:Showing a Graph Zest inside of a Group widget
Next Topic:[GEF5] Click policies chain
Goto Forum:
  


Current Time: Thu Apr 18 23:14:42 GMT 2024

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

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

Back to the top