public void moveCaretToNextSQLBegin() { String sql = getText(); int iCaretPos = getCaretPosition(); int iNextIndex = sql.indexOf(SQL_STMT_SEP, iCaretPos); if(-1 == iNextIndex) { return; } while(iNextIndex < sql.length() && Character.isWhitespace(sql.charAt(iNextIndex))) { ++iNextIndex; } if(iNextIndex < sql.length()) { setCaretPosition(iNextIndex); } }
public void moveCaretToNextSQLBegin() { String sql = getText(); int iCaretPos = getCaretPosition(); int iNextIndex = sql.indexOf(SQL_STMT_SEP, iCaretPos); if(-1 == iNextIndex) { return; } while(iNextIndex < sql.length() && Character.isWhitespace(sql.charAt(iNextIndex))) { ++iNextIndex; } if(iNextIndex < sql.length()) { setCaretPosition(iNextIndex); } }
public void moveCaretToPreviousSQLBegin() { String sql = getText(); int iCaretPos = getCaretPosition() - 1; int iLastIndex = sql.lastIndexOf(SQL_STMT_SEP, iCaretPos); if(-1 == iLastIndex) { return; } iLastIndex = sql.lastIndexOf(SQL_STMT_SEP, iLastIndex - getWhiteSpaceCountBackwards(iLastIndex, sql)); if(-1 == iLastIndex) { iLastIndex = 0; } char c = sql.charAt(iLastIndex); while(Character.isWhitespace(c) && iLastIndex < sql.length()) { ++iLastIndex; c = sql.charAt(iLastIndex); } setCaretPosition(iLastIndex); }
public void moveCaretToPreviousSQLBegin() { String sql = getText(); int iCaretPos = getCaretPosition() - 1; int iLastIndex = sql.lastIndexOf(SQL_STMT_SEP, iCaretPos); if(-1 == iLastIndex) { return; } iLastIndex = sql.lastIndexOf(SQL_STMT_SEP, iLastIndex - getWhiteSpaceCountBackwards(iLastIndex, sql)); if(-1 == iLastIndex) { iLastIndex = 0; } char c = sql.charAt(iLastIndex); while(Character.isWhitespace(c) && iLastIndex < sql.length()) { ++iLastIndex; c = sql.charAt(iLastIndex); } setCaretPosition(iLastIndex); }