示例#1
0
  public synchronized boolean addEdit(UndoableEdit edit) {
    if (DEBUG) System.out.println("ChangeManager.addEdit( " + edit + ")");
    boolean result = false;
    validated = false;

    if (compoundEdit == null) {
      if (DEBUG) System.out.println("super.addEdit( " + edit + ")");

      if (edit instanceof UndoableDesignerEdit
          && !(editToBeUndone() instanceof UndoableDesignerEdit)) {
        super.discardAllEdits();
      } else if (!(edit instanceof UndoableDesignerEdit)
          && editToBeUndone() instanceof UndoableDesignerEdit) {
        super.discardAllEdits();
      }

      if (edit instanceof UndoablePluginEditAbstact
          && !(editToBeUndone() instanceof UndoablePluginEditAbstact)) {
        super.discardAllEdits();
      } else if (!(edit instanceof UndoablePluginEditAbstact)
          && editToBeUndone() instanceof UndoablePluginEditAbstact) {
        super.discardAllEdits();
      }

      result = super.addEdit(edit);

      fireStateChanged(new ChangeEvent(this));
    } else {
      result = compoundEdit.addEdit(edit);
    }

    return result;
  }
示例#2
0
  public void endCompound() {
    if (DEBUG) System.out.println("ChangeManager.endCompound()");

    compoundEdit.end();

    if ((editToBeUndone() instanceof UndoableDesignerEdit) && compoundEdit.isSignificant()) {
      super.discardAllEdits();
    } else if ((editToBeUndone() instanceof UndoablePluginEditAbstact)
        && compoundEdit.isSignificant()) {
      super.discardAllEdits();
    }

    super.addEdit(compoundEdit);

    compoundEdit = null;

    fireStateChanged(new ChangeEvent(this));
  }
示例#3
0
  public void discardAllEdits() {
    if (DEBUG) System.out.println("ChangeManager.discardAllEdits()");
    super.discardAllEdits();

    syncMark = null;
    saveMark = null;
    parseMark = null;
    validateMark = null;
    validated = false;

    compoundEdit = null;

    fireStateChanged(new ChangeEvent(this));
  }
 public void discardAllEdits() {
   undo.discardAllEdits();
 }
 @Override
 public synchronized void discardAllEdits() {
   super.discardAllEdits();
   updateDirty();
 }