Class TextUIWrapper<UI extends TextUI>

    • Constructor Detail

      • TextUIWrapper

        protected TextUIWrapper​(Class<UI> wrapperClass)
    • Method Detail

      • 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(TextUI), 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:
        textUI -
        Returns:
        the wrapping UI
      • getWrapperClass

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