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.StringDEFAULT_TOKENTYPESstatic java.lang.StringPROPERTY_COLORstatic java.lang.StringPROPERTY_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 voidcaretUpdate(javax.swing.event.CaretEvent e)voidconfig(Configuration config)Configure the component using the given properties.voiddeinstall(javax.swing.JEditorPane editor)Called when the component is to be removed from the editorvoidinstall(javax.swing.JEditorPane editor)Called to install the component on an editorvoidmarkTokenAt(int pos)voidpropertyChange(java.beans.PropertyChangeEvent evt)voidremoveMarkers()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:
caretUpdatein 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:SyntaxComponentConfigure the component using the given properties. The keys needed for configuration will be prefixed by the given prefix- Specified by:
configin interfaceSyntaxComponent- Parameters:
config- configuration data
-
install
public void install(javax.swing.JEditorPane editor)
Description copied from interface:SyntaxComponentCalled to install the component on an editor- Specified by:
installin interfaceSyntaxComponent
-
deinstall
public void deinstall(javax.swing.JEditorPane editor)
Description copied from interface:SyntaxComponentCalled when the component is to be removed from the editor- Specified by:
deinstallin interfaceSyntaxComponent
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
-