protected boolean matchWord() {
        IDocument doc = fText.getDocument();

        try {
            int pos = curPos;
            char c;

            // Scan backwards for the start of the word.
            while (pos >= 0) {
                c = doc.getChar(pos);
                // Yes we know this isn't Java code we are parsing but the
                // Java identifier rule is close enough for now.
                if (!Character.isJavaIdentifierPart(c))
                    break;
                --pos;
            }
            startPos = pos;

            // Scan forward for the end of the word.
            pos = curPos;
            int length = doc.getLength();
            while (pos < length) {
                c = doc.getChar(pos);
                if (!Character.isJavaIdentifierPart(c))
                    break;
                ++pos;
            }
            endPos = pos;

            return true;
        } catch (BadLocationException x) {
            log.debug(x);
        }

        return false;
    }
Attempts to determine and set the start (fStartPos) and end (fEndPos) of the word
that was double-clicked.

@return true if the bounds of the word were successfully determined, otherwise false.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLDoubleClickStrategy.java