/** Get the line set for all paragraphs in the document. * @return positions of all paragraphs on last save */ public Line.Set getLineSet () { return updateLineSet (false); }
/** Get the line set for all paragraphs in the document. * @return positions of all paragraphs on last save */ public Line.Set getLineSet () { return updateLineSet (false); }
/** Get the line set for all paragraphs in the document. * @return positions of all paragraphs on last save */ public Line.Set getLineSet() { CloneableEditorSupport redirect = CloneableEditorSupportRedirector.findRedirect(this); if (redirect != null) { return redirect.getLineSet(); } return updateLineSet(false); }
@Override public void run() { try { UndoRedo.Manager urm = getUndoRedo(); if (urm instanceof UndoRedoManager) { UndoRedoManager urManager = (UndoRedoManager) urm; if (onSaveTasksStarted[0]) { urManager.endOnSaveTasks(); } urManager.markSavepoint(); } // Alloc 10% for non-single byte chars int byteArrayAllocSize = myDoc.getLength() * 11 / 10; memoryOutputStream[0] = new MemoryOutputStream(byteArrayAllocSize); saveFromKitToStream(myDoc, kit, memoryOutputStream[0]); // update cached info about lines updateLineSet(true); if (log) { ERR.fine(documentID() + ": Saved " + memoryOutputStream[0].size() + // NOI18N " bytes to memory output stream."); // NOI18N } } catch (BadLocationException blex) { Exceptions.printStackTrace(blex); } catch (IOException ex) { ioException[0] = ex; } } };
/** Initialization of the document. */ public void run() { // synchronized (getLock ()) { /* Remove existing listener before running the loading task * This should prevent firing of insertUpdate() during load (or reload) * which can prevent dedloks that sometimes occured during file reload. */ addRemoveDocListener(getDoc(), false); try { loadExc = null; LOCAL_LOAD_TASK.set(true); loadDocument(kit,getDoc()); } catch (IOException e) { loadExc = e; throw new DelegateIOExc(e); } finally { LOCAL_LOAD_TASK.set(null); } // opening the document, inform position manager getPositionManager().documentOpened(doc); // create new description of lines updateLineSet(true); setLastSaveTime(cesEnv().getTime().getTime()); // Start listening on changes in document addRemoveDocListener(getDoc(), true); }
updateLineSet (true); updateTitles (); } catch (IOException e) {
updateLineSet (true); updateTitles (); } catch (IOException e) {
/** Is called under getLock () to close the document. */ private boolean doCloseDocument() { boolean fireEvent = false; // notifies the support that cesEnv().removePropertyChangeListener(getListener()); try { LOCAL_CLOSE_DOCUMENT.set(Boolean.TRUE); callNotifyUnmodified(); } finally { LOCAL_CLOSE_DOCUMENT.set(Boolean.FALSE); } StyledDocument d = getDoc(); if (d != null) { d.removeUndoableEditListener(getUndoRedo()); addRemoveDocListener(d, false); } if (positionManager != null) { positionManager.documentClosed(); } documentStatus = DOCUMENT_NO; fireEvent = true; setDoc(null, false); kit = null; getUndoRedo().discardAllEdits(); updateLineSet(true); return fireEvent; }
updateLineSet(true); fireDocumentChange(doc, true); clearDocument();
updateLineSet(true); fireDocumentChange(doc, true); clearDocument();
/** Is called under getLock () to close the document. */ private void doCloseDocument () { prepareTask = null; // notifies the support that env ().removePropertyChangeListener(getListener()); notifyUnmodified (); if (doc != null) { doc.removeUndoableEditListener (getUndoRedo ()); doc.removeDocumentListener(getListener()); } if (positionManager != null) { positionManager.documentClosed (); documentStatus = DOCUMENT_NO; fireDocumentChange(doc, true); } documentStatus = DOCUMENT_NO; doc = null; kit = null; getUndoRedo().discardAllEdits(); updateLineSet (true); }
/** Is called under getLock () to close the document. */ private void doCloseDocument () { prepareTask = null; // notifies the support that env ().removePropertyChangeListener(getListener()); notifyUnmodified (); if (doc != null) { doc.removeUndoableEditListener (getUndoRedo ()); doc.removeDocumentListener(getListener()); } if (positionManager != null) { positionManager.documentClosed (); documentStatus = DOCUMENT_NO; fireDocumentChange(doc, true); } documentStatus = DOCUMENT_NO; doc = null; kit = null; getUndoRedo().discardAllEdits(); updateLineSet (true); }