public class SearchFieldUI extends BuddyTextFieldUI
JXSearchField
UI delegate.Modifier and Type | Class and Description |
---|---|
(package private) class |
SearchFieldUI.Handler |
PromptTextUI.PainterHighlighter
Modifier and Type | Field and Description |
---|---|
private SearchFieldUI.Handler |
handler |
static Insets |
NO_INSETS |
protected JXSearchField |
searchField
The search field that we're a UI delegate for.
|
layoutAndBorder
delegate, focusHandler, promptComponent
Constructor and Description |
---|
SearchFieldUI(TextUI delegate) |
Modifier and Type | Method and Description |
---|---|
protected JButton |
clearButton()
Convienence method.
|
private void |
configureListeners() |
protected BuddyLayoutAndBorder |
createBuddyLayoutAndBorder() |
private SearchFieldUI.Handler |
getHandler() |
protected Icon |
getNewIcon(Icon icon,
String resKey)
Convience method for only replacing icons if they have not been
customized by the user.
|
protected int |
getPopupOffset()
Returns the number of pixels between the popup button and the clear (or
search) button as specified in the default table by
'SearchField.popupOffset'.
|
private boolean |
hasText() |
protected void |
installDefaults()
Initialize the search fields various properties based on the
corresponding "SearchField.*" properties from defaults table.
|
void |
installUI(JComponent c)
Calls
installDefaults() , adds the search, clear and popup button
to the search field and registers a PropertyChangeListener ad
DocumentListener and an ActionListener on the popup
button. |
private boolean |
isMacLayoutStyle() |
private boolean |
isNativeSearchField() |
private void |
layoutButtons() |
protected JButton |
popupButton()
Convienence method.
|
protected JButton |
searchButton()
Convienence method.
|
protected boolean |
shouldReplaceResource(Object o)
|
void |
uninstallUI(JComponent c)
Removes all installed listeners, the layout and resets the search field
original border and removes all children.
|
protected void |
updateButtons()
Sets the visibility of the search, clear and popup buttons depending on
the search mode, layout stye, search text, search popup menu and the use
of a seperate popup button.
|
boolean |
usingSeperatePopupButton()
Returns
true if
JXSearchField.isUseSeperatePopupButton() is true and
a search popup menu has been set. |
getPreferredSize, paint
createPromptComponent, getPromptComponent
contains, damageRange, damageRange, equals, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getEditorKit, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, hashCode, modelToView, modelToView, paintPromptComponent, shouldPaintPrompt, toString, update, viewToModel, viewToModel
createUI, getBaselineResizeBehavior
protected JXSearchField searchField
installUI
method, and reset to null by
uninstallUI
.private SearchFieldUI.Handler handler
public SearchFieldUI(TextUI delegate)
private SearchFieldUI.Handler getHandler()
public void installUI(JComponent c)
installDefaults()
, adds the search, clear and popup button
to the search field and registers a PropertyChangeListener
ad
DocumentListener
and an ActionListener
on the popup
button.installUI
in class BuddyTextFieldUI
private void configureListeners()
private boolean isNativeSearchField()
protected BuddyLayoutAndBorder createBuddyLayoutAndBorder()
createBuddyLayoutAndBorder
in class BuddyTextFieldUI
private void layoutButtons()
private boolean isMacLayoutStyle()
protected void installDefaults()
JXSearchField
s layout is set to the value returned by
createLayout
. Also calls #replaceBorderIfNecessary()
and updateButtons()
. This method is called by
installUI(JComponent)
.installUI(javax.swing.JComponent)
,
#createLayout
,
JXSearchField.customSetUIProperty(String, Object)
public void uninstallUI(JComponent c)
uninstallUI
in class BuddyTextFieldUI
protected boolean shouldReplaceResource(Object o)
o
- an objecto
is null
or of instance
UIResource
protected Icon getNewIcon(Icon icon, String resKey)
resKey
, if
shouldReplaceResource(Object)
with the icon
as a
parameter returns true
. Otherwise returns icon
.icon
- the current iconresKey
- the resource key identifying the default iconprotected final JButton clearButton()
JXSearchField.getCancelButton()
protected final JButton searchButton()
JXSearchField.getFindButton()
protected final JButton popupButton()
JXSearchField.getPopupButton()
public boolean usingSeperatePopupButton()
true
if
JXSearchField.isUseSeperatePopupButton()
is true
and
a search popup menu has been set.protected int getPopupOffset()
usingSeperatePopupButton()
returns false
protected void updateButtons()
private boolean hasText()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses