Class TextUIWrapper<UI extends TextUI>

java.lang.Object
org.jdesktop.swingx.plaf.TextUIWrapper<UI>
Direct Known Subclasses:
TextUIWrapper.DefaultWrapper

public abstract class TextUIWrapper<UI extends TextUI> extends Object
TODO: param UI
Author:
Peter Weishapl petw@gmx.net
  • Constructor Details

    • TextUIWrapper

      protected TextUIWrapper(Class<UI> wrapperClass)
  • Method Details

    • getDefaultWrapper

      public static final TextUIWrapper<? extends PromptTextUI> getDefaultWrapper()
    • install

      public final void install(JTextComponent textComponent, boolean stayOnUIChange)

      Wraps and replaces the current UI of the given textComponent, by calling wrapUI(JTextComponent) if necessary.

      Parameters:
      textComponent -
      stayOnUIChange - if true, a PropertyChangeListener is registered, which listens for UI changes and wraps any new UI object.
    • replaceUIIfNeeded

      protected boolean replaceUIIfNeeded(JTextComponent textComponent)
      Wraps and replaces the text components current UI by calling wrapUI(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

      public abstract UI wrapUI(JTextComponent textComponent)
      Override to return the appropriate UI wrapper object for the given TextUI.
      Parameters:
      textComponent -
      Returns:
      the wrapping UI
    • getWrapperClass

      public Class<UI> getWrapperClass()
      Returns the wrapper class.
      Returns:
      the wrapper class
    • uninstall

      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.

      Parameters:
      textComponent -