Class RadianceThemingWidgetRepository

java.lang.Object
org.pushingpixels.radiance.theming.internal.RadianceThemingWidgetRepository

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

  • Constructor Details

    • RadianceThemingWidgetRepository

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

    • getRepository

      public static RadianceThemingWidgetRepository getRepository()
      Returns the widget repository.
      Returns:
      Widget repository.
    • registerWidget

      public void registerWidget(String widgetClassName, List<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(String widgetClassName, 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 JComponent> 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(String widgetClassName)
      Marks widget with the specified class name to never be installed on any components.
      Parameters:
      widgetClassName - Fully qualified widget class name.