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

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

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

Utilities.isRowWhite介绍

[英]Tests whether the line contains only whitespace characters.
[中]

代码示例

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

/**
 * Does the line contain some valid code besides of possible white space and
 * comments?
 */
public boolean isRowValid(int offset) throws BadLocationException {
  return Utilities.isRowWhite(getDocument(), offset);
}

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

/** Does the line contain some valid code besides of possible white space
* and comments?
*/
public boolean isRowValid(int offset)
throws BadLocationException {
  return Utilities.isRowWhite(getDocument(), offset);
}

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

public static int getFirstNonWhiteRow(BaseDocument doc, int offset, boolean downDir)
throws BadLocationException {
  if (isRowWhite(doc, offset)) {
    if (downDir) { // search down for non-white line
      offset = getFirstNonWhiteFwd(doc, offset);
    } else { // search up for non-white line
      offset = getFirstNonWhiteBwd(doc, offset);
    }
  }
  return offset;
}

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

private int countLinesBetweenLineOffsets(int startLineOffset, int endLineOffset) throws BadLocationException {
  int result = 0;
  for (int lineOffset = startLineOffset; lineOffset < endLineOffset; lineOffset++) {
    int rowStartFromLineOffset = Utilities.getRowStartFromLineOffset(baseDocument, lineOffset);
    if (!Utilities.isRowWhite(baseDocument, rowStartFromLineOffset) && !isJustCommentOnLine(rowStartFromLineOffset)) {
      result++;
    }
  }
  return result;
}

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

public static int getFirstNonWhiteRow(BaseDocument doc, int offset, boolean downDir) throws BadLocationException {
  if (isRowWhite(doc, offset)) {
    if (downDir) { // search down for non-white line
      offset = getFirstNonWhiteFwd(doc, offset);
    }
    else { // search up for non-white line
      offset = getFirstNonWhiteBwd(doc, offset);
    }
  }
  return offset;
}

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

/** Shift line either left or right */
public void shiftLine(BaseDocument doc, int dotPos, boolean right) throws BadLocationException {
  int ind = doc.getShiftWidth();
  if (!right) {
    ind = -ind;
  }
  if (Utilities.isRowWhite(doc, dotPos)) {
    ind += Utilities.getVisualColumn(doc, dotPos);
  }
  else {
    ind += Utilities.getRowIndent(doc, dotPos);
  }
  ind = Math.max(ind, 0);
  changeRowIndent(doc, dotPos, ind);
}

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

if (actualPrevIndent != prevIndent) {
  if (!(Utilities.isRowEmpty(doc, prevOffset) || Utilities.isRowWhite(doc, prevOffset))) {
    indent = actualPrevIndent + (indent - prevIndent);
    if (indent < 0) {

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

/** Shift line either left or right */
public void shiftLine(BaseDocument doc, int dotPos, boolean right)
throws BadLocationException {
  int ind = doc.getShiftWidth();
  if (!right) {
    ind = -ind;
  }
  if (Utilities.isRowWhite(doc, dotPos)) {
    ind += Utilities.getVisualColumn(doc, dotPos);
  } else {
    ind += Utilities.getRowIndent(doc, dotPos);
  }
  ind = Math.max(ind, 0);
  changeRowIndent(doc, dotPos, ind);
}

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

if (actualPrevIndent != prevIndent) {
  if (!(Utilities.isRowEmpty(doc, prevOffset) || Utilities.isRowWhite(doc, prevOffset))) {
    indent = actualPrevIndent + (indent-prevIndent);

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

!Utilities.isRowWhite(baseDoc, offset)) {
  break;
if (Utilities.isRowEmpty(baseDoc, offset) || Utilities.isRowWhite(baseDoc, offset)) {
        !Utilities.isRowWhite(baseDoc, offset)) {
      break;

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

if (!Utilities.isRowWhite(doc, afterPackageOffset)) {
  edits.replace(afterPackageOffset, 0, "\n", false, 0);
} else {
if (!Utilities.isRowWhite(doc, afterImportsOffset) && isLastImport(doc, fqName)) {
  edits.replace(afterImportsOffset, 0, "\n", false, 0);

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

) {
int indent = Utilities.getRowIndent(doc, pos);
if (Utilities.isRowWhite(doc, pos)) {

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

while (offset >= 0) {
  if (Utilities.isRowEmpty(doc, offset) || Utilities.isRowWhite(doc, offset)) {
    if (currentSectionOnly) {
      break;
while (offset < length) {
  if (Utilities.isRowEmpty(doc, offset) || Utilities.isRowWhite(doc, offset)) {
    if (currentSectionOnly) {
      break;

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

for (int lineCnt = Utilities.getRowCount(doc, startPos, endPos); lineCnt > 0; lineCnt--) {
  int indent = Utilities.getRowIndent(doc, pos);
  if (Utilities.isRowWhite(doc, pos)) {

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

int currentOffset = offset;
while (currentOffset > 0) {
  if (!Utilities.isRowEmpty(doc, currentOffset) && !Utilities.isRowWhite(doc, currentOffset)
      && !LexUtilities.isCommentOnlyLine(doc, currentOffset)) {
    indent = GsfUtilities.getLineIndent(doc, currentOffset);

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

private void comment(BaseDocument doc, int startOffset, int lineCount) throws BadLocationException {
  for (int offset = startOffset; lineCount > 0; lineCount--, offset = Utilities.getRowStart(doc, offset, +1)) {
    if (Utilities.isRowEmpty(doc, offset) || Utilities.isRowWhite(doc, offset)) {
      continue;

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

private void uncomment(BaseDocument doc, int startOffset, int lineCount) throws BadLocationException {
  for (int offset = startOffset; lineCount > 0; lineCount--, offset = Utilities.getRowStart(doc, offset, +1)) {
    if (Utilities.isRowEmpty(doc, offset) || Utilities.isRowWhite(doc, offset)) {
      continue;

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

if (Utilities.isRowEmpty(doc, next) || Utilities.isRowWhite(doc, next) ||
    LexUtilities.isCommentOnlyLine(doc, next)) {
  continue;

相关文章

微信公众号

最新文章

更多