/** @param doc document * @param offset offset * @return new instance of the position */ public static Position create(Document doc, int offset) { BackwardPosition p = new BackwardPosition(offset); doc.addDocumentListener(org.openide.util.WeakListeners.document(p, doc)); return p; }
/** @param doc document * @param offset offset * @return new instance of the position */ public static Position create (Document doc, int offset) { BackwardPosition p = new BackwardPosition (offset); doc.addDocumentListener (org.openide.util.WeakListeners.document (p, doc)); return p; }
/** @param doc document * @param offset offset * @return new instance of the position */ public static Position create (Document doc, int offset) { BackwardPosition p = new BackwardPosition (offset); doc.addDocumentListener (org.openide.util.WeakListeners.document (p, doc)); return p; }
/** Creates new LineListener */ public LineListener(StyledDocument doc, CloneableEditorSupport support) { this.struct = new LineStruct(); root = NbDocument.findLineRootElement(doc); orig = lines = root.getElementCount(); this.support = support; doc.addDocumentListener(WeakListeners.document(this, doc)); }
/** Creates new LineListener */ public LineListener (StyledDocument doc, CloneableEditorSupport support) { this.doc = doc; this.struct = new LineStruct (); root = NbDocument.findLineRootElement (doc); orig = lines = root.getElementCount (); this.support = support; doc.addDocumentListener(org.openide.util.WeakListeners.document (this, doc)); }
/** Creates new LineListener */ public LineListener (StyledDocument doc, CloneableEditorSupport support) { this.doc = doc; this.struct = new LineStruct (); root = NbDocument.findLineRootElement (doc); orig = lines = root.getElementCount (); this.support = support; doc.addDocumentListener(org.openide.util.WeakListeners.document (this, doc)); }
doc.addDocumentListener(WeakListeners.document(listener, doc)); setOpaque(true);
NbDocument.markError(doc, pos.getOffset()); doc.addDocumentListener(docL = org.openide.util.WeakListeners.document(listener, doc));
/** Refreshes the current line. * * @deprecated since 1.20. */ synchronized void refreshState () { StyledDocument doc = pos.getCloneableEditorSupport ().getDocument (); if (doc != null) { // the document is in memory, mark the state if (docL != null) { doc.removeDocumentListener (docL); } // error line if (error) { NbDocument.markError (doc, pos.getOffset ()); doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc)); return; } // current line if (current) { NbDocument.markCurrent (doc, pos.getOffset ()); return; } // breakpoint line if (breakpoint) { NbDocument.markBreakpoint (doc, pos.getOffset ()); return; } NbDocument.markNormal (doc, pos.getOffset ()); return; } }
/** Refreshes the current line. * * @deprecated since 1.20. */ synchronized void refreshState () { StyledDocument doc = pos.getCloneableEditorSupport ().getDocument (); if (doc != null) { // the document is in memory, mark the state if (docL != null) { doc.removeDocumentListener (docL); } // error line if (error) { NbDocument.markError (doc, pos.getOffset ()); doc.addDocumentListener (docL = org.openide.util.WeakListeners.document (listener, doc)); return; } // current line if (current) { NbDocument.markCurrent (doc, pos.getOffset ()); return; } // breakpoint line if (breakpoint) { NbDocument.markBreakpoint (doc, pos.getOffset ()); return; } NbDocument.markNormal (doc, pos.getOffset ()); return; } }