public class DisplayElementRegistry
extends java.lang.Object
static methods that are used to
dynamically link widgets to the types of data that they can display.| Constructor and Description |
|---|
DisplayElementRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<java.lang.Class<? extends StaticWidget>> |
getStaticWidgets()
Returns all the
StaticWidgets that are registered. |
static java.util.Set<java.lang.Class<? extends Widget>> |
getWidgetsForType(DataType type)
Returns all the widgets which support a given type.
|
static void |
registerStaticWidget(java.lang.Class<? extends StaticWidget> clazz)
Adds the new
StaticWidget to the registry. |
static void |
registerWidget(java.lang.Class<? extends Widget> clazz)
Adds the new
Widget to the registry. |
static boolean |
supportsType(java.lang.Class<? extends Widget> clazz,
DataType type)
Returns whether a
Widget of the given class can handle an element
of the given type. |
public static void registerStaticWidget(java.lang.Class<? extends StaticWidget> clazz)
StaticWidget to the registry.clazz - the class of the StaticWidget. If it is an abstract
class, then it will be ignored.public static void registerWidget(java.lang.Class<? extends Widget> clazz)
Widget to the registry. There are plenty of
requirements that a Widget must satisfy, because the
DisplayElementRegistry relies heavily on reflection in order to
simplify code for an extension developer. Make sure to look at what will
cause a RuntimeExceptionclazz - the class of the Widget. If it is an abstract class,
then it will be ignored.java.lang.RuntimeException - there are several ways that this will be thrown.
DataType
public static java.util.Set<java.lang.Class<? extends Widget>> getWidgetsForType(DataType type)
type - the type to supportpublic static java.util.Set<java.lang.Class<? extends StaticWidget>> getStaticWidgets()
StaticWidgets that are registered.