public class HighlightingUtils
extends java.lang.Object
Constructor and Description |
---|
HighlightingUtils()
Constructor method for i18n purposes only.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getHighlightHTML(java.lang.String text)
Convenience to highlight text using HTML tags.
|
static void |
reset(java.awt.Component comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetAllComponents(java.util.Vector<java.awt.Component> comps,
java.lang.String pattern)
Resets the set of GUI components highlighting search results.
|
static void |
resetCheckBox(javax.swing.JCheckBox comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetComboBox(javax.swing.JComboBox comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetLabel(javax.swing.JLabel comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetRadioButton(javax.swing.JRadioButton comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetTabbedPane(javax.swing.JTabbedPane comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetTable(javax.swing.JTable comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetTextField(javax.swing.JTextField comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetTitledBorder(java.awt.Component comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static void |
resetToggleButton(javax.swing.JToggleButton comp,
java.lang.String pattern)
Resets the component so that it does not highlight the results any longer.
|
static boolean |
search(java.awt.Component comp,
java.lang.String pattern)
Searches an arbitrary component for the given pattern.
|
static void |
searchAllComponents(java.util.Vector<java.awt.Component> comps,
java.lang.String pattern)
Searches the children of the given GUI component for pattern matches and highlights them.
|
static boolean |
searchCheckBox(javax.swing.JCheckBox comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchComboBox(javax.swing.JComboBox comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchLabel(javax.swing.JLabel comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchRadioButton(javax.swing.JRadioButton comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchTabbedPane(javax.swing.JTabbedPane comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchTable(javax.swing.JTable comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchText(java.lang.String text,
java.awt.Component comp,
java.lang.String pattern)
Searches a component's text for the given pattern (convenience for text components).
|
static boolean |
searchTextField(javax.swing.JTextField comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchTitledBorder(java.awt.Component comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
static boolean |
searchToggleButton(javax.swing.JToggleButton comp,
java.lang.String pattern)
Searches a component for the given pattern.
|
public HighlightingUtils() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic static void searchAllComponents(java.util.Vector<java.awt.Component> comps, java.lang.String pattern)
type
is null
, all components are collected.
comps
- Container with components, non-matching components are removedpattern
- The search patternjava.lang.NullPointerException
- If a parameter is null
resetAllComponents(java.util.Vector, String)
public static void resetAllComponents(java.util.Vector<java.awt.Component> comps, java.lang.String pattern)
comps
- Container with matching components to be resetpattern
- The search patternjava.lang.NullPointerException
- If a parameter is null
searchAllComponents(Vector, String)
public static boolean search(java.awt.Component comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.IllegalArgumentException
- If the component is not currently supportedpublic static boolean searchText(java.lang.String text, java.awt.Component comp, java.lang.String pattern)
text
- The component textcomp
- The component to be highlightedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchCheckBox(javax.swing.JCheckBox comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchLabel(javax.swing.JLabel comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchRadioButton(javax.swing.JRadioButton comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchToggleButton(javax.swing.JToggleButton comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchTextField(javax.swing.JTextField comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchComboBox(javax.swing.JComboBox comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchTable(javax.swing.JTable comp, java.lang.String pattern)
HighlightingRenderer
.
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchTabbedPane(javax.swing.JTabbedPane comp, java.lang.String pattern)
comp
- The component to be searchedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static boolean searchTitledBorder(java.awt.Component comp, java.lang.String pattern)
TitledBorder
isn't really a component but still helpful to be highlighted
if the text matches.
comp
- The component to be highlightedpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void reset(java.awt.Component comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.IllegalArgumentException
- If the component is not currently supportedjava.lang.NullPointerException
- If parameters are null
public static void resetCheckBox(javax.swing.JCheckBox comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetLabel(javax.swing.JLabel comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetRadioButton(javax.swing.JRadioButton comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetToggleButton(javax.swing.JToggleButton comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetTextField(javax.swing.JTextField comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetComboBox(javax.swing.JComboBox comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetTable(javax.swing.JTable comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetTabbedPane(javax.swing.JTabbedPane comp, java.lang.String pattern)
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static void resetTitledBorder(java.awt.Component comp, java.lang.String pattern)
TitledBorder
isn't really a component but still helpful to be highlighted
if the text matches.
comp
- The component to be resetpattern
- The search patternjava.lang.NullPointerException
- If parameters are null
public static java.lang.String getHighlightHTML(java.lang.String text)
text
- The plain text, filtered for HTML tags beforejava.lang.NullPointerException
- If parameters are null
Copyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.