UI - public abstract class TextUIWrapper<UI extends TextUI> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TextUIWrapper.DefaultWrapper |
| Modifier | Constructor and Description |
|---|---|
protected |
TextUIWrapper(Class<UI> wrapperClass) |
| Modifier and Type | Method and Description |
|---|---|
static TextUIWrapper<? extends PromptTextUI> |
getDefaultWrapper() |
Class<UI> |
getWrapperClass()
Returns the wrapper class.
|
void |
install(JTextComponent textComponent,
boolean stayOnUIChange)
Wraps and replaces the current UI of the given
textComponent, by calling
wrapUI(JTextComponent) if necessary. |
protected boolean |
replaceUIIfNeeded(JTextComponent textComponent)
Wraps and replaces the text components current UI by calling
#wrapUI(TextUI), if the
text components current UI is not an instance of the given wrapper class. |
void |
uninstall(JTextComponent textComponent)
Removes the
PropertyChangeListener, which listens for "UI" property changes (if
installed) and then calls JComponent.updateUI() on the textComponent to
set the UI object provided by the current UIDefaults. |
abstract UI |
wrapUI(JTextComponent textComponent)
Override to return the appropriate UI wrapper object for the given
TextUI. |
public static final TextUIWrapper<? extends PromptTextUI> getDefaultWrapper()
public final void install(JTextComponent textComponent, boolean stayOnUIChange)
Wraps and replaces the current UI of the given textComponent, by calling
wrapUI(JTextComponent) if necessary.
textComponent - stayOnUIChange - if true, a PropertyChangeListener is registered, which
listens for UI changes and wraps any new UI object.protected boolean replaceUIIfNeeded(JTextComponent textComponent)
#wrapUI(TextUI), if the
text components current UI is not an instance of the given wrapper class.textComponent - true if the UI has been replacedpublic abstract UI wrapUI(JTextComponent textComponent)
TextUI.textUI - public Class<UI> getWrapperClass()
public final void uninstall(JTextComponent textComponent)
Removes the PropertyChangeListener, which listens for "UI" property changes (if
installed) and then calls JComponent.updateUI() on the textComponent to
set the UI object provided by the current UIDefaults.
textComponent - Copyright © 2017. All Rights Reserved.