Package org.apache.ofbiz.widget.model
Class ModelWidget
- java.lang.Object
-
- org.apache.ofbiz.widget.model.ModelWidget
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ModelForm
,ModelMenu
,ModelMenuItem
,ModelScreen
,ModelScreenWidget
,ModelScreenWidget.Column
,ModelTree
,ModelTree.ModelNode
,ModelTree.ModelNode.ModelSubNode
public abstract 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
Fields Modifier and Type Field Description static java.lang.String
enableBoundaryCommentsParam
The parameter name used to control widget boundary comments.static java.lang.String
module
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelWidget(java.lang.String name)
Derived classes must call this constructor.protected
ModelWidget(org.w3c.dom.Element widgetElement)
Derived classes must call this constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
accept(ModelWidgetVisitor visitor)
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
getStartColumn()
Returns the column where this widget was defined, in it's containing xml file.int
getStartLine()
Returns the line where this widget was defined, in it's containing xml file.java.lang.String
getSystemId()
Returns the url as a string, from where this widget was defined.java.lang.String
toString()
static boolean
widgetBoundaryCommentsEnabled(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Returnstrue
if widget boundary comments are enabled.
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
enableBoundaryCommentsParam
public static final java.lang.String enableBoundaryCommentsParam
The parameter name used to control widget boundary comments. Currently set to "widgetVerbose".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModelWidget
protected ModelWidget(java.lang.String name)
Derived classes must call this constructor.- Parameters:
name
- The widget name
-
ModelWidget
protected ModelWidget(org.w3c.dom.Element widgetElement)
Derived classes must call this constructor.- Parameters:
widgetElement
- The XML Element for the widget
-
-
Method Detail
-
accept
public abstract void accept(ModelWidgetVisitor visitor) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getName
public java.lang.String getName()
Returns the widget's name.- Returns:
- Widget's name
-
getSystemId
public java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
-
widgetBoundaryCommentsEnabled
public static boolean widgetBoundaryCommentsEnabled(java.util.Map<java.lang.String,? extends java.lang.Object> context)
Returnstrue
if widget boundary comments are enabled. Widget boundary comments are enabled by settingwidget.verbose=true
in thewidget.properties
file. Thetrue
setting can be overridden inweb.xml
or in the screen rendering context. Ifwidget.verbose
is set tofalse
in thewidget.properties
file, then that setting will override all other settings and disable all widget boundary comments.- Parameters:
context
- Optional context Map
-
-