Package jsyntaxpane.components
Class TokenMarker
java.lang.Object
jsyntaxpane.components.TokenMarker
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,CaretListener
,SyntaxComponent
public class TokenMarker
extends Object
implements SyntaxComponent, CaretListener, PropertyChangeListener
This class highlights Tokens within a document whenever the caret is moved
to a TokenType provided in the config file.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jsyntaxpane.components.SyntaxComponent
SyntaxComponent.Status
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
config
(Configuration config) Configure the component using the given properties.void
deinstall
(JEditorPane editor) Called when the component is to be removed from the editorvoid
install
(JEditorPane editor) Called to install the component on an editorvoid
markTokenAt
(int pos) void
void
removes all markers from the pane.
-
Field Details
-
DEFAULT_TOKENTYPES
- See Also:
-
PROPERTY_COLOR
- See Also:
-
PROPERTY_TOKENTYPES
- See Also:
-
-
Constructor Details
-
TokenMarker
public TokenMarker()Constructs a new Token highlighter
-
-
Method Details
-
caretUpdate
- Specified by:
caretUpdate
in interfaceCaretListener
-
markTokenAt
public void markTokenAt(int pos) -
removeMarkers
public void removeMarkers()removes all markers from the pane. -
config
Description copied from interface:SyntaxComponent
Configure the component using the given properties. The keys needed for configuration will be prefixed by the given prefix- Specified by:
config
in interfaceSyntaxComponent
- Parameters:
config
- configuration data
-
install
Description copied from interface:SyntaxComponent
Called to install the component on an editor- Specified by:
install
in interfaceSyntaxComponent
- Parameters:
editor
-
-
deinstall
Description copied from interface:SyntaxComponent
Called when the component is to be removed from the editor- Specified by:
deinstall
in interfaceSyntaxComponent
- Parameters:
editor
-
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-