2012-09-19 38 views
0

我正在使用gwt-links和gwt-dnd框架來製作節點圖。我的問題是,我想拖動多個對象。有人有此任務的經驗嗎?gwt-dnd multidragging

任何想法或指向正確的方向幫助。

盧卡斯

回答

0

我還沒有實際使用GWT的鏈接庫,但入門部分給我的總體思路進行了展望。它使用GWT-DND左右移動的物品,所以你需要做的唯一的事情是:

PickupDragController dragController = new PickupDragController(controller.getView(), true); 

// Allow multiple widgets to be selected at once using CTRL-click 
dragController.setBehaviorMultipleSelection(true); 

dragController.makeDraggable(labelHello); 
dragController.makeDraggable(labelWorld); 
// Register the dragController in gwt-links 
controller.registerDragController(dragController); 

也就是說,使用如預期的入門維基GWT鏈接http://code.google.com/p/gwt-links/wiki/GettingStarted

和添加setBehaviourMultipleSelection(true);在你的dragController初始化中。

+0

感謝Thanos,太簡單了。它幫助我很多。 – Gondri

+0

隨時配偶。如果答案是正確的,那麼請接受它是正確的 –