Examples of removeHighlight()


Examples of javax.swing.text.Highlighter.removeHighlight()

        private static void moveHighlight(final JEditorPane editor,
                                          final int start, final int end) {
            Highlighter highlighter = editor.getHighlighter();
            Object tag = highlightTags.get(highlighter);
            if (tag != null) {
                highlighter.removeHighlight(tag);
                highlightTags.remove(highlighter);
            }
            try {
                tag = highlighter.addHighlight(start, end,
                                               new LinkHighlightPainter());
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

        static void removeHighlight(final JEditorPane editor) {
            Highlighter highlighter = editor.getHighlighter();
            Object tag = highlightTags.get(highlighter);
            if (tag != null) {
                highlighter.removeHighlight(tag);
                highlightTags.remove(highlighter);
            }
        }
    }
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

        private static void moveHighlight(final JEditorPane editor,
                                          final int start, final int end) {
            Highlighter highlighter = editor.getHighlighter();
            Object tag = highlightTags.get(highlighter);
            if (tag != null) {
                highlighter.removeHighlight(tag);
                highlightTags.remove(highlighter);
            }
            try {
                tag = highlighter.addHighlight(start, end,
                                               new LinkHighlightPainter());
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

        static void removeHighlight(final JEditorPane editor) {
            Highlighter highlighter = editor.getHighlighter();
            Object tag = highlightTags.get(highlighter);
            if (tag != null) {
                highlighter.removeHighlight(tag);
                highlightTags.remove(highlighter);
            }
        }
    }
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

    public void clearMarker(String mark) {
        markers.remove(mark);
        Collection<Object> tags = highlights.removeAll(mark);
        Highlighter hl = textComponent.getHighlighter();
        for (Object tag : tags) {
            hl.removeHighlight(tag);
        }
    }

    public void addMarker(MarkerColor color) {
        String selected = textComponent.getSelectedText();
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

            if (removeAll) {
                hl.removeAllHighlights();
            }
            else {
                for (Object tag : highlights) {
                    hl.removeHighlight(tag);
                }
                highlights.clear();
            }
        }
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

        Highlighter.Highlight[] highlights = highlighter.getHighlights();
        for (int i = 0; i < highlights.length; i++) {
            Highlighter.Highlight h = highlights[i];
            if (h.getPainter() == this.matchPainter ||
                    h.getPainter() == this.selectionPainter) {
                highlighter.removeHighlight(h);
            }
        }
       
        if (pattern == null || "".equals(pattern))
            return;
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

            pos = -1;
        } else {
            if (previous != current)
                try {
                    if (current != null) {
                        highlighter.removeHighlight(current);
                        highlighter.addHighlight(current.getStartOffset(), current.getEndOffset(), matchPainter);
                    }
                    highlighter.removeHighlight(previous);
                    highlighter.addHighlight(previous.getStartOffset(), previous.getEndOffset(), selectionPainter);
                    center(previous);
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

                try {
                    if (current != null) {
                        highlighter.removeHighlight(current);
                        highlighter.addHighlight(current.getStartOffset(), current.getEndOffset(), matchPainter);
                    }
                    highlighter.removeHighlight(previous);
                    highlighter.addHighlight(previous.getStartOffset(), previous.getEndOffset(), selectionPainter);
                    center(previous);
                } catch (BadLocationException ble) {
                    // impossible
                }
View Full Code Here

Examples of javax.swing.text.Highlighter.removeHighlight()

            pos = -1;
        } else {
            if (next != current)
                try {
                    if (current != null) {
                        highlighter.removeHighlight(current);
                        highlighter.addHighlight(current.getStartOffset(), current.getEndOffset(), matchPainter);
                    }
                    highlighter.removeHighlight(next);
                    highlighter.addHighlight(next.getStartOffset(), next.getEndOffset(), selectionPainter);
                    center(next);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.