Example #1
0
 @Override
 public void execute() {
   fOldPos =
       fOldParent
           .getElements()
           .indexOf(fElement); // do this here as its part of a compound command
   redo();
 }
Example #2
0
 @Override
 public void redo() {
   fOldParent.getElements().remove(fElement);
   fNewParent.getElements().add(fElement);
 }
Example #3
0
 @Override
 public void undo() {
   fNewParent.getElements().remove(fElement);
   fOldParent.getElements().add(fOldPos, fElement);
 }