BasicTextUI.BasicHighlighter
, DefaultHighlighter
, LayeredHighlighter
public interface Highlighter
Modifier and Type | Interface | Description |
---|---|---|
static interface |
Highlighter.Highlight |
A highlight. |
static interface |
Highlighter.HighlightPainter |
Highlight renderer. |
Modifier and Type | Method | Description |
---|---|---|
Object |
addHighlight |
Adds a highlight to the view. |
void |
changeHighlight |
Changes the given highlight to span a different portion of the document. |
void |
deinstall |
Called when the UI is being removed from the interface of a JTextComponent. |
Highlighter.Highlight[] |
getHighlights() |
Fetches the current list of highlights. |
void |
install |
Called when the UI is being installed into the interface of a JTextComponent. |
void |
paint |
Renders the highlights. |
void |
removeAllHighlights() |
Removes all highlights this highlighter is responsible for. |
void |
removeHighlight |
Removes a highlight from the view. |
void install(JTextComponent c)
c
- the JTextComponent editorvoid deinstall(JTextComponent c)
c
- the JTextComponent editorvoid paint(Graphics g)
g
- the graphics context.Object addHighlight(int p0, int p1, Highlighter.HighlightPainter p) throws BadLocationException
p0
- the beginning of the range >= 0p1
- the end of the range >= p0p
- the painter to use for the actual highlightingBadLocationException
- for an invalid range specificationvoid removeHighlight(Object tag)
tag
- which highlight to removevoid removeAllHighlights()
void changeHighlight(Object tag, int p0, int p1) throws BadLocationException
tag
- which highlight to changep0
- the beginning of the range >= 0p1
- the end of the range >= p0BadLocationException
- for an invalid range specificationHighlighter.Highlight[] getHighlights()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/Highlighter.html