Class SearchFieldUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TextUI
org.jdesktop.swingx.plaf.PromptTextUI
org.jdesktop.swingx.plaf.PromptTextFieldUI
org.jdesktop.swingx.plaf.BuddyTextFieldUI
org.jdesktop.swingx.plaf.SearchFieldUI
The default
JXSearchField UI delegate.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class PromptTextUI
PromptTextUI.PainterHighlighter -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SearchFieldUI.Handlerstatic final Insetsprotected JXSearchFieldThe search field that we're a UI delegate for.Fields inherited from class BuddyTextFieldUI
layoutAndBorderFields inherited from class PromptTextUI
delegate, focusHandler, promptComponent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final JButtonConvienence method.private voidprotected BuddyLayoutAndBorderprivate SearchFieldUI.Handlerprotected IcongetNewIcon(Icon icon, String resKey) Convience method for only replacing icons if they have not been customized by the user.protected intReturns the number of pixels between the popup button and the clear (or search) button as specified in the default table by 'SearchField.popupOffset'.private booleanhasText()protected voidInitialize the search fields various properties based on the corresponding "SearchField.*" properties from defaults table.voidCallsinstallDefaults(), adds the search, clear and popup button to the search field and registers aPropertyChangeListeneradDocumentListenerand anActionListeneron the popup button.private booleanprivate booleanprivate voidprotected final JButtonConvienence method.protected final JButtonConvienence method.protected booleanvoidRemoves all installed listeners, the layout and resets the search field original border and removes all children.protected voidSets 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.booleanReturnstrueifJXSearchField.isUseSeperatePopupButton()istrueand a search popup menu has been set.Methods inherited from class BuddyTextFieldUI
getPreferredSize, paintMethods inherited from class PromptTextFieldUI
createPromptComponent, getPromptComponentMethods inherited from class PromptTextUI
contains, damageRange, damageRange, equals, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getEditorKit, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getRootView, getToolTipText, hashCode, modelToView, modelToView, paintPromptComponent, shouldPaintPrompt, toString, update, viewToModel, viewToModelMethods inherited from class TextUI
getToolTipText2D, modelToView2D, viewToModel2DMethods inherited from class ComponentUI
createUI, getBaselineResizeBehavior
-
Field Details
-
searchField
The search field that we're a UI delegate for. Initialized by theinstallUImethod, and reset to null byuninstallUI.- See Also:
-
handler
-
NO_INSETS
-
-
Constructor Details
-
SearchFieldUI
-
-
Method Details
-
getHandler
-
installUI
CallsinstallDefaults(), adds the search, clear and popup button to the search field and registers aPropertyChangeListeneradDocumentListenerand anActionListeneron the popup button.- Overrides:
installUIin classBuddyTextFieldUI
-
configureListeners
private void configureListeners() -
isNativeSearchField
private boolean isNativeSearchField() -
createBuddyLayoutAndBorder
- Overrides:
createBuddyLayoutAndBorderin classBuddyTextFieldUI
-
layoutButtons
private void layoutButtons() -
isMacLayoutStyle
private boolean isMacLayoutStyle() -
installDefaults
protected void installDefaults()Initialize the search fields various properties based on the corresponding "SearchField.*" properties from defaults table. TheJXSearchFields layout is set to the value returned bycreateLayout. Also callsandinvalid reference
#replaceBorderIfNecessary()updateButtons(). This method is called byinstallUI(JComponent).- See Also:
-
uninstallUI
Removes all installed listeners, the layout and resets the search field original border and removes all children.- Overrides:
uninstallUIin classBuddyTextFieldUI
-
shouldReplaceResource
- Parameters:
o- an object- Returns:
- true if
oisnullor of instanceUIResource
-
getNewIcon
Convience method for only replacing icons if they have not been customized by the user. Returns the icon from the defaults table belonging toresKey, ifshouldReplaceResource(Object)with theiconas a parameter returnstrue. Otherwise returnsicon.- Parameters:
icon- the current iconresKey- the resource key identifying the default icon- Returns:
- the new icon
-
clearButton
-
searchButton
-
popupButton
-
usingSeperatePopupButton
public boolean usingSeperatePopupButton()ReturnstrueifJXSearchField.isUseSeperatePopupButton()istrueand a search popup menu has been set.- Returns:
- the popup button is used in addition to the search button
-
getPopupOffset
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'. Returns 0 ifusingSeperatePopupButton()returnsfalse- Returns:
- number of pixels between the popup button and the clear (or search) button
-
updateButtons
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. Also resets the search buttons pressed and rollover icons if the search field is in regular search mode or clears the icons when the search field is in instant search mode. -
hasText
private boolean hasText()
-