getPositionManager().documentClosed(); updateLineSet(true); fireDocumentChange(doc, true);
getPositionManager ().documentOpened (doc);
/** Reads the manager and the offset (int). */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { insertAfter = in.readBoolean (); manager = (Manager)in.readObject(); kind = manager.readKind (in); init (); }
retInt = NbDocument.findLineNumber(mgr.getCloneableEditorSupport().openDocument(), argInt); break; } retInt = NbDocument.findLineColumn (mgr.getCloneableEditorSupport().openDocument(), argInt); break; }
retInt = NbDocument.findLineNumber(mgr.getCloneableEditorSupport().openDocument(), argInt); break; } retInt = NbDocument.findLineColumn (mgr.getCloneableEditorSupport().openDocument(), argInt); break; }
retInt = NbDocument.findLineNumber(mgr.getCloneableEditorSupport().openDocument(), argInt); retInt = NbDocument.findLineColumn(mgr.getCloneableEditorSupport().openDocument(), argInt);
getPositionManager().documentClosed(); updateLineSet(true); fireDocumentChange(doc, true);
getPositionManager ().documentOpened (doc);
StyledDocument doc = mgr.getCloneableEditorSupport().getDocument(); if (doc == null) { doc = mgr.getCloneableEditorSupport().openDocument();
/** Offset */ public int getOffset() { /* pre-33165 try { StyledDocument doc = getCloneableEditorSupport().getDocument(); if (doc == null) { doc = getCloneableEditorSupport().openDocument(); } return NbDocument.findLineOffset (doc, line) + column; } catch (IOException e) { // what to do? hopefully unlikelly return 0; } */ try { StyledDocument doc = mgr.getCloneableEditorSupport().getDocument(); if (doc == null) { doc = mgr.getCloneableEditorSupport().openDocument(); } int retOffset = new DocumentRenderer( mgr, DocumentRenderer.LINE_KIND_GET_OFFSET, this, line, column, doc ).renderToInt(); return retOffset; } catch (IOException e) { // what to do? hopefully unlikelly return 0; } }
StyledDocument doc = mgr.getCloneableEditorSupport().getDocument(); if (doc == null) { doc = mgr.getCloneableEditorSupport().openDocument();
/** 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; }
/** 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); }
/** 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); }
/** Implements <code>Runnable</code> interface. * Does full pass sweep in <code>RequestProcessor</code> thread. */ public synchronized void run() { synchronized (getLock()) { ChainItem previous = head; ChainItem ref = previous.next; while(ref != null) { if(ref.get() == null) { // Remove the item from data structure. previous.next = ref.next; } else { previous = ref; } ref = ref.next; } } }
/** Implements <code>Runnable</code> interface. * Does full pass sweep in <code>RequestProcessor</code> thread. */ public synchronized void run() { synchronized (getLock()) { ChainItem previous = head; ChainItem ref = previous.next; while(ref != null) { if(ref.get() == null) { // Remove the item from data structure. previous.next = ref.next; } else { previous = ref; } ref = ref.next; } } }
/** Adds the position to this manager. */ Kind addPosition(final PositionRef pos) { Kind kind; /* pre-33165 synchronized(this) { head.next = new ChainItem(pos, queue, head.next); kind = (doc == null ? pos.kind : pos.kind.toMemory(pos.insertAfter)); } */ kind = (Kind)new DocumentRenderer(this, DocumentRenderer.ADD_POSITION, pos).renderToObject(); checkQueue(); return kind; }
/** Adds the position to this manager. */ Kind addPosition(final PositionRef pos) { Kind kind; /* pre-33165 synchronized(this) { head.next = new ChainItem(pos, queue, head.next); kind = (doc == null ? pos.kind : pos.kind.toMemory(pos.insertAfter)); } */ kind = (Kind)new DocumentRenderer(this, DocumentRenderer.ADD_POSITION, pos).renderToObject(); checkQueue(); return kind; }
/** @return the position as swing.text.Position object. * @exception IOException when an exception occured during reading the file. */ public Position getPosition() throws IOException { // Hold the document reference to prevent document to be closed StyledDocument doc = manager.getCloneableEditorSupport().getDocument(); if (doc == null) { doc = manager.getCloneableEditorSupport().openDocument(); } synchronized (manager.getLock()) { // Fix for IZ#67761 - ClassCastException: org.openide.text.PositionRef$Manager$OffsetKind Manager.PositionKind p = kind.toMemory( insertAfter ); return p.pos; } }