Package org.jitterbit.ui.text.partition.TextPartitioner

Examples of org.jitterbit.ui.text.partition.TextPartitioner.Partition


                        return doc.getLength();
                    }
                }
            }
            if (isAffectingStringLiterals(text)) {
                Partition lastString = getLastStringLiteral(offset);
                if (lastString != null) {
                    Partition next = lastString.getNext();
                    if (next != null) {
                        return next.offset;
                    }
                }
                return getDocument().getLength();
View Full Code Here


            }
            return getNextTokensEndPosition(offset);
        }

        private Partition getLastStringLiteral(int minOffset) {
            Partition last = getLast();
            while (last != null) {
                if (last.offset < minOffset) {
                    return null;
                }
                if (last.token == Tokens.STRING) {
                    return last;
                }
                last = last.getPrevious();
            }
            return null;
        }
View Full Code Here

        private static boolean isAffectingStringLiterals(String text) {
            return text != null && StringUtils.containsAny(text, "\"'");
        }

        private int getNextTokensEndPosition(int offset) {
            Partition p = getPartitionAt(offset);
            if (p != null) {
                Partition next = p.getNext();
                if (next != null) {
                    return next.endsAt;
                }
            }
            return getDocument().getLength();
View Full Code Here

            Token t = getTokenAt(caret);
            return t != null && !excludedTokens.contains(t);
        }
       
        protected final Token getTokenAt(int caret) {
            Partition p = partitioner.getPartitionAt(caret);
            return (p != null) ? p.token : null;
        }
View Full Code Here

        Interval toSelect = getIntervalToSelect(pos);
        TextComponentUtils.select(component, toSelect);
    }

    private Interval getIntervalToSelect(int pos) {
        Partition part = partitioner.getPartitionAt(pos);
        if (isSelectableToken(part)) {
            return getTokenInterval(part);
        } else {
            return getWordInterval(pos);
        }
View Full Code Here

        super(target, delay);
    }

    @Override
    protected final boolean didMouseMove(MouseEvent e1, MouseEvent e2) {
        Partition p1 = getPartitionAt(e1);
        Partition p2 = getPartitionAt(e2);
        latestPartition = p2;
        return p1 != p2;
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.ui.text.partition.TextPartitioner.Partition

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.