Class HtmlWidgetRenderer

java.lang.Object
org.apache.ofbiz.widget.renderer.html.HtmlWidgetRenderer
Direct Known Subclasses:
FoFormRenderer, HtmlMenuRenderer, HtmlTreeRenderer

public class HtmlWidgetRenderer extends Object
Widget Library - HTML Widget Renderer implementation. HtmlWidgetRenderer is a base class that is extended by other widget HTML rendering classes.
  • Field Details

    • WHITE_SPACE

      public static final String WHITE_SPACE
      Characters that are appended to the end of each rendered element. Currently set to CR/LF.
      See Also:
    • NAMED_BORDER_TYPE

      public static final ModelWidget.NamedBorderType NAMED_BORDER_TYPE
      Store property value of widget.dev.namedBorder
  • Constructor Details

    • HtmlWidgetRenderer

      public HtmlWidgetRenderer()
  • Method Details

    • setWidgetCommentsEnabled

      public void setWidgetCommentsEnabled(boolean widgetCommentsEnabled)
      Sets widget comments enabled.
      Parameters:
      widgetCommentsEnabled - the widget comments enabled
    • isWidgetCommentsEnabled

      public boolean isWidgetCommentsEnabled()
      Is widget comments enabled boolean.
      Returns:
      the boolean
    • appendWhitespace

      public void appendWhitespace(Appendable writer) throws IOException
      Helper method used to append whitespace characters to the end of each rendered element.
      Parameters:
      writer - The writer to write to
      Throws:
      IOException
    • buildBoundaryComment

      public static String buildBoundaryComment(String boundaryType, String widgetType, String widgetName)
      Helper method used to build the boundary comment string.
      Parameters:
      boundaryType - The boundary type: "Begin" or "End"
      widgetType - The widget type: "Screen Widget", "Form Widget", etc.
      widgetName - The widget name
    • beginNamedBorder

      public static String beginNamedBorder(String widgetType, String location, String contextPath)
      Always check the following condition is true before running the method: HtmlWidgetRenderer.namedBorderType != ModelWidget.NamedBorderType.NONE
      Parameters:
      widgetType -
      location -
      contextPath -
      Returns:
    • endNamedBorder

      public static String endNamedBorder(String widgetType, String location)
      Always check the following condition is true before running the method: HtmlWidgetRenderer.namedBorderType != ModelWidget.NamedBorderType.NONE
      Parameters:
      widgetType -
      location -
      Returns:
    • formatBoundaryJsComment

      public static String formatBoundaryJsComment(String boundaryType, String widgetType, String widgetName)
    • renderBeginningBoundaryComment

      public void renderBeginningBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget) throws IOException
      Renders the beginning boundary comment string.
      Parameters:
      writer - The writer to write to
      widgetType - The widget type: "Screen Widget", "Form Widget", etc.
      modelWidget - The widget
      Throws:
      IOException
    • renderEndingBoundaryComment

      public void renderEndingBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget) throws IOException
      Renders the ending boundary comment string.
      Parameters:
      writer - The writer to write to
      widgetType - The widget type: "Screen Widget", "Form Widget", etc.
      modelWidget - The widget
      Throws:
      IOException
    • getAjaxParamsFromTarget

      public static String getAjaxParamsFromTarget(String target)
      Extracts parameters from a target URL string, prepares them for an Ajax JavaScript call. This method is currently set to return a parameter string suitable for the Prototype.js library.
      Parameters:
      target - Target URL string
      Returns:
      Parameter string