private int offset(int line) { StyledDocument doc = listener.support.getDocument(); int offset = doc == null ? 0 : NbDocument.findLineOffset(doc, line); return offset; }
@Override public int getLimit() { return new DocLockedRun(4, support.getDocument()).intResult; }
@Override public void discardAllEdits() { new DocLockedRun(5, support.getDocument(), 0, true); }
@Override public boolean canUndoOrRedo() { return new DocLockedRun(7, support.getDocument(), 0, true).booleanResult; }
@Override public boolean canUndo() { return new DocLockedRun(3, support.getDocument(), 0, true).booleanResult; }
public boolean canRedo() { final StyledDocument myDoc = support.getDocument(); return new RenderUndo (2, myDoc).booleanResult; }
public java.lang.String getUndoPresentationName() { final StyledDocument myDoc = support.getDocument(); return new RenderUndo (10, myDoc).stringResult; }
@Override public java.lang.String getUndoOrRedoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(8, support.getDocument(), 0, true).stringResult; } else { return ""; } }
@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 getUndoPresentationName() { if (support.isDocumentReady()) { return new DocLockedRun(10, support.getDocument(), 0, true).stringResult; } else { return ""; } }
public void redo() throws javax.swing.undo.CannotRedoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotRedoException (); // NOI18N new RenderUndo (0, myDoc); }
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); }
protected void attachUpdateListener() { DataObject dobj = getDataObject(); final CloneableEditorSupport cEditorSupport = dobj.getLookup().lookup(CloneableEditorSupport.class); if (cEditorSupport == null) { return; } Document doc = cEditorSupport.getDocument(); if (doc != null) { doc.removeDocumentListener(updateListener); doc.addDocumentListener(updateListener); } }
public void redo() throws javax.swing.undo.CannotRedoException { final StyledDocument myDoc = support.getDocument(); if (myDoc == null) throw new javax.swing.undo.CannotRedoException (); // NOI18N new RenderUndo (0, 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 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(); }
/** @return the position as swing.text.Position object. * @exception IOException when an exception occured during reading the file. */ public Position getPosition() throws IOException { if(manager.getCloneableEditorSupport().getDocument() == null) { manager.getCloneableEditorSupport ().openDocument (); } synchronized(manager.getLock()) { Manager.PositionKind p = (Manager.PositionKind)kind; return p.pos; } }
@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(); }
/** @return the position as swing.text.Position object. * @exception IOException when an exception occured during reading the file. */ public Position getPosition() throws IOException { if(manager.getCloneableEditorSupport().getDocument() == null) { manager.getCloneableEditorSupport ().openDocument (); } synchronized(manager.getLock()) { Manager.PositionKind p = (Manager.PositionKind)kind; return p.pos; } }