proper.gui.core.text
Class JTextComponentHelper

java.lang.Object
  extended by proper.gui.core.text.JTextComponentHelper

public class JTextComponentHelper
extends java.lang.Object

A helper class for JTextComponents, e.g. highlighting of patterns in the text.
The source was adapted from here.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
JTextComponentHelper(javax.swing.text.JTextComponent textComponent)
          initializes the helper
 
Method Summary
static void highlight(javax.swing.text.JTextComponent textComp, java.lang.String pattern)
          Creates highlights around all occurrences of pattern in textComp
 void highlight(java.lang.String pattern)
          Creates highlights around all occurrences of pattern
 void removeHighlights()
          Removes only our private highlights
static void removeHighlights(javax.swing.text.JTextComponent textComp)
          Removes only our private highlights
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTextComponentHelper

public JTextComponentHelper(javax.swing.text.JTextComponent textComponent)
initializes the helper

Method Detail

highlight

public void highlight(java.lang.String pattern)
Creates highlights around all occurrences of pattern


highlight

public static void highlight(javax.swing.text.JTextComponent textComp,
                             java.lang.String pattern)
Creates highlights around all occurrences of pattern in textComp


removeHighlights

public void removeHighlights()
Removes only our private highlights


removeHighlights

public static void removeHighlights(javax.swing.text.JTextComponent textComp)
Removes only our private highlights