Package org.jitterbit.ui.text.partition

Examples of org.jitterbit.ui.text.partition.Token


        return isInTrans ? WITHIN_TRANS : OUTSIDE_OF_TRANS;
    }

    @Override
    public Token next() {
        Token t = super.next();
        if (requireTransTags) {
            if (t == Tokens.BEGIN_TRANS) {
                isInTrans = true;
            } else if (t == Tokens.END_TRANS) {
                isInTrans = false;
View Full Code Here


    public boolean isAutoCompletionAvailable(int pos) {
        Partition p = getPartitionAt(pos);
        if (p == null) {
            return true;
        }
        Token t = p.token;
        return t != BEGIN_TRANS && t != END_TRANS && t != STRING && t != SINGLE_LINE_COMMENT && t != BLOCK_COMMENT;
    }
View Full Code Here

    private boolean isActivePosition(int pos) {
        Partition p = getPartitionAt(pos);
        if (p == null) {
            return true;
        }
        Token t = p.token;
        if (t == NO_CODE || t == BEGIN_TRANS) {
            return false;
        } else if (t == STRING || t == SINGLE_LINE_COMMENT || t == BLOCK_COMMENT || t == END_TRANS) {
            return isStartOfToken(t, p, pos);
        }
View Full Code Here

                 * than with a start-comment token.
                 */
                p = p.getPrevious();
            }
            while (p != null) {
                Token t = p.token;
                /*
                 * This is needed to cover cases like the following:
                 *
                 *   <trans>"abc"</trans
                 *
                 * At this point he currect partitioning will end with
                 *
                 *   OPERATOR("<") OPERATOR("/") SOURCE_PATH("trans")
                 *
                 * When the final ">" is typed, we need to go back all the way to the string literal
                 * "abc" in order to correctly detect the new END_TRANS token.
                 *
                 * Another example:
                 *
                 *     <trans>"abc"</tra ns>  [note the space in the closing trans]
                 *
                 * At this point the current partitioning will end with
                 *
                 *   OPERATOR("<") OPERATOR("/") SOURCE_PATH("tra") WHITESPACE(" ") SOURCE_PATH("ns") OPERATOR(">")
                 *
                 * When the erroneous space is deleted we must again walk back to the string literal "abc"
                 * as a starting point.
                 */
                if (!t.isWhitespace() && t != SOURCE_PATH && t != OPERATOR && t != WORD_TOKEN) {
                    break;
                }
                p = p.getPrevious();
            }
            return p;
View Full Code Here

            this.partitioner = partitioner;
            this.excludedTokens = Sets.newHashSet(Tokens.STRING, Tokens.SINGLE_LINE_COMMENT, Tokens.BLOCK_COMMENT);
        }

        protected final boolean isAvailableAt(int caret) {
            Token t = getTokenAt(caret);
            return t != null && !excludedTokens.contains(t);
        }
View Full Code Here

        super.mouseMoved(e);
    }

    @Override
    protected void handlePartition(Partition p, MouseEvent e) {
        Token t = p.token;
        TokenHovererDisplayer displayer = displayers.get(t);
        if (displayer != null) {
            String text = DocumentUtils.getText(getTarget().getDocument(), p);
            if (StringUtils.isNotEmpty(text)) {
                popup = displayer.display(getTarget(), text, p, e);
View Full Code Here

            return false;
        }
        if (selectCompleteToken) {
            return true;
        }
        Token t = part.token;
        return t != Tokens.SINGLE_LINE_COMMENT && t != Tokens.BLOCK_COMMENT && t != Tokens.NO_CODE;
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.ui.text.partition.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.