Examples of Undoable


Examples of com.jcloisterzone.event.Undoable

    }

    public void restore(SavePoint sp) {
        game.flushEventQueue();
        game.getEventBus().unregister(operationRecorder);
        Undoable target = sp.getOperation();
        //assert target == null || operations.contains(target);
        while (operations.peekLast() != target) {
            operations.pollLast().undo(game);
        }
        int i = 0;
View Full Code Here

Examples of net.sf.rej.gui.Undoable

        this.actions.add(action);
    }

    public void execute() {
        for (int i = 0; i < this.actions.size(); i++) {
            Undoable action = this.actions.get(i);
            action.execute();
        }
    }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

        }
    }

    public void undo() {
        for (int i = this.actions.size() - 1; i >= 0; i--) {
            Undoable action = this.actions.get(i);
            action.undo();
        }
    }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

  @Override
  public void processAttribute(IterationContext ic, Attribute attr) {
    if (attr instanceof LineNumberTableAttribute) {
      LineNumberTableAttribute lnAttr = (LineNumberTableAttribute) attr;
      Attributes attrs = ic.getCodeAttribute().getAttributes();
      Undoable u = new RemoveAttributeAction(attrs, lnAttr);
      if (batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());
      }
    }
  }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

  @Override
  public void processAttribute(IterationContext ic, Attribute attr) {
    if (attr instanceof LocalVariableTableAttribute) {
      LocalVariableTableAttribute lvAttr = (LocalVariableTableAttribute) attr;
      Attributes attrs = ic.getCodeAttribute().getAttributes();
      Undoable u = new RemoveAttributeAction(attrs, lvAttr);
      if (this.batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());
      }
    }
  }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

      List<Transferrable> transferrables = (List) data;
      for (Transferrable transferrable : transferrables) {
        if (transferrable instanceof TransferrableField) {
          TransferrableField field = (TransferrableField) transferrable;

          Undoable insertFieldAction = new InsertFieldAction(
              this.classDef.getClassFile(), field.getFieldName(),
              field.getDescriptor(), new AccessFlags(field
                  .getAccessFlags()));
          ga.add(insertFieldAction);
        } else if (transferrable instanceof TransferrableMethod) {
View Full Code Here

Examples of net.sf.rej.gui.Undoable

    // field should be refactored?   
    String className = ic.getCf().getFullClassName();
    String newFieldName = this.advisor.newFieldNameFor(className, field.getName(), field.getDescriptor());
    if (newFieldName != null) {
      Undoable u = new RenameFieldAction(ic.getCf().getPool(), field, newFieldName);
      if (this.batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());         
      }
    }
  }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

    // method should be refactored?
    String className = ic.getCf().getFullClassName();
    String newMethodName = this.advisor.newMethodNameFor(className, method.getName(), method.getDescriptor());
    if (newMethodName != null) {
      Undoable u = new RenameMethodAction(ic.getCf().getPool(), method, newMethodName);
      if (this.batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());         
      }
    }
  }
View Full Code Here

Examples of net.sf.rej.gui.Undoable

  public void postProcessFile(IterationContext ic) {
    ClassFile cf = ic.getCf();
    String oldClassName = this.oldClassNames.get(ic.getCf().getFullClassName());
    if (oldClassName != null) {
      String newFileName = getNewFileName(ic.getFilename(), oldClassName, cf.getFullClassName());
      Undoable u = new RenameFileAction(ic.getProject(), ic.getFilename(), newFileName, ic.getCf());
      if (this.batchMode) {
        FileSet fs = ic.getProject().getFileSet();
        fs.removeFile(ic.getFilename());
        fs.addFile(newFileName);
      } else {
View Full Code Here

Examples of net.sf.rej.gui.Undoable

      }
    }
   
    if (match) {
      desc.setParamList(newParams);
      Undoable u = new ModifyDescriptor(ic.getCf().getPool(), desc, descEnabled);
      if (this.batchMode) {
        u.execute();
      } else {
        SystemFacade.getInstance().performAction(u, ic.getFilename());
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.