Class ModelWidget

java.lang.Object
org.apache.ofbiz.widget.model.ModelWidget
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ModelForm, ModelMenu, ModelMenuItem, ModelScreen, ModelScreenWidget, ModelScreenWidget.Column, ModelTree, ModelTree.ModelNode, ModelTree.ModelNode.ModelSubNode

public abstract class ModelWidget extends Object implements Serializable
Widget Library - Widget model class. ModelWidget is a base class that is extended by other widget model classes.
See Also:
  • Field Details

    • ENABLE_BOUNDARY_COMMENTS_PARAM

      public static final String ENABLE_BOUNDARY_COMMENTS_PARAM
      The parameter name used to control widget boundary comments. Currently set to "widgetVerbose".
      See Also:
  • Constructor Details

    • ModelWidget

      protected ModelWidget(String name)
      Derived classes must call this constructor.
      Parameters:
      name - The widget name
    • ModelWidget

      protected ModelWidget(Element widgetElement)
      Derived classes must call this constructor.
      Parameters:
      widgetElement - The XML Element for the widget
  • Method Details

    • accept

      public abstract void accept(ModelWidgetVisitor visitor) throws Exception
      Throws:
      Exception
    • getName

      public String getName()
      Returns the widget's name.
      Returns:
      Widget's name
    • getSystemId

      public String getSystemId()
      Returns the url as a string, from where this widget was defined.
      Returns:
      url
    • getStartColumn

      public int getStartColumn()
      Returns the column where this widget was defined, in it's containing xml file.
      Returns:
      start column
    • getStartLine

      public int getStartLine()
      Returns the line where this widget was defined, in it's containing xml file.
      Returns:
      start line
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBoundaryCommentName

      public String getBoundaryCommentName()
      Returns the widget's name to be used in boundary comments. The default action is to return the widget's name. Derived classes can override this method to return a customized name.
      Returns:
      Name to be used in boundary comments
    • widgetBoundaryCommentsEnabled

      public static boolean widgetBoundaryCommentsEnabled(Map<String,? extends Object> context)
      Returns true if widget boundary comments are enabled. Widget boundary comments are enabled by setting widget.verbose=true in the widget.properties file. The true setting can be overridden in web.xml or in the screen rendering context. If widget.verbose is set to false in the widget.properties file, then that setting will override all other settings and disable all widget boundary comments.
      Parameters:
      context - Optional context Map
    • widgetNamedBorderType

      public static ModelWidget.NamedBorderType widgetNamedBorderType()
      determine how to display named border for development
      Returns:
      NamedBorderType from widget.dev.namedBorder property