Package org.jdesktop.swingx.plaf
Class TextUIWrapper<UI extends TextUI>
java.lang.Object
org.jdesktop.swingx.plaf.TextUIWrapper<UI>
- Direct Known Subclasses:
TextUIWrapper.DefaultWrapper
TODO:
param UI
- Author:
- Peter Weishapl petw@gmx.net
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final TextUIWrapper<? extends PromptTextUI>
Returns the wrapper class.final void
install
(JTextComponent textComponent, boolean stayOnUIChange) Wraps and replaces the current UI of the giventextComponent
, by callingwrapUI(JTextComponent)
if necessary.protected boolean
replaceUIIfNeeded
(JTextComponent textComponent) Wraps and replaces the text components current UI by callingwrapUI(JTextComponent)
, if the text components current UI is not an instance of the given wrapper class.final void
uninstall
(JTextComponent textComponent) Removes thePropertyChangeListener
, which listens for "UI" property changes (if installed) and then callsJComponent.updateUI()
on thetextComponent
to set the UI object provided by the currentUIDefaults
.abstract UI
wrapUI
(JTextComponent textComponent) Override to return the appropriate UI wrapper object for the givenTextUI
.
-
Constructor Details
-
TextUIWrapper
-
-
Method Details
-
getDefaultWrapper
-
install
Wraps and replaces the current UI of the given
textComponent
, by callingwrapUI(JTextComponent)
if necessary.- Parameters:
textComponent
-stayOnUIChange
- iftrue
, aPropertyChangeListener
is registered, which listens for UI changes and wraps any new UI object.
-
replaceUIIfNeeded
Wraps and replaces the text components current UI by callingwrapUI(JTextComponent)
, if the text components current UI is not an instance of the given wrapper class.- Parameters:
textComponent
-- Returns:
true
if the UI has been replaced
-
wrapUI
Override to return the appropriate UI wrapper object for the givenTextUI
.- Parameters:
textComponent
-- Returns:
- the wrapping UI
-
getWrapperClass
Returns the wrapper class.- Returns:
- the wrapper class
-
uninstall
Removes the
PropertyChangeListener
, which listens for "UI" property changes (if installed) and then callsJComponent.updateUI()
on thetextComponent
to set the UI object provided by the currentUIDefaults
.- Parameters:
textComponent
-
-