Package org.jitterbit.util

Examples of org.jitterbit.util.Interval


        }
    }
   
    @Override
    public Interval getInterval(Document doc) {
        Interval def = super.getInterval(doc);
        if (tokenStartsAt > 0) {
            return IntervalFactory.fromStartAndLength(def.startsAt() + tokenStartsAt, def.length());
        }
        return def;
    }
View Full Code Here


        return collector;
    }
   
    private boolean checkRow(ScriptDocument doc, int row, Set<Rectangle> collector) {
        try {
            Interval range = DocumentUtils.rowAsInterval(doc, row);
            Rectangle rowBounds = area.getTextPane().modelToView(range.startsAt());
            if (shouldRowBeHighlighted(doc, range)) {
                collector.add(rowBounds);
                return true;
            }
        } catch (BadLocationException ex) {
View Full Code Here

        @Override
        public void handle() {
            checkBeginTrans();
            checkEndTrans();
            Interval range = getInterval(document);
            inputComponent.setCaretPosition(range.startsAt() + range.length());
        }
View Full Code Here

        doPostCompletionHandling(h);
    }

    @Override
    public Interval getInterval(Document doc) {
        Interval def = super.getInterval(doc);
        if (tokenStartsAt > 0) {
            return IntervalFactory.fromStartAndLength(def.startsAt() + tokenStartsAt, def.length());
        }
        return def;
    }
View Full Code Here

    /**
     * Selects the token at the specified position in the text component.
     *
     */
    public void selectToken(int pos) {
        Interval toSelect = getIntervalToSelect(pos);
        TextComponentUtils.select(component, toSelect);
    }
View Full Code Here

        Token t = part.token;
        return t != Tokens.SINGLE_LINE_COMMENT && t != Tokens.BLOCK_COMMENT && t != Tokens.NO_CODE;
    }

    private Interval getTokenInterval(Partition part) {
        Interval toSelect = part;
        if (part.token == Tokens.STRING) {
            toSelect = getIntervalForString(part);
        } else if (part.token == Tokens.SOURCE_PATH) {
            toSelect = getIntervalForSourcePath(part);
        }
View Full Code Here

    public void displayMatch(MappingSearchMatch match) {
        targetField.setText(match.getMapping().getTargetPath().toString());
        targetField.setCaretPosition(0);
        openMappingAction.setEnabled(true);
        expressionArea.setText(match.getMapping().getTranslatedExpression(expressionTranslator));
        Interval span = match.getExpressionSpan();
        expressionArea.setCaretPosition(span.startsAt());
        expressionArea.moveCaretPosition(span.startsAt() + span.length());
        expressionArea.getCaret().setSelectionVisible(true);
    }
View Full Code Here

        String newText = worker.getText();
        if (!newText.equals(oldText)) {
            textComponent.setText(newText);
            TextSearchMatch lastMatch = matches.get(matches.size() - 1);
            int lengthOfReplaceString = searchParams.getReplaceString().length();
            Interval intervalToHighlight = IntervalFactory.fromStartAndLength(
                            lastMatch.startsAt(), lengthOfReplaceString);
            highlightMatch(intervalToHighlight);
        }
        // TODO: Tell the user how many places were replaced.
        if (offset == 0) {
View Full Code Here

        @Override
        public void paint(GlyphView v, Graphics g, Shape a, int p0, int p1) {
            int s = 0;
            Color saved = g.getColor();
            for (Map.Entry<Interval, Color> entry : coloredRegions.entrySet()) {
                Interval region = entry.getKey();
                int colStart = region.startsAt();
                int colEnd = colStart + region.length();
                if (colStart > s) {
                    delegate.paint(v, g, a, s, colStart);
                }
                g.setColor(entry.getValue());
                delegate.paint(v, g, a, colStart, colEnd);
View Full Code Here

    public void setText(String text, Color color) {
        if (text == null) {
            text = ""; //$NON-NLS-1$
        }
        adaptee.setText(text);
        Interval i = IntervalFactory.fromStartAndLength(0, text.length());
        decorator.addColoredRegion(i, color);
    }
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.