예제 #1
0
 @Override
 public void execute() {
   // Ensure fIndex is stored just before execute because if this is part of a composite delete
   // action
   // then the index positions will have changed
   fIndex = fFolder.getElements().indexOf(fElement);
   if (fIndex != -1) { // might be already be deleted from Command in CompoundCommand
     fFolder.getElements().remove(fElement);
   }
 }
예제 #2
0
 @Override
 public void undo() {
   if (fIndex != -1) { // might be already be deleted from Command in CompoundCommand
     fFolder.getElements().add(fIndex, fElement);
   }
 }