示例#1
0
  public synchronized void redo() {
    if (DEBUG) System.out.println("ChangeManager.redo()");
    super.redo();
    validated = false;

    fireStateChanged(new ChangeEvent(this));
  }
 public void redo() {
   if (undoManager.canRedo()) {
     undoManager.redo();
   }
   statusLine = "Redo";
   notifyObservers();
 }
示例#3
0
 public void redo() {
   try {
     if (undo != null && undo.canRedo()) {
       undo.redo();
       refreshEnabledStatus();
     }
   } catch (CannotRedoException ignore) {
   }
 }
 @Action(enabledProperty = REDO_ENABLED)
 public void redo() {
   try {
     undo.redo();
   } catch (CannotUndoException ex) {
     Logger.getLogger(ApplicationActions.class).error(ex);
     Toolkit.getDefaultToolkit().beep();
   }
   updateUndoActions();
 }
 public void actionPerformed(ActionEvent e) {
   JMenuItem source = (JMenuItem) (e.getSource());
   if (source.getText().equals("元に戻す")) {
     if (undo.canUndo()) {
       undo.undo();
     }
   } else if (source.getText().equals("やり直し")) {
     if (undo.canRedo()) {
       undo.redo();
     }
   }
 }
  /**
   * If this <code>UndoManager</code> is <code>inProgress</code>, redoes the last significant <code>
   * UndoableEdit</code> at <code>indexOfNextAdd</code> or after, and all insignificant edits up to
   * it. Updates <code>indexOfNextAdd</code> accordingly.
   *
   * <p>If not <code>inProgress</code>, <code>indexOfNextAdd</code> is ignored and super's routine
   * is called.
   */
  public synchronized void redo() throws CannotRedoException {
    if (this.isInProgress()) {
      UndoableEdit edit = editToBeRedone();

      if (edit instanceof UndoManager) {
        UndoManager manager = (UndoManager) edit;

        while (manager.canRedo()) {
          manager.redo();
        }

        indexOfNextAdd++;
        return;
      }

      if (edit == null) {
        throw new CannotRedoException();
      }
      redoTo(edit);
    } else {
      super.redo();
    }
  }
示例#7
0
 public void actionPerformed(ActionEvent e) {
   UndoManager mgr = Undo.getLastUndoMgr();
   if (mgr != null && mgr.canRedo()) mgr.redo();
 }
 @Override
 public synchronized void redo() throws CannotRedoException {
   super.redo();
   updateDirty();
 }