|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXPanel
org.jdesktop.swingx.AbstractPatternPanel
org.jdesktop.swingx.JXSearchPanel
public class JXSearchPanel
JXSearchPanel
provides complex searching features. Users are able to
specify searching rules, enter searching text (including regular
expressions), and toggle case-sensitivity.
One of the main features that JXSearchPanel
provides is the ability
to update PatternMatcher
s. To highlight text with a
Highlighter
, you need to update the highlighter via a pattern
matcher.
public class PatternHandler implements PatternMatcher { private Highlighter highlighter; private Pattern pattern; public void setPattern(Pattern pattern) { this.pattern = pattern; highlighter.setHighlightPredicate(new PatternPredicate(pattern)); } }
TODO: allow custom PatternModel and/or access to configuration of bound PatternModel.
TODO: fully support control of multiple PatternMatchers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
MATCH_RULE_ACTION_COMMAND
The action command key. |
Fields inherited from class org.jdesktop.swingx.AbstractPatternPanel |
---|
MATCH_ACTION_COMMAND, matchCheck, patternModel, SEARCH_FIELD_LABEL, SEARCH_FIELD_MNEMONIC, SEARCH_TITLE, searchField, searchLabel |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JXSearchPanel()
Creates a search panel. |
Method Summary | |
---|---|
void |
addPatternMatcher(PatternMatcher matcher)
Adds a pattern matcher. |
protected void |
bind()
bind the components to the patternModel/actions. |
String |
getFieldName()
returns the label of the search combo. |
Pattern |
getPattern()
returns the current compiled Pattern. |
protected void |
initComponents()
create contained components. |
protected void |
initExecutables()
creates and registers all "executable" actions. |
void |
match()
Updates the pattern matchers. |
void |
setFieldName(String name)
set the label of the search combo. |
protected void |
updateFieldName(PatternMatcher matcher)
|
void |
updateMatchRule()
set's the PatternModel's MatchRule to the selected in combo. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MATCH_RULE_ACTION_COMMAND
Constructor Detail |
---|
public JXSearchPanel()
Method Detail |
---|
public void addPatternMatcher(PatternMatcher matcher)
matcher
- the matcher to add.public void setFieldName(String name)
name
- the labelpublic String getFieldName()
public Pattern getPattern()
Pattern
protected void updateFieldName(PatternMatcher matcher)
matcher
- public void match()
match
in class AbstractPatternPanel
public void updateMatchRule()
protected void initExecutables()
AbstractPatternPanel
initExecutables
in class AbstractPatternPanel
protected void bind()
bind
in class AbstractPatternPanel
protected void initComponents()
initComponents
in class AbstractPatternPanel
|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |