javax.swing.text.StyledDocument.getEndPosition()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中javax.swing.text.StyledDocument.getEndPosition()方法的一些代码示例,展示了StyledDocument.getEndPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StyledDocument.getEndPosition()方法的具体详情如下:
包路径:javax.swing.text.StyledDocument
类名称:StyledDocument
方法名:getEndPosition

StyledDocument.getEndPosition介绍

暂无

代码示例

代码示例来源:origin: edu.illinois.lis/indri

  1. /**
  2. * Clear all highlighting markup in a styled document.
  3. * @param myDoc The StyledDocument to highlight
  4. * @param highlight The highlighting attributes
  5. */
  6. private void clearHighlight(StyledDocument myDoc,
  7. MutableAttributeSet highlight) {
  8. // clear any attributes.
  9. myDoc.setCharacterAttributes(myDoc.getStartPosition().getOffset(),
  10. myDoc.getEndPosition().getOffset(),
  11. highlight, true);
  12. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

  1. public boolean attach() {
  2. int offset = pos.getOffset();
  3. if (offset == -1) {
  4. return false;
  5. }
  6. Position endPos = document.getEndPosition();
  7. if (endPos == null || offset >= endPos.getOffset()) {
  8. return false;
  9. }
  10. if (!(document instanceof NbDocument.Annotatable)) {
  11. return false;
  12. }
  13. if (getAnnotationType() == null) {
  14. return false;
  15. }
  16. try {
  17. NbDocument.addAnnotation(document, pos, -1, this);
  18. return true;
  19. } catch (Throwable e) {
  20. Exceptions.printStackTrace(e);
  21. return false;
  22. }
  23. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

  1. return org.openide.text.NbDocument.findLineNumber(styledDoc, styledDoc.getEndPosition().getOffset());

代码示例来源:origin: org.netbeans.api/org-openide-text

  1. );
  2. } catch (BadLocationException e) {
  3. p = mgr.getDoc().getEndPosition();
  4. );
  5. } catch (BadLocationException e) {
  6. retObject = mgr.getDoc().getEndPosition();
  7. } catch (IndexOutOfBoundsException e) {
  8. retObject = mgr.getDoc().getEndPosition();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward);
  2. } catch (BadLocationException e) {
  3. p = mgr.getDoc ().getEndPosition ();
  4. argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward);
  5. } catch (BadLocationException e) {
  6. retObject = mgr.getDoc ().getEndPosition ();
  7. } catch (IndexOutOfBoundsException e) {
  8. retObject = mgr.getDoc ().getEndPosition();

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward);
  2. } catch (BadLocationException e) {
  3. p = mgr.getDoc ().getEndPosition ();
  4. argInsertAfter ? Position.Bias.Forward : Position.Bias.Backward);
  5. } catch (BadLocationException e) {
  6. retObject = mgr.getDoc ().getEndPosition ();
  7. } catch (IndexOutOfBoundsException e) {
  8. retObject = mgr.getDoc ().getEndPosition();

相关文章