Class 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.
    • 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 editor
      void install​(javax.swing.JEditorPane editor)
      Called to install the component on an editor
      void markTokenAt​(int pos)  
      void propertyChange​(java.beans.PropertyChangeEvent evt)  
      void removeMarkers()
      removes all markers from the pane.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TokenMarker

        public TokenMarker()
        Constructs a new Token highlighter
    • Method Detail

      • caretUpdate

        public void caretUpdate​(javax.swing.event.CaretEvent e)
        Specified by:
        caretUpdate in interface javax.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 interface SyntaxComponent
        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 interface SyntaxComponent
      • 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 interface SyntaxComponent
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener