Package org.jdesktop.swingx.plaf
Class TextUIWrapper.DefaultWrapper
java.lang.Object
org.jdesktop.swingx.plaf.TextUIWrapper<PromptTextUI>
org.jdesktop.swingx.plaf.TextUIWrapper.DefaultWrapper
- Enclosing class:
- TextUIWrapper<UI extends TextUI>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jdesktop.swingx.plaf.TextUIWrapper
TextUIWrapper.DefaultWrapper
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
replaceUIIfNeeded
(JTextComponent textComponent) Every time the UI needs to be replaced we also need to make sure, that all buddy components are also in the component hierarchy.wrapUI
(JTextComponent textComponent) Creates a newPromptTextUI
, which wraps the giventextComponent
s UI.Methods inherited from class org.jdesktop.swingx.plaf.TextUIWrapper
getDefaultWrapper, getWrapperClass, install, uninstall
-
Method Details
-
wrapUI
Creates a new
PromptTextUI
, which wraps the giventextComponent
s UI.If the UI is already of type
PromptTextUI
, it will be returned. IftextComponent
is of typeJXSearchField
a newSearchFieldUI
object will be returned. IftextComponent
is of typeJTextField
orJTextArea
aBuddyTextFieldUI
orPromptTextAreaUI
will be returned, respectively. If the UI is of any other type, aIllegalArgumentException
will be thrown.- Specified by:
wrapUI
in classTextUIWrapper<PromptTextUI>
- Parameters:
textComponent
- wrap this components UI- Returns:
- a
PromptTextUI
which wraps thetextComponent
s UI.
-
replaceUIIfNeeded
Every time the UI needs to be replaced we also need to make sure, that all buddy components are also in the component hierarchy. (That's becauseBasicTextUI
removes all our buddies upon UI changes).- Overrides:
replaceUIIfNeeded
in classTextUIWrapper<PromptTextUI>
- Returns:
true
if the UI has been replaced
-