/** Check whether there are no tokens except the ending EOL * on the given line. * @param pos any position on the line */ public boolean isLineEmpty(FormatTokenPosition pos) { return findLineStart(pos).equals(findLineEnd(pos)); }
/** * Check whether there are no tokens except the ending EOL on the given * line. * * @param pos * any position on the line */ public boolean isLineEmpty(FormatTokenPosition pos) { return findLineStart(pos).equals(findLineEnd(pos)); }
/** Get the indentation of the line. * @param formatTokenPosition any position on the line. * It doesn't have to be the first one. * @param zeroForWSLine If set to true the method will return zero * in case the line consist of whitespace only. If false * the method will return the indentation even for whitespace * lines. */ public int getLineIndent(FormatTokenPosition pos, boolean zeroForWSLine) { FormatTokenPosition firstNWS = findLineFirstNonWhitespace(pos); if (firstNWS == null) { // no non-WS char on the line if (zeroForWSLine) { return 0; } else { // return indent even for WS lines firstNWS = findLineEnd(pos); } } return getVisualColumnOffset(firstNWS); }
/** * Get the indentation of the line. * * @param formatTokenPosition * any position on the line. It doesn't have to be the first one. * @param zeroForWSLine * If set to true the method will return zero in case the line * consist of whitespace only. If false the method will return * the indentation even for whitespace lines. */ public int getLineIndent(FormatTokenPosition pos, boolean zeroForWSLine) { FormatTokenPosition firstNWS = findLineFirstNonWhitespace(pos); if (firstNWS == null) { // no non-WS char on the line if (zeroForWSLine) { return 0; } else { // return indent even for WS lines firstNWS = findLineEnd(pos); } } return getVisualColumnOffset(firstNWS); }
pos = findLineEnd(pos); if (isChainStartPosition(pos)) { // empty first line return pos;
pos = findLineEnd(pos); if (isChainStartPosition(pos)) { // empty first line return pos;