UI
- public abstract class TextUIWrapper<UI extends TextUI> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TextUIWrapper.DefaultWrapper |
private class |
TextUIWrapper.TextUIChangeHandler |
Modifier and Type | Field and Description |
---|---|
private static TextUIWrapper.DefaultWrapper |
defaultWrapper |
private TextUIWrapper.TextUIChangeHandler |
uiChangeHandler |
private Class<UI> |
wrapperClass |
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 . |
private static final TextUIWrapper.DefaultWrapper defaultWrapper
private Class<UI extends TextUI> wrapperClass
private final TextUIWrapper.TextUIChangeHandler uiChangeHandler
protected TextUIWrapper(Class<UI> wrapperClass)
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
- WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses