| Move parent when child is draged [message #989109] |
Tue, 04 December 2012 11:21  |
ModelGeek Mising name Messages: 351 Registered: June 2011 |
Senior Member |
|
|
I would like to move parent editpart when child edit part is dragged.
Parent's parent editpart layout is XY and user can move it. Parent editpart layout is flowlayout.
A : parent....xylayout
B: A'child...flowlayout
c: B'child....flowlayout
User can move B. Now i would like to move B when user drag C and drop it at A then i want to move B at drop location.
Any idea?
Cheers,
|
|
|
|
|
|
|
|
| Re: Move parent when child is draged [message #989502 is a reply to message #989499] |
Thu, 06 December 2012 09:22   |
Jan Krakora Messages: 402 Registered: December 2009 Location: Prague |
Senior Member |
|
|
@Override
public DragTracker getDragTracker(Request request) {
return new DragEditPartsTracker(this) {
@Override
protected List createOperationSet() {
List operationSet = super.createOperationSet();
if (operationSet.remove(getSourceEditPart())) {
operationSet.add(getSourceEditPart().getParent());
}
return operationSet;
}
};
}
Try this, but it could have some hidden pitfalls. And knowing the GEF, it definitelly has some.
[Updated on: Thu, 06 December 2012 09:23] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02837 seconds