Class RadianceThemingWidgetRepository


  • public class RadianceThemingWidgetRepository
    extends java.lang.Object
    Repository of Radiance look-and-feel widgets.
    • Field Detail

      • widgets

        private java.util.Map<java.lang.Class<?>,​java.util.Set<RadianceThemingWidgetRepository.WidgetClassInfo>> widgets
        All registered widgets. Key is Class in the UI component hierarchy, value is a Set of fully-qualified widget class names.
      • widgetClassesToIgnore

        private java.util.Set<java.lang.String> widgetClassesToIgnore
        Contains fully qualified class names of widgets that should not be installed on any components.
    • Constructor Detail

      • RadianceThemingWidgetRepository

        private RadianceThemingWidgetRepository()
        Creates a new repository. Marked private to enforce single instance.
    • Method Detail

      • registerWidget

        public void registerWidget​(java.lang.String widgetClassName,
                                   java.util.List<java.lang.Class<?>> supportedClasses)
        Registers a new widget for the specified UI classes. The list should contain Class instances.
        Parameters:
        widgetClassName - Full-qualified class name for the widget.
        supportedClasses - Classes supported by the widget.
      • registerWidget

        public void registerWidget​(java.lang.String widgetClassName,
                                   java.lang.Class<?> supportedClass,
                                   boolean isExact)
        Registers a new widget for the specified UI class.
        Parameters:
        widgetClassName - Full-qualified class name for the widget.
        supportedClass - Class supported by the widget.
        isExact - if true, the widget will be available only for the components of the specified class. If false, the widget be available for the components of the specified class and all its descendants (as defined in the Class.isAssignableFrom(Class) ).
      • getMatchingWidgets

        public <T extends javax.swing.JComponent> java.util.Set<RadianceThemingWidget<T>> getMatchingWidgets​(T jcomp)
        Returns a set of widgets that match the specified component. The component hierarchy is scanned bottom-up and all matching widget classes are used to instantiate new instance of widgets.
        Parameters:
        jcomp - UI component.
        Returns:
        Set of widgets that match the specified component.
      • addToIgnoreWidgets

        public void addToIgnoreWidgets​(java.lang.String widgetClassName)
        Marks widget with the specified class name to never be installed on any components.
        Parameters:
        widgetClassName - Fully qualified widget class name.