public @Override void redo() throws CannotRedoException { if (previousEdit != null) { previousEdit.redo(); } atomicLockImpl (); try { TokenHierarchyControl<?> thcInactive = thcInactive(); try { super.redo(); } finally { if (thcInactive != null) { thcInactive.setActive(true); } } } finally { atomicUnlockImpl (); } }
@Override public void redo() throws CannotRedoException { if (!canRedo()) { throw new CannotRedoException(); } int i = 0; int size = edits.size(); try { for (; i < size; i++) { edits.get(i).redo(); } setStatusBits(HAS_BEEN_DONE); } finally { if (i != size) { // i-th edit's redo failed => undo the ones below while (--i >= 0) { edits.get(i).undo(); } } } }
@Override public void redo() throws CannotRedoException { undoRedoManager.checkLogOp("WrapUndoEdit.redo", this); boolean savepoint = undoRedoManager.isAtSavepoint(); if (savepoint) { undoRedoManager.beforeRedoAtSavepoint(this); } boolean done = false; try { delegate.redo(); done = true; // This will only happen if delegate.redo() does not throw CannotRedoException undoRedoManager.afterRedoCheck(this); } finally { if (!done && savepoint) { undoRedoManager.delegateRedoFailedAtSavepoint(this); } } }
/** Implements {@code UndoRedo}. Redo a previously undone edit. It finds a manager which next undo edit has the highest * time stamp and makes undo on it. * @exception CannotRedoException if it fails */ @Override public synchronized void redo () throws CannotRedoException { PropertiesEditorSupport.UndoRedoStampFlagManager chosenManager = (PropertiesEditorSupport.UndoRedoStampFlagManager)getNextRedo(); if (chosenManager == null) { throw new CannotRedoException(); } else { Object atomicFlag = chosenManager.getAtomicFlagOfEditToBeRedone(); if (atomicFlag == null) {// not linked with other edits as one atomic action chosenManager.redo(); } else { // atomic redo compound from more edits in underlying managers boolean redone; do { // the atomic action can consists from more redo edits from same manager redone = false; for (Iterator<Manager> it = managers.iterator(); it.hasNext(); ) { PropertiesEditorSupport.UndoRedoStampFlagManager manager = (PropertiesEditorSupport.UndoRedoStampFlagManager)it.next(); if(atomicFlag.equals(manager.getAtomicFlagOfEditToBeRedone())) { manager.redo(); redone = true; } } } while(redone); } } }
public static void redo(Context context, final int count) throws Exception { final Document doc = getDocument(context); final UndoManager undoManager = (UndoManager) doc.getProperty(UndoManager.class); logUndoRedoOp(context, "REDO", count); invoke(context, new Runnable() { @Override public void run() { try { int cnt = count; while (undoManager.canRedo() && --cnt >= 0) { undoManager.redo(); } } catch (CannotRedoException e) { throw new IllegalStateException(e); } } }); logPostUndoRedoOp(context, count); }
@Override public void redo() throws CannotRedoException { try { ignore = true; // take text from position + 1 String planText = history.get(position + 1); // parse it PoshParser parser = new PoshParser(new StringReader(planText)); PoshPlan plan = parser.parsePlan(); // synchronize with the editor tree lapTree.synchronize(plan); if (position < history.size() - 1) { ++position; } } catch (ParseException ex) { throw new CannotRedoException(); } finally { ignore = false; cs.fireChange(); } }
@Override public void redo() throws CannotRedoException { super.redo(); try { Set<QualName> deleted = new HashSet<>(this.oldTexts.keySet()); deleted.removeAll(this.newTexts.keySet()); doDeleteTexts(getResourceKind(), deleted); if (this.newProps != null) { doPutProperties(this.newProps); } doPutTexts(getResourceKind(), this.newTexts); } catch (IOException exc) { throw new CannotRedoException(); } notifyObservers(this); }
@Override public void redo() throws CannotRedoException { super.redo(); try { boolean layout = getType() == LAYOUT; if (!layout) { Set<QualName> deleted = getNames(this.oldGraphs); deleted.removeAll(getNames(this.newGraphs)); doDeleteGraphs(getResourceKind(), deleted); if (this.newProps != null) { doPutProperties(this.newProps); } } doPutGraphs(getResourceKind(), this.newGraphs, layout); } catch (IOException exc) { throw new CannotRedoException(); } notifyObservers(this); }
public void actionPerformed(ActionEvent e) { try { undo.redo(); } catch (CannotRedoException ex) { System.out.println("Unable to redo: " + ex); ex.printStackTrace(); } update(); undoAction.update(); }
@Override public void redo() throws CannotRedoException { synchronized(delegates) { for (CompoundUndoManager cm : delegates) { if(cm.hasFocus()) { cm.redo(); return; } } } }
public @Override void redo() throws CannotRedoException { super.redo(); if (debugUndo) { /*DEBUG*/System.err.println("REDO-" + dump()); // NOI18N } undoOrRedo(length, false); }
@Override public void redo() throws CannotRedoException { JTextComponent focusedComponent = EditorRegistry.focusedComponent(); if (focusedComponent != null) { if (focusedComponent.getDocument() == ces.getDocument()) { //call global undo only for focused component undoManager.redo(session); } } //delegate.redo(); inner.redo(); }
public void redo() throws CannotRedoException { assert (undone) : "Already redone"; if (redoFail) { throw new CannotRedoException(); } undone = false; }
@Override public void redo() throws CannotRedoException { // JTextComponent focusedComponent = EditorRegistry.focusedComponent(); // if (focusedComponent != null) { // if (focusedComponent.getDocument() == ces.getDocument()) { // //call global undo only for focused component // undoManager.redo(session); // } // } //delegate.redo(); inner.redo(); }
/** Overrides superclass method. Updates time stamp for that edit. */ @Override public synchronized void redo() throws CannotRedoException { UndoableEdit anEdit = editToBeRedone(); if(anEdit != null) { Object atomicFlag = stampFlags.get(anEdit).getAtomicFlag(); // atomic flag remains super.redo(); stampFlags.put(anEdit, new StampFlag(System.currentTimeMillis(), atomicFlag)); } }
@Override public void redo() throws CannotRedoException { boolean redoStartedTransaction = false; boolean needsRefresh = true; try { startTransaction(true, true); //start pseudo transaction for event firing redoStartedTransaction = true; AbstractModel.this.getAccess().prepareForUndoRedo(); super.redo(); AbstractModel.this.getAccess().finishUndoRedo(); endTransaction(); needsRefresh = false; } catch(CannotRedoException ex) { needsRefresh = false; throw ex; } finally { if (isIntransaction() && redoStartedTransaction) { try { endTransaction(true); // do not fire events } catch(Exception e) { Logger.getLogger(getClass().getName()).log(Level.INFO, "Redo error", e); //NOI18N } } if (needsRefresh) { setState(State.NOT_SYNCED); refresh(); } } }
@Override public void redo() throws CannotRedoException { if (!canRedo()) { throw new CannotRedoException(); } statusBits |= HAS_BEEN_DONE; }
@Override public void redo() throws CannotRedoException { super.redo(); // #145588 - must recompute index according to current modList state index = findModElementIndex(modElement.getStartOffset(), true); run(); }
@Override public void redo() throws CannotRedoException { super.redo(); if (removal) { removeEdit(this); } else { insertEdit(this); } }
@Override public void redo() throws CannotRedoException { super.redo(); if (mayDifferPairs != null) { for (PositionPair pair : mayDifferPairs) { assert (pair.mayDiffer) : "Invalid pair: " + pair; // NOI18N pair.mayDiffer = false; } } mayDifferUndoItem = this; }
@Override public void redo() throws CannotRedoException { if (fireException) { throw new CannotRedoException(); } super.redo(); }
public void redo() throws CannotRedoException { super.redo(); // Switch childrenAdded with childrenRemoved Element[] tmp = childrenRemoved; childrenRemoved = childrenAdded; childrenAdded = tmp; replace(index, childrenRemoved.length, childrenAdded); }
@Override public void redo() throws CannotRedoException { super.redo(); try { model.resetDocument(newDocument); } catch (RuntimeException ex) { if (newDocument != model.getCurrentDocument()) { CannotRedoException e = new CannotRedoException(); e.initCause(ex); throw e; } else { throw ex; } } }
public void performAction() { try { UndoRedo undoRedo = UndoAction.getUndoRedo(); if (undoRedo.canRedo()) { undoRedo.redo(); } } catch (CannotRedoException ex) { UndoRedoAction.cannotUndoRedo(ex); } UndoAction.updateStatus(); }
@Override public void redo() throws CannotRedoException { if(delegate != null) { delegate.redo(); } else { UndoRedo.NONE.redo(); } }
public void actionPerformed(ActionEvent e) { try { undo.redo(); } catch (CannotRedoException ex) { TEdit.showDialog("Unable to redo: " + ex.getMessage()); //ex.printStackTrace(); } updateState(); }
public void actionPerformed(ActionEvent e) { try { undo.redo(); } catch (CannotRedoException ex) { Util.debug("Unable to redo: " + ex); ex.printStackTrace(); } update(); undoAction.update(); }
@Override public void redo() throws CannotRedoException { super.redo(); try { doPutProperties(this.newProperties); } catch (IOException exc) { throw new CannotRedoException(); } notifyObservers(this); }
/** * Attempt to redo the last action. * * @see #undoLastAction() */ public void redoLastAction() { // NOTE: The try/catch block shouldn't be necessary... try { if (undoManager.canRedo()) { undoManager.redo(); } } catch (CannotRedoException cre) { cre.printStackTrace(); } }
void redo() { try { undoManager.redo(); } catch (CannotRedoException e) { Toolkit.getDefaultToolkit().beep(); log.warning(e.getMessage()); } finally { fixUndoRedo(); } }
public void redo() throws CannotRedoException { super.redo(); try { insertString(offset, string); string = null; // Update the Positions that were in the range removed. if(posRefs != null) { updateUndoPositions(posRefs, offset, length); posRefs = null; } } catch (BadLocationException bl) { throw new CannotRedoException(); } }
public void redo() throws CannotRedoException { super.redo(); try { string = getString(offset, length); // Get the Positions in the range being removed. posRefs = getPositionsInRange(null, offset, length); remove(offset, length); } catch (BadLocationException bl) { throw new CannotRedoException(); } }
/** * Redoes a change. * * @exception CannotRedoException if the change cannot be redone */ public void redo() throws CannotRedoException { super.redo(); MutableAttributeSet as = (MutableAttributeSet)element .getAttributes(); if(isReplacing) as.removeAttributes(as); as.addAttributes(newAttributes); }
@Override public void redo() throws CannotRedoException { super.redo(); boolean b = scene.getUndoRedoEnabled(); scene.setUndoRedoEnabled(false); scene.getModel().getViewChangedEvent().addListener(this); scene.getModel().setData(newModel); scene.getModel().getViewChangedEvent().removeListener(this); scene.setUndoRedoEnabled(b); }
@Override public void redo() throws CannotRedoException { startProgress(); if (added) { getModel().insertColumnAt(colIndex, colName, values); } else { getModel().removeColumn(colIndex); } super.redo(); stopProgress(); }