/** * This method returns whether auto indentation should be done if Enter * is pressed at the end of the specified line. * * @param line The line to check. * @return Whether an extra indentation should be done. */ public boolean getShouldIndentNextLine(int line) { Token t = getTokenListForLine(line); t = t.getLastNonCommentNonWhitespaceToken(); return tokenMaker.getShouldIndentNextLineAfter(t); }
/** * Returns the last non-whitespace, non-comment token, starting with the * specified line. * * @param doc The document. * @param line The line at which to start looking. * @return The last non-whitespace, non-comment token, or <code>null</code> * if there isn't one. * @see #getNextImportantToken(Token, RSyntaxTextArea, int) * @see #getPreviousImportantTokenFromOffs(RSyntaxDocument, int) */ public static Token getPreviousImportantToken(RSyntaxDocument doc, int line) { if (line<0) { return null; } Token t = doc.getTokenListForLine(line); if (t!=null) { t = t.getLastNonCommentNonWhitespaceToken(); if (t!=null) { return t; } } return getPreviousImportantToken(doc, line-1); }
/** * This method returns whether auto indentation should be done if Enter * is pressed at the end of the specified line. * * @param line The line to check. * @return Whether an extra indentation should be done. */ public boolean getShouldIndentNextLine(int line) { Token t = getTokenListForLine(line); t = t.getLastNonCommentNonWhitespaceToken(); return tokenMaker.getShouldIndentNextLineAfter(t); }
/** * This method returns whether auto indentation should be done if Enter * is pressed at the end of the specified line. * * @param line The line to check. * @return Whether an extra indentation should be done. */ public boolean getShouldIndentNextLine(int line) { Token t = getTokenListForLine(line); t = t.getLastNonCommentNonWhitespaceToken(); return tokenMaker.getShouldIndentNextLineAfter(t); }
/** * This method returns whether auto indentation should be done if Enter * is pressed at the end of the specified line. * * @param line The line to check. * @return Whether an extra indentation should be done. */ public boolean getShouldIndentNextLine(int line) { Token t = getTokenListForLine(line); t = t.getLastNonCommentNonWhitespaceToken(); return tokenMaker.getShouldIndentNextLineAfter(t); }
/** * Returns the last non-whitespace, non-comment token, starting with the * specified line. * * @param doc The document. * @param line The line at which to start looking. * @return The last non-whitespace, non-comment token, or <code>null</code> * if there isn't one. * @see #getNextImportantToken(Token, RSyntaxTextArea, int) * @see #getPreviousImportantTokenFromOffs(RSyntaxDocument, int) */ public static Token getPreviousImportantToken(RSyntaxDocument doc, int line) { if (line<0) { return null; } Token t = doc.getTokenListForLine(line); if (t!=null) { t = t.getLastNonCommentNonWhitespaceToken(); if (t!=null) { return t; } } return getPreviousImportantToken(doc, line-1); }