@Override public void undo() throws CannotUndoException { throw new CannotUndoException(); }
@Override public void undo() throws CannotUndoException { if (inProgress) { UndoableEdit edit = editToBeUndone(); if (edit == null) { throw new CannotUndoException(); } undoTo(edit); } else { if (!canUndo()) { throw new CannotUndoException(); } int i = edits.size() - 1; try { for (; i >= 0; i--) { edits.get(i).undo(); // may throw CannotUndoException } hasBeenDone = false; } finally { if (i != -1) { // i-th edit's undo failed => redo the ones above int size = edits.size(); while (++i < size) { edits.get(i).redo(); } } } } cs.fireChange(); }
public class UndoCommand { public void undo() { throw new CannotUndoException(); } }
public void undo () throws CannotUndoException { throw new CannotUndoException (); } public void redo () throws CannotRedoException {
public void undo () throws CannotUndoException { throw new CannotUndoException (); } public void redo () throws CannotRedoException {
@Override public void undo() throws CannotUndoException { if (!canUndo()) { throw new CannotUndoException(); } statusBits &= ~HAS_BEEN_DONE; // hasBeenDone = false; }
@Override public void undo () throws CannotUndoException { final boolean[] error = new boolean[1]; writeAccess (new Runnable () { public void run () { useUndoManager = false; try { TransactionEdit.super.undo (); } catch (CannotUndoException e) { error[0] = true; ErrorManager.getDefault ().notify (ErrorManager.ERROR, e); } } }); if (error[0]) throw new CannotUndoException (); }
@Override public void undo() throws CannotUndoException { try { tableUndoableEdit.undo(); } catch (SQLException ex) { LOGGER.error(ex.getLocalizedMessage(), ex); throw new CannotUndoException(); } }
public void undo() throws javax.swing.undo.CannotUndoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotUndoException (); // NOI18N new RenderUndo (1, myDoc); }
public void undoOrRedo () throws javax.swing.undo.CannotUndoException, javax.swing.undo.CannotRedoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotUndoException (); // NOI18N new RenderUndo (11, myDoc); }
@Override public void undo() throws CannotUndoException { super.undo(); if (!swapImages()) { throw new CannotUndoException(); } }
public void undo() throws javax.swing.undo.CannotUndoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotUndoException (); // NOI18N new RenderUndo (1, myDoc); }
public void undoOrRedo () throws javax.swing.undo.CannotUndoException, javax.swing.undo.CannotRedoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotUndoException (); // NOI18N new RenderUndo (11, myDoc); }
@Override public void undo() throws CannotUndoException { if (!canUndo()) { throw new CannotUndoException(); } int i = edits.size() - 1; try { for (; i >= 0; i--) { edits.get(i).undo(); } clearStatusBits(HAS_BEEN_DONE); } finally { if (i != -1) { // i-th edit's undo failed => redo the ones above int size = edits.size(); while (++i < size) { edits.get(i).redo(); } } } }
@Override public void undo() throws javax.swing.undo.CannotUndoException { final StyledDocument doc = support.getDocument(); if (doc == null) { throw new javax.swing.undo.CannotUndoException(); // NOI18N } new DocLockedRun(1, doc); checkCallNotifyUnmodified(); }
public void undo() throws CannotUndoException { super.undo(); try { if (remove) { insertEdit(this); } else { // insertion removeEdit(this); } } catch (BadLocationException bl) { throw new CannotUndoException(); } }
@Override public void undo() { if (!canUndo()) { throw new CannotUndoException(); } figure.willChange(); super.undo(); figure.changed(); } @Override
/** * UndoableEdit implementation Override should begin with a call to super. */ public void undo() throws CannotUndoException { super.undo(); try { m_property_descriptor.setPropertyValue(m_bean, m_oldvalue); if (m_gc != null) { m_gc.fireGridCellEvent(new GridCellEvent(GridCellEvent.CELL_CHANGED, m_gc)); } } catch (Exception e) { throw new CannotUndoException(); } }
/** * Undoes the current edit. * * @param shouldUndo * flag that indicates if the undo on the edit should be invoked. * If false, this operation only changes the indexOfNextAdd * pointer. */ public synchronized void undo(boolean shouldUndo) throws CannotUndoException { if (isInProgress()) { UndoableEdit edit = editToBeUndone(); if (edit == null) { throw new CannotUndoException(); } undoTo(edit, shouldUndo); } else { super.undo(); } }
/** * If this UndoManager is inProgress, undo the last significant * UndoableEdit wrt to source, and all insignificant edits back to * it. Updates indexOfNextAdd accordingly. * * <p>If not inProgress, indexOfNextAdd is ignored and super's routine is * called.</p> * * @see UndoManager#undo */ public void undo(Object source) { if (source == null || !isInProgress()) super.undo(); else { UndoableEdit edit = editToBeUndone(source); //System.out.println("undoTo edit="+edit); if (edit == null) throw new CannotUndoException(); undoTo(edit); } }