org.ofbiz.widget
Class ModelWidget

java.lang.Object
  extended by org.ofbiz.widget.ModelWidget
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ModelForm, ModelMenu, ModelScreen, ModelScreenWidget, ModelTree

public class ModelWidget
extends java.lang.Object
implements java.io.Serializable

Widget Library - Widget model class. ModelWidget is a base class that is extended by other widget model classes.

See Also:
Serialized Form

Field Summary
static java.lang.String enableBoundaryCommentsParam
          The parameter name used to control widget boundary comments.
protected  boolean enableWidgetBoundaryComments
           
protected  java.lang.String name
           
 
Constructor Summary
protected ModelWidget()
           
  ModelWidget(org.w3c.dom.Element widgetElement)
          Derived classes must call this constructor.
 
Method Summary
 boolean boundaryCommentsEnabled()
          Returns true if boundary comments are enabled for this widget, otherwise returns false.
 java.lang.String getBoundaryCommentName()
          Returns the widget's name to be used in boundary comments.
 java.lang.String getName()
          Returns the widget's name.
 int getPaginatorNumber(java.util.Map<java.lang.String,java.lang.Object> context)
           
 void incrementPaginatorNumber(java.util.Map<java.lang.String,java.lang.Object> context)
           
 void setWidgetBoundaryComments(java.util.Map<java.lang.String,java.lang.Object> context)
          Enables/disables boundary comments for this widget.
static boolean widgetBoundaryCommentsEnabled(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
          Returns true if widget boundary comments are enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enableBoundaryCommentsParam

public static final java.lang.String enableBoundaryCommentsParam
The parameter name used to control widget boundary comments. Currently set to "widgetVerbose". Set the parameter to "true" to enable widget boundary comments.

WEB-INF/web.xml example:

<context-param>
  <param-name>widgetVerbose</param-name>
  <param-value>true</param-value>
</context-param>


Screen widget example:

<actions>
  <set field="parameters.widgetVerbose" value="true" global="true"/>
</actions>

See Also:
Constant Field Values

name

protected java.lang.String name

enableWidgetBoundaryComments

protected boolean enableWidgetBoundaryComments
Constructor Detail

ModelWidget

protected ModelWidget()

ModelWidget

public ModelWidget(org.w3c.dom.Element widgetElement)
Derived classes must call this constructor.

Parameters:
widgetElement - The XML Element for the widget
Method Detail

getName

public java.lang.String getName()
Returns the widget's name.

Returns:
Widget's name

getBoundaryCommentName

public java.lang.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

boundaryCommentsEnabled

public boolean boundaryCommentsEnabled()
Returns true if boundary comments are enabled for this widget, otherwise returns false.

Returns:
True if boundary comments are enabled for this widget

setWidgetBoundaryComments

public void setWidgetBoundaryComments(java.util.Map<java.lang.String,java.lang.Object> context)
Enables/disables boundary comments for this widget.

Parameters:
context - The screen rendering context

widgetBoundaryCommentsEnabled

public static boolean widgetBoundaryCommentsEnabled(java.util.Map<java.lang.String,? extends java.lang.Object> parameters)
Returns true if widget boundary comments are enabled. Widget boundary comments are enabled by setting widgetVerbose true in the parameters Map, or by setting widget.verbose=true in widget.properties.

Parameters:
parameters - Optional parameters Map

getPaginatorNumber

public int getPaginatorNumber(java.util.Map<java.lang.String,java.lang.Object> context)

incrementPaginatorNumber

public void incrementPaginatorNumber(java.util.Map<java.lang.String,java.lang.Object> context)