@Override public boolean canUndoOrRedo() { return new DocLockedRun(7, support.getDocument(), 0, true).booleanResult; }
public DocLockedRun(int type, StyledDocument doc, int intValue, boolean readLock) { this.type = type; this.intResult = intValue; if (!readLock && (doc instanceof NbDocument.WriteLockable)) { ((NbDocument.WriteLockable) doc).runAtomic(this); } else { if (readLock && doc != null) { doc.render(this); } else { // if the document is not one of "NetBeans ready" // that supports locking we do not have many // chances to do something. Maybe check for AbstractDocument // and call writeLock using reflection, but better than // that, let's leave this simple for now and wait for // bug reports (if any appear) run(); } } }
@Override public boolean canUndo() { return new DocLockedRun(3, support.getDocument(), 0, true).booleanResult; }
@Override public void setLimit(int l) { new DocLockedRun(6, support.getDocument(), l); }
@Override public boolean canRedo() { return new DocLockedRun(2, support.getDocument(), 0, true).booleanResult; }
@Override public java.lang.String getRedoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(9, support.getDocument(), 0, true).stringResult; } else { return ""; } }
@Override public java.lang.String getUndoOrRedoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(8, support.getDocument(), 0, true).stringResult; } else { return ""; } }
@Override public void redo() throws javax.swing.undo.CannotRedoException { final StyledDocument doc = support.getDocument(); if (doc == null) { throw new javax.swing.undo.CannotRedoException(); // NOI18N } new DocLockedRun(0, doc); checkCallNotifyUnmodified(); }
@Override public java.lang.String getUndoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(10, support.getDocument(), 0, true).stringResult; } else { return ""; } }
@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(); }
@Override public void discardAllEdits() { new DocLockedRun(5, support.getDocument(), 0, true); }
@Override public int getLimit() { return new DocLockedRun(4, support.getDocument()).intResult; }