Package org.jitterbit.util

Examples of org.jitterbit.util.Interval


            text = ""; //$NON-NLS-1$
        }
        try {
            int offset = adaptee.getDocument().getLength();
            adaptee.getDocument().insertString(offset, text, null);
            Interval i = IntervalFactory.fromStartAndLength(offset, text.length());
            decorator.addColoredRegion(i, color);
        }
        catch (BadLocationException ex) {
            /**/
        }
View Full Code Here


                if ((s == null) || (s.length() == 0)) {
                    break;
                }
                for (int pos = 0, mpos = s.length(); pos < mpos; ++pos) {
                    char c = s.charAt(pos);
                    Interval i = handleCharacter(doc, c, firstIndex, pos);
                    if (i != null) {
                        return i;
                    }
                }
                firstIndex = lastIndex;
View Full Code Here

                if ((s == null) || (s.length() == 0)) {
                    break;
                }
                for (int pos = s.length() - 1; pos >= 0; --pos) {
                    char c = s.charAt(pos);
                    Interval i = handleCharacter(doc, c, firstIndex, pos);
                    if (i != null) {
                        return i;
                    }
                }
                lastIndex = firstIndex;
View Full Code Here

     * Returns <code>true</code> if the mouse moved from one word to another.
     *
     */
    @Override
    protected final boolean didMouseMove(MouseEvent e1, MouseEvent e2) {
        Interval w1 = getWord(e1);
        Interval w2 = getWord(e2);
        latestWord = w2;
        return (w1 == null) ? (w2 != null) : !w1.equals(w2);
    }
View Full Code Here

            intervals = new TreeSet<Interval>(new IntervalComparator());
            words = Maps.newHashMap();
        }
       
        public Interval find(int offset) {
            Interval i = null;
            if (minMaxOffset.contains(offset)) {
                i = lookForCachedInterval(offset);
            }
            if (i == null) {
                i = calculateNewInterval(offset);
View Full Code Here

            }
            return m_text;
        }
       
        private Interval calculateNewInterval(int offset) {
            Interval word = wordDetector.getWord(input.getDocument(), offset);
            if (word != null) {
                addNewWord(word);
            }
            return word;
        }
View Full Code Here

    }

    protected final void completeToken(CompletionToken token) {
        Document doc = target.getDocument();
        token.complete(doc);
        Interval interval = token.getInterval(doc);
        int newCaretPosition = Math.min(interval.startsAt() + interval.length(), doc.getLength());
        target.setCaretPosition(newCaretPosition);
        if (grabFocusAfterCompletion) {
            if (grabFocusDelay > 0) {
                FocusUtils.changeFocusAcrossWindows(target, 100);
            } else {
View Full Code Here

        @Override
        public void actionPerformed(ActionEvent e) {
            int offset = getOffset();
            if (isValidOffset(offset)) {
                Interval range = findMatch(offset);
                if (range != null) {
                    moveCursorToMatch(range, offset);
                }
            }
        }
View Full Code Here

            return (cursor == selectionStart) ? cursor : selectionStart;
        }

        private Interval findMatch(int offset) {
            for (CharacterPairFinder f : finders) {
                Interval range = f.findMatch(document, offset);
                if (range != null) {
                    return range;
                }
            }
            return null;
View Full Code Here

            }
        }

        private boolean handleAnchor(Finder f, int cursor, int anchorStartsAt) {
            boolean ret = false;
            Interval interval = f.findMatch(document, cursor);
            if (interval != null) {
                highlightMatch(interval);
                ret = true;
            }
            else {
View Full Code Here

TOP

Related Classes of org.jitterbit.util.Interval

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.