Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.forms.layout.api.impl
Class WidgetImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.forms.layout.api.impl.WidgetImpl
All Implemented Interfaces:
java.io.Serializable, Widget

public class WidgetImpl
extends java.lang.Object
implements Widget

Implementation for widgets.

Author:
Anahide Tchertchian
See Also:
Serialized Form

Constructor Summary
WidgetImpl(java.lang.String layoutName, java.lang.String name, java.lang.String mode, java.lang.String type, java.lang.String valueName, FieldDefinition[] fields, java.lang.String label, java.lang.String helpLabel, boolean translated, java.util.Map<java.lang.String,java.io.Serializable> properties, boolean required, Widget[] subWidgets, int level)
           
 
Method Summary
 FieldDefinition[] getFieldDefinitions()
          Returns the list of fields managed by this widget.
 java.lang.String getHelpLabel()
          Return the help label to use in this mode.
 java.lang.String getId()
          Returns the widget id, unique within the facelet context.
 java.lang.String getLabel()
          Returns the label to use in this mode.
 java.lang.String getLayoutName()
          Returns the layout name.
 int getLevel()
          Returns the widget level in the widget hierarchy.
 java.lang.String getMode()
          Returns the widget mode.
 java.lang.String getName()
          Returns the widget name used to identify it within a layout.
 java.util.Map<java.lang.String,java.io.Serializable> getProperties()
          Get properties to use in this mode.
 java.io.Serializable getProperty(java.lang.String name)
          Returns property with given name in this mode.
 Widget[] getSubWidgets()
          Returns sub widgets.
 java.lang.String getType()
          Returns the widget type used to render it.
 java.lang.String getValueName()
          Gets the value name used to compute tag attributes.
 boolean isRequired()
          Returns true if the widget is required.
 boolean isTranslated()
          Returns true if all labels are messages that need to be translated.
 void setId(java.lang.String id)
          Sets the widget id, unique within the facelet context.
 void setProperty(java.lang.String name, java.io.Serializable value)
          Sets property with given name on the layout.
 void setValueName(java.lang.String valueName)
          Sets the value name used to compute tag attributes.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WidgetImpl

public WidgetImpl(java.lang.String layoutName,
                  java.lang.String name,
                  java.lang.String mode,
                  java.lang.String type,
                  java.lang.String valueName,
                  FieldDefinition[] fields,
                  java.lang.String label,
                  java.lang.String helpLabel,
                  boolean translated,
                  java.util.Map<java.lang.String,java.io.Serializable> properties,
                  boolean required,
                  Widget[] subWidgets,
                  int level)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: Widget
Returns the widget id, unique within the facelet context.

Specified by:
getId in interface Widget

setId

public void setId(java.lang.String id)
Description copied from interface: Widget
Sets the widget id, unique within the facelet context.

Specified by:
setId in interface Widget

getLayoutName

public java.lang.String getLayoutName()
Description copied from interface: Widget
Returns the layout name.

Specified by:
getLayoutName in interface Widget

getName

public java.lang.String getName()
Description copied from interface: Widget
Returns the widget name used to identify it within a layout.

Specified by:
getName in interface Widget

getMode

public java.lang.String getMode()
Description copied from interface: Widget
Returns the widget mode.

This mode can be different from the layout mode.

Specified by:
getMode in interface Widget

getType

public java.lang.String getType()
Description copied from interface: Widget
Returns the widget type used to render it.

Specified by:
getType in interface Widget

getLabel

public java.lang.String getLabel()
Description copied from interface: Widget
Returns the label to use in this mode.

Specified by:
getLabel in interface Widget

getHelpLabel

public java.lang.String getHelpLabel()
Description copied from interface: Widget
Return the help label to use in this mode.

Specified by:
getHelpLabel in interface Widget

isTranslated

public boolean isTranslated()
Description copied from interface: Widget
Returns true if all labels are messages that need to be translated.

Specified by:
isTranslated in interface Widget

getProperties

public java.util.Map<java.lang.String,java.io.Serializable> getProperties()
Description copied from interface: Widget
Get properties to use in this mode.

The way that properties will be mapped to rendered components is managed by the widget type.

Specified by:
getProperties in interface Widget

getProperty

public java.io.Serializable getProperty(java.lang.String name)
Description copied from interface: Widget
Returns property with given name in this mode.

Specified by:
getProperty in interface Widget
Parameters:
name - the property name.
Returns:
the property value or null if not found.

setProperty

public void setProperty(java.lang.String name,
                        java.io.Serializable value)
Description copied from interface: Widget
Sets property with given name on the layout. If there is already a property with this name on the widget, it will be overridden.

Specified by:
setProperty in interface Widget
Parameters:
name - the property name.
value - the property value or null if not found.

isRequired

public boolean isRequired()
Description copied from interface: Widget
Returns true if the widget is required.

This is a short link for the "required" property, already evaluated from an EL expression (if needed). Defaults to false.

Specified by:
isRequired in interface Widget

getFieldDefinitions

public FieldDefinition[] getFieldDefinitions()
Description copied from interface: Widget
Returns the list of fields managed by this widget.

Specified by:
getFieldDefinitions in interface Widget

getSubWidgets

public Widget[] getSubWidgets()
Description copied from interface: Widget
Returns sub widgets.

Specified by:
getSubWidgets in interface Widget

getValueName

public java.lang.String getValueName()
Description copied from interface: Widget
Gets the value name used to compute tag attributes.

Specified by:
getValueName in interface Widget

setValueName

public void setValueName(java.lang.String valueName)
Description copied from interface: Widget
Sets the value name used to compute tag attributes.

Specified by:
setValueName in interface Widget

getLevel

public int getLevel()
Description copied from interface: Widget
Returns the widget level in the widget hierarchy.

For instance a standard widget will have a level of 0, and its potential subwidgets will have a level of 1.

Specified by:
getLevel in interface Widget

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.