public final class SearchPatternController extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SearchPatternController.Option
Options of search patterns.
|
Modifier and Type | Field and Description |
---|---|
protected T |
component |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds a
ChangeListener to the listener list. |
void |
bind(SearchPatternController.Option option,
AbstractButton button)
Bind an abstract button (usually checkbox) to a SearchPattern option.
|
void |
bindMatchTypeComboBox(JComboBox comboBox)
Bind Match Type option to a combo box.
|
protected void |
fireChange()
Fires a change event to all registered listeners.
|
T |
getComponent() |
SearchPattern |
getSearchPattern()
Get search pattern currently represented by this controller.
|
boolean |
hasListeners()
Checks if there are any listeners registered to this
ChangeSupport . |
void |
removeChangeListener(ChangeListener listener)
Removes a
ChangeListener from the listener list. |
void |
setSearchPattern(SearchPattern searchPattern)
Set text and options to represent a search pattern.
|
void |
unbind(SearchPatternController.Option option,
AbstractButton button)
Unbind a button from a SearchPattern option.
|
protected T extends JComponent component
@NonNull public SearchPattern getSearchPattern()
public void setSearchPattern(@NonNull SearchPattern searchPattern)
public void bind(@NonNull SearchPatternController.Option option, @NonNull AbstractButton button)
option
- Option whose value the button should represent.button
- Button to control and display the option.public void bindMatchTypeComboBox(@NonNull JComboBox comboBox)
comboBox
- Combo box to control and display the match type. The
model of the combo box can contain only items of type SearchPattern.MatchType
.
SearchPattern.MatchType.LITERAL
and SearchPattern.MatchType.REGEXP
are mandatory in
the model.public void unbind(@NonNull SearchPatternController.Option option, @NonNull AbstractButton button)
public final T getComponent()
public final void addChangeListener(@NonNull ChangeListener listener)
ChangeListener
to the listener list. The same listener
object may be added more than once, and will be called as many times as
it is added. If
listener
is null, no exception is thrown and no action is
taken.listener
- the
ChangeListener
to be added.public final void removeChangeListener(@NonNull ChangeListener listener)
ChangeListener
from the listener list. If
listener
was added more than once, it will be notified one
less time after being removed. If
listener
is null, or was never added, no exception is thrown
and no action is taken.listener
- the
ChangeListener
to be removed.protected final void fireChange()
public final boolean hasListeners()
ChangeSupport
.Built on June 4 2024. | Copyright © 2017-2024 Apache Software Foundation. All Rights Reserved.