/** * Clear all highlighting markup in a styled document. * @param myDoc The StyledDocument to highlight * @param highlight The highlighting attributes */ private void clearHighlight(StyledDocument myDoc, MutableAttributeSet highlight) { // clear any attributes. myDoc.setCharacterAttributes(myDoc.getStartPosition().getOffset(), myDoc.getEndPosition().getOffset(), highlight, true); }
public boolean attach() { int offset = pos.getOffset(); if (offset == -1) { return false; } Position endPos = document.getEndPosition(); if (endPos == null || offset >= endPos.getOffset()) { return false; } if (!(document instanceof NbDocument.Annotatable)) { return false; } if (getAnnotationType() == null) { return false; } try { NbDocument.addAnnotation(document, pos, -1, this); return true; } catch (Throwable e) { Exceptions.printStackTrace(e); return false; } }
return org.openide.text.NbDocument.findLineNumber(styledDoc, styledDoc.getEndPosition().getOffset());
); } catch (BadLocationException e) { p = mgr.getDoc().getEndPosition(); ); } catch (BadLocationException e) { retObject = mgr.getDoc().getEndPosition(); } catch (IndexOutOfBoundsException e) { retObject = mgr.getDoc().getEndPosition();
argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward); } catch (BadLocationException e) { p = mgr.getDoc ().getEndPosition (); argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward); } catch (BadLocationException e) { retObject = mgr.getDoc ().getEndPosition (); } catch (IndexOutOfBoundsException e) { retObject = mgr.getDoc ().getEndPosition();
argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward); } catch (BadLocationException e) { p = mgr.getDoc ().getEndPosition (); argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward); } catch (BadLocationException e) { retObject = mgr.getDoc ().getEndPosition (); } catch (IndexOutOfBoundsException e) { retObject = mgr.getDoc ().getEndPosition();