Class WidgetFactory

java.lang.Object
org.apache.ofbiz.widget.WidgetFactory

public final class WidgetFactory extends Object
Screen widget factory.

Applications can add their own widget implementations to the factory by implementing the WidgetLoader interface.

  • Field Details

  • Method Details

    • getModelScreenWidget

      public static ModelScreenWidget getModelScreenWidget(ModelScreen modelScreen, Element element)
      Returns a ModelScreenWidget instance that implements the specified XML element.
      Parameters:
      modelScreen - The containing screen for the widget
      element - 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 an Element instance.

      Parameters:
      tagName - The XML element tag name for this widget
      widgetClass - The class that implements the widget element
      Throws:
      SecurityException
      NoSuchMethodException