Class RadianceThemingWidgetRepository
- java.lang.Object
-
- org.pushingpixels.radiance.theming.internal.RadianceThemingWidgetRepository
-
public class RadianceThemingWidgetRepository extends java.lang.Object
Repository of Radiance look-and-feel widgets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RadianceThemingWidgetRepository.WidgetClassInfo
Information on a single class.
-
Field Summary
Fields Modifier and Type Field Description private static RadianceThemingWidgetRepository
repository
Singleton instance.private java.util.Set<java.lang.String>
widgetClassesToIgnore
Contains fully qualified class names of widgets that should not be installed on any components.private java.util.Map<java.lang.Class<?>,java.util.Set<RadianceThemingWidgetRepository.WidgetClassInfo>>
widgets
All registered widgets.
-
Constructor Summary
Constructors Modifier Constructor Description private
RadianceThemingWidgetRepository()
Creates a new repository.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToIgnoreWidgets(java.lang.String widgetClassName)
Marks widget with the specified class name to never be installed on any components.<T extends javax.swing.JComponent>
java.util.Set<RadianceThemingWidget<T>>getMatchingWidgets(T jcomp)
Returns a set of widgets that match the specified component.static RadianceThemingWidgetRepository
getRepository()
Returns the widget repository.void
registerWidget(java.lang.String widgetClassName, java.lang.Class<?> supportedClass, boolean isExact)
Registers a new widget for the specified UI class.void
registerWidget(java.lang.String widgetClassName, java.util.List<java.lang.Class<?>> supportedClasses)
Registers a new widget for the specified UI classes.
-
-
-
Field Detail
-
widgets
private java.util.Map<java.lang.Class<?>,java.util.Set<RadianceThemingWidgetRepository.WidgetClassInfo>> widgets
All registered widgets. Key isClass
in the UI component hierarchy, value is aSet
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.
-
repository
private static RadianceThemingWidgetRepository repository
Singleton instance.
-
-
Method Detail
-
getRepository
public static RadianceThemingWidgetRepository getRepository()
Returns the widget repository.- Returns:
- Widget repository.
-
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 containClass
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
- iftrue
, the widget will be available only for the components of the specified class. Iffalse
, the widget be available for the components of the specified class and all its descendants (as defined in theClass.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.
-
-