Package jsyntaxpane.components
Class TokenMarker
- java.lang.Object
-
- jsyntaxpane.components.TokenMarker
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,javax.swing.event.CaretListener
,SyntaxComponent
public class TokenMarker extends java.lang.Object implements SyntaxComponent, javax.swing.event.CaretListener, java.beans.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 Modifier and Type Field Description static java.lang.String
DEFAULT_TOKENTYPES
static java.lang.String
PROPERTY_COLOR
static java.lang.String
PROPERTY_TOKENTYPES
-
Constructor Summary
Constructors Constructor Description TokenMarker()
Constructs a new Token highlighter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
caretUpdate(javax.swing.event.CaretEvent e)
void
config(Configuration config)
Configure the component using the given properties.void
deinstall(javax.swing.JEditorPane editor)
Called when the component is to be removed from the editorvoid
install(javax.swing.JEditorPane editor)
Called to install the component on an editorvoid
markTokenAt(int pos)
void
propertyChange(java.beans.PropertyChangeEvent evt)
void
removeMarkers()
removes all markers from the pane.
-
-
-
Field Detail
-
DEFAULT_TOKENTYPES
public static final java.lang.String DEFAULT_TOKENTYPES
- See Also:
- Constant Field Values
-
PROPERTY_COLOR
public static final java.lang.String PROPERTY_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_TOKENTYPES
public static final java.lang.String PROPERTY_TOKENTYPES
- See Also:
- Constant Field Values
-
-
Method Detail
-
caretUpdate
public void caretUpdate(javax.swing.event.CaretEvent e)
- Specified by:
caretUpdate
in interfacejavax.swing.event.CaretListener
-
markTokenAt
public void markTokenAt(int pos)
-
removeMarkers
public void removeMarkers()
removes all markers from the pane.
-
config
public void config(Configuration 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
public void install(javax.swing.JEditorPane editor)
Description copied from interface:SyntaxComponent
Called to install the component on an editor- Specified by:
install
in interfaceSyntaxComponent
-
deinstall
public void deinstall(javax.swing.JEditorPane editor)
Description copied from interface:SyntaxComponent
Called when the component is to be removed from the editor- Specified by:
deinstall
in interfaceSyntaxComponent
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-