Package jsyntaxpane.components
Class Markers
java.lang.Object
jsyntaxpane.components.Markers
This class contains static utility methods to make highliting in text
components easier.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
markAll
(JTextComponent pane, Pattern pattern, Markers.SimpleMarker marker) Mark all text in the document that matches the given patternstatic void
markText
(JTextComponent pane, int start, int end, Markers.SimpleMarker marker) add highlights for the given region on the given panestatic void
markToken
(JTextComponent pane, Token token, Markers.SimpleMarker marker) add highlights for the given Token on the given panestatic void
removeMarkers
(JTextComponent editorPane) Remove all the markers from an JEditorPanestatic void
removeMarkers
(JTextComponent component, Markers.SimpleMarker marker) Removes only our private highlights This is public so that we can remove the highlights when the editorKit is unregistered.
-
Constructor Details
-
Markers
public Markers()
-
-
Method Details
-
removeMarkers
Removes only our private highlights This is public so that we can remove the highlights when the editorKit is unregistered. SimpleMarker can be null, in which case all instances of our Markers are removed.- Parameters:
component
- the text component whose markers are to be removedmarker
- the SimpleMarker to remove
-
removeMarkers
Remove all the markers from an JEditorPane- Parameters:
editorPane
-
-
markToken
add highlights for the given Token on the given pane- Parameters:
pane
-token
-marker
-
-
markText
add highlights for the given region on the given pane- Parameters:
pane
-start
-end
-marker
-
-
markAll
Mark all text in the document that matches the given pattern- Parameters:
pane
- control to usepattern
- pattern to matchmarker
- marker to use for highlighting
-