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

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

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

Utilities.getRowIndent介绍

[英]Get indentation on the current line. If this line is white then return -1.
[中]获取当前行的缩进。如果此行为白色,则返回-1。

代码示例

代码示例来源: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: 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: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

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

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

int upperCol = Utilities.getRowIndent(doc, dotPos, false);
if (upperCol == -1) { // no prev line with indent
  upperCol = 0;
int indent = Utilities.getRowIndent(doc, dotPos);

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

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

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

int previousIndent = Utilities.getRowIndent(doc, previousExprestion);
int currentIndent = Utilities.getRowIndent(doc, offset);
int newIndent = IndentUtils.countIndent(doc, offset, previousIndent);
if (newIndent != currentIndent) {

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

int upperCol = Utilities.getRowIndent(doc, dotPos, false);
if (upperCol == -1) { // no prev line with  indent
  upperCol = 0;
int indent = Utilities.getRowIndent(doc, dotPos);

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

poss = Utilities.getRowStart(doc, fnw);
doc.insertString(pos, doc.getText(poss, fnw-poss), null);
int tagIndentation = Utilities.getRowIndent(doc, pos);
if (!indentOnly){
  int rowOffset = Utilities.getRowStart(doc, Utilities.getRowStart(doc, pos) - 1);
  int indentation = Utilities.getRowIndent(doc, pos) + this.getShiftWidth();
  int delta = 0;
  int deltahelp;
      if (token != null && token.getTokenContextPath().contains(HTMLTokenContext.contextPath)){
        changeRowIndent(doc, rowOffset, indentation);
        int htmlindent = Utilities.getRowIndent(doc, rowOffset);
        delta = delta + Utilities.getRowFirstNonWhite(doc, rowOffset ) - deltahelp;

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

int currentLine = Utilities.getLineOffset(doc, currentOffset);
if (firstLine < currentLine && !token.equals("\n")) {  //NOI18N
  int lineIndent = doc.getLength() + 1 >= currentOffset + 1 ? Utilities.getRowIndent(doc, currentOffset + 1) : 0;
  int finalIndent = lastPHPIndent + lineIndent + (countInitialIndent ? docOptions.initialIndent : 0); // - lineHTMLIndent;
  if (finalIndent == docOptions.initialIndent && finalIndent != 0) {

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

Indentation result = Indentation.NONE;
if (neOffset != -1) {
  result = new IndentationImpl(Utilities.getRowIndent(doc, neOffset) + indentSize);
  newIndent = Utilities.getRowIndent(doc, stringLineStart) + indentSize;
} else {
  newIndent = Utilities.getRowIndent(doc, caretLineStart);
    int casePosition = breakProceededByCase(ts); // is after break in case statement?
    if (casePosition > -1) {
      newIndent = Utilities.getRowIndent(doc, anchor);
      if (Utilities.getRowStart(doc, casePosition) != caretLineStart) {
      newIndent = Utilities.getRowIndent(doc, anchor) - indentSize;
    } else {
      newIndent = Utilities.getRowIndent(doc, anchor) + delimiter.indentDelta + shiftAtAncor;
    newIndent = Utilities.getRowIndent(doc, startExpression) + indentSize;
    break;
    newIndent = Utilities.getRowIndent(doc, anchor) + delimiter.indentDelta + shiftAtAncor;
          int offsetArrayDeclaration = offsetArrayDeclaration(startExpression, ts);
          if (offsetArrayDeclaration > -1) {
            newIndent = Utilities.getRowIndent(doc, offsetArrayDeclaration) + itemsArrayDeclararionSize;
          } else {
            newIndent = Utilities.getRowIndent(doc, startExpression) + continuationSize;

相关文章

微信公众号

最新文章

更多