org.netbeans.editor.Utilities.debugPosition()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(58)

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

Utilities.debugPosition介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public static String offsetToLineColumnString(BaseDocument doc, int offset) {
  return String.valueOf(offset) + "[" + debugPosition(doc, offset) + "]"; // NOI18N
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

private static void appendOffsetInfo(StringBuffer sb, Document doc, int offset) {
  sb.append(offset);
  sb.append('[');
  // TODO - removed dependency on o.n.e.Utilities
  sb.append(org.netbeans.editor.Utilities.debugPosition(
    (org.netbeans.editor.BaseDocument)doc, offset));
  sb.append(']');
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

/** Debugs this mark block */
public String toString() {
  try {
    return "startPos=" + ((startMark != null)  // NOI18N
               ? Utilities.debugPosition(doc, startMark.getOffset())  : "null") + ", endPos=" // NOI18N
        + ((endMark != null) ? Utilities.debugPosition(doc, endMark.getOffset()) : "null") // NOI18N
        + ", " + ((prev != null) ? ((next != null) ? "chain member" // NOI18N
                : "last member") : ((next != null) ? "first member" // NOI18N
                                : "standalone member")); // NOI18N
  } catch (InvalidMarkException e) {
    return ""; // NOI18N
  }
}

代码示例来源:origin: net.java.abeille/abeille

/** Debugs this mark block */
public String toString() {
  try {
    return "startPos=" + ((startMark != null) // NOI18N
    ? Utilities.debugPosition(doc, startMark.getOffset())
        : "null") + ", endPos=" // NOI18N
        + ((endMark != null) ? Utilities.debugPosition(doc, endMark.getOffset()) : "null") // NOI18N
        + ", " + ((prev != null) ? ((next != null) ? "chain member" // NOI18N
            : "last member") : ((next != null) ? "first member" // NOI18N
            : "standalone member")); // NOI18N
  } catch (InvalidMarkException e) {
    return ""; // NOI18N
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public static String debugBlocks(BaseDocument doc, int[] blocks) {
  String ret;
  if (blocks == null) {
    ret = "Null blocks"; // NOI18N
  } else if (blocks.length == 0) {
    ret = "Empty blocks"; // NOI18N
  } else if (blocks.length % 2 != 0) {
    ret = "Blocks.length=" + blocks.length + " is not even!"; // NOI18N
  } else {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < blocks.length; i += 2) {
      sb.append('[');
      sb.append(i);
      sb.append("]=("); // NOI18N
      sb.append(blocks[i]);
      sb.append(", "); // NOI18N
      sb.append(blocks[i + 1]);
      sb.append(") or ("); // NOI18N
      sb.append(Utilities.debugPosition(doc, blocks[i]));
      sb.append(", "); // NOI18N
      sb.append(Utilities.debugPosition(doc, blocks[i + 1]));
      sb.append(')');
      if (i != blocks.length - 1) {
        sb.append('\n');
      }
    }
    ret = sb.toString();
  }
  return ret;
}

代码示例来源:origin: net.java.abeille/abeille

sb.append(blocks[i + 1]);
sb.append(") or ("); // NOI18N
sb.append(Utilities.debugPosition(doc, blocks[i]));
sb.append(", "); // NOI18N
sb.append(Utilities.debugPosition(doc, blocks[i + 1]));
sb.append(')');

代码示例来源:origin: net.java.abeille/abeille

+ atomicAsUser + ", breakGuarded=" + breakGuarded // NOI18N
    + ", inserting text='" + EditorDebug.debugString(text) // NOI18N
    + "' at offset=" + Utilities.debugPosition(this, offset)); // NOI18N
if (debugAtomicStack) {
  Thread.dumpStack();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

+ atomicAsUser + ", breakGuarded=" + breakGuarded // NOI18N
          + ", inserting text='" + EditorDebug.debugString(text) // NOI18N
          + "' at offset=" + Utilities.debugPosition(this, offset)); // NOI18N
if (debugAtomicStack) {
  Thread.dumpStack();

代码示例来源:origin: net.java.abeille/abeille

/**
 * This method is called automatically before the document is updated as
 * result of removal.
 */
protected void preRemoveCheck(int offset, int len) throws BadLocationException {
  int rel = guardedBlockChain.compareBlock(offset, offset + len);
  if (debugAtomic) {
    System.err.println("GuardedDocument.beforeRemoveUpdate() atomicAsUser=" // NOI18N
        + atomicAsUser + ", breakGuarded=" + breakGuarded // NOI18N
        + ", removing text='" + EditorDebug.debugChars(getChars(offset, len)) // NOI18N
        + "'at offset=" + Utilities.debugPosition(this, offset)); // NOI18N
    if (debugAtomicStack) {
      Thread.dumpStack();
    }
  }
  if ((rel & MarkBlock.OVERLAP) != 0 || (rel == MarkBlock.CONTINUE_BEGIN && !(offset == 0 || getChars(offset - 1, 1)[0] == '\n'))) {
    if (!breakGuarded || atomicAsUser) {
      // test whether the previous char before removed text is '\n'
      throw new GuardedException(MessageFormat.format(LocaleSupport.getString(FMT_GUARDED_REMOVE_LOCALE), new Object[] { new Integer(offset) }),
          offset);
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

+ atomicAsUser + ", breakGuarded=" + breakGuarded // NOI18N
          + ", removing text='" + EditorDebug.debugChars(getChars(offset, len)) // NOI18N
          + "'at offset=" + Utilities.debugPosition(this, offset)); // NOI18N
if (debugAtomicStack) {
  Thread.dumpStack();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

public void actionPerformed(ActionEvent evt) {
  Caret c = caret;
  JTextComponent component = editorUI.getComponent();
  if (component != null) {
    if (c != null) {
      BaseDocument doc = Utilities.getDocument(editorUI.getComponent());
      if (doc != null) {
        int pos = c.getDot();
        String s = Utilities.debugPosition(doc, pos);
        setText(CELL_POSITION, s);
      }
    }
    Boolean b = (Boolean)editorUI.getProperty(EditorUI.OVERWRITE_MODE_PROPERTY);
    boolean om = (b != null && b.booleanValue());
    if (om != overwriteModeDisplayed) {
      overwriteModeDisplayed = om;
      setText(CELL_TYPING_MODE, overwriteModeDisplayed ? ovrText : insText);
    }
  }
}

代码示例来源:origin: net.java.abeille/abeille

public void actionPerformed(ActionEvent evt) {
  Caret c = caret;
  JTextComponent component = editorUI.getComponent();
  if (component != null) {
    if (c != null) {
      BaseDocument doc = Utilities.getDocument(editorUI.getComponent());
      if (doc != null) {
        int pos = c.getDot();
        String s = Utilities.debugPosition(doc, pos);
        setText(CELL_POSITION, s);
      }
    }
    Boolean b = (Boolean) editorUI.getProperty(EditorUI.OVERWRITE_MODE_PROPERTY);
    boolean om = (b != null && b.booleanValue());
    if (om != overwriteModeDisplayed) {
      overwriteModeDisplayed = om;
      setText(CELL_TYPING_MODE, overwriteModeDisplayed ? ovrText : insText);
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

+ ' ' + Utilities.debugPosition((BaseDocument)c.getDocument(), blk[0]);
if (blk[2] == 1) { // wrap was done
  msg += "; "; // NOI18N

代码示例来源:origin: net.java.abeille/abeille

String msg = exp + LocaleSupport.getString(FOUND_LOCALE) + ' ' + Utilities.debugPosition((BaseDocument) c.getDocument(), blk[0]);
if (blk[2] == 1) { // wrap was done
  msg += "; "; // NOI18N

相关文章

微信公众号

最新文章

更多