Package org.apache.ofbiz.widget
Class WidgetFactory
java.lang.Object
org.apache.ofbiz.widget.WidgetFactory
Screen widget factory.
Applications can add their own widget implementations
to the factory by implementing the WidgetLoader
interface.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Map<String,
Constructor<? extends ModelScreenWidget>> -
Method Summary
Modifier and TypeMethodDescriptionstatic ModelScreenWidget
getModelScreenWidget
(ModelScreen modelScreen, Element element) Returns aModelScreenWidget
instance that implements the specified XML element.protected static void
Loads the standard OFBiz screen widgets.static void
registerScreenWidget
(String tagName, Class<? extends ModelScreenWidget> widgetClass) Registers a screen sub-widget with the factory.
-
Field Details
-
SCREEN_WIDGETS
-
-
Method Details
-
getModelScreenWidget
Returns aModelScreenWidget
instance that implements the specified XML element.- Parameters:
modelScreen
- The containing screen for the widgetelement
- The widget XML element- Returns:
- a
ModelScreenWidget
instance that implements the specified XML element - Throws:
IllegalArgumentException
-
loadStandardWidgets
protected static void loadStandardWidgets()Loads the standard OFBiz screen widgets. -
registerScreenWidget
public static void registerScreenWidget(String tagName, Class<? extends ModelScreenWidget> widgetClass) throws SecurityException, NoSuchMethodException Registers a screen sub-widget with the factory. If a tag name is already registered, the new widget replaces the existing one.The class supplied to the method must have a public two-argument constructor that takes a
ModelScreen
instance and anElement
instance.- Parameters:
tagName
- The XML element tag name for this widgetwidgetClass
- The class that implements the widget element- Throws:
SecurityException
NoSuchMethodException
-