public class WebLayoutManagerImpl extends AbstractLayoutManager implements WebLayoutManager
Modifier and Type | Field and Description |
---|---|
static String |
LAYOUT_TYPES_EP_NAME |
static String |
LAYOUTS_EP_NAME |
static ComponentName |
NAME |
static String |
PROPS_REF_EP_NAME |
static String |
WIDGET_TYPES_EP_NAME |
static String |
WIDGETS_EP_NAME |
JSF_CATEGORY
Constructor and Description |
---|
WebLayoutManagerImpl() |
Modifier and Type | Method and Description |
---|---|
Widget |
createWidget(javax.faces.view.facelets.FaceletContext ctx,
String type,
String mode,
String valueName,
List<FieldDefinition> fieldDefinitions,
String label,
String helpLabel,
Boolean translated,
Map<String,Serializable> properties,
Widget[] subWidgets)
Returns a widget computed from given information.
|
Widget |
createWidget(javax.faces.view.facelets.FaceletContext ctx,
String type,
String mode,
String valueName,
Map<String,Serializable> properties,
Widget[] subWidgets)
Returns a widget computed from given information.
|
Widget |
createWidget(javax.faces.view.facelets.FaceletContext ctx,
WidgetDefinition wDef,
String mode,
String valueName,
Widget[] subWidgets)
Returns a widget computed from given information.
|
String |
getDefaultStoreCategory()
Return the default category used for storage
|
javax.faces.view.facelets.FaceletHandler |
getFaceletHandler(javax.faces.view.facelets.FaceletContext ctx,
javax.faces.view.facelets.TagConfig config,
Widget widget)
Returns the facelet handler for given widget.
|
javax.faces.view.facelets.FaceletHandler |
getFaceletHandler(javax.faces.view.facelets.FaceletContext ctx,
javax.faces.view.facelets.TagConfig config,
Widget widget,
javax.faces.view.facelets.FaceletHandler nextHandler)
Returns the facelet handler for given widget.
|
Layout |
getLayout(javax.faces.view.facelets.FaceletContext ctx,
LayoutDefinition layoutDef,
String mode,
String valueName,
List<String> selectedRows,
boolean selectAllRowsByDefault)
Returns the computed layout for this definition, mode and list of selected rows in given context, or null if the
layout definition is null.
|
Layout |
getLayout(javax.faces.view.facelets.FaceletContext ctx,
String layoutName,
String mode,
String valueName)
Returns the computed layout for this name and mode in given context, or null if no layout with this name is
found.
|
Layout |
getLayout(javax.faces.view.facelets.FaceletContext ctx,
String layoutName,
String mode,
String valueName,
List<String> selectedRows,
boolean selectAllRowsByDefault)
Returns the computed layout for this name, mode and list of selected rows in given context, or null if no layout
with this name is found.
|
Layout |
getLayout(javax.faces.view.facelets.FaceletContext ctx,
String layoutName,
String layoutCategory,
String mode,
String valueName,
List<String> selectedRows,
boolean selectAllRowsByDefault)
Returns the computed layout for this name, category, mode and list of selected rows in given context, or null if
no layout with this name is found.
|
Widget |
getWidget(javax.faces.view.facelets.FaceletContext ctx,
String widgetName,
String widgetCategory,
String layoutMode,
String valueName,
String layoutName)
Returns a widget instance given a name and a category, as it would be computed when defined within a layout.
|
Widget |
getWidget(javax.faces.view.facelets.FaceletContext ctx,
WidgetDefinition wDef,
String layoutMode,
String valueName,
String layoutName)
Returns a widget instance given a name and a category, as it would be computed when defined within a layout.
|
WidgetTypeHandler |
getWidgetTypeHandler(String typeName)
Returns the widget type handler for the registered widget type with this type name.
|
WidgetTypeHandler |
getWidgetTypeHandler(String typeCategory,
String typeName)
Returns the widget type handler for the registered widget type with this type name and type category.
|
boolean |
referencePropertyAsExpression(String name,
Serializable value,
String widgetType,
String widgetMode,
String template)
Returns true if property with given name and value should be referenced as a value expression.
|
boolean |
referencePropertyAsExpression(String name,
Serializable value,
String widgetType,
String widgetTypeCategory,
String widgetMode,
String template)
Returns true if property with given name and value should be referenced as a value expression.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
getLayoutDefinition, getLayoutDefinitionNames, getLayoutTypeDefinition, getLayoutTypeDefinitions, getWidgetDefinition, getWidgetType, getWidgetTypeDefinition, getWidgetTypeDefinitions
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLayoutDefinition, getLayoutDefinitionNames, getLayoutTypeDefinition, getLayoutTypeDefinitions, getWidgetDefinition, getWidgetType, getWidgetTypeDefinition, getWidgetTypeDefinitions
public static final ComponentName NAME
public static final String WIDGET_TYPES_EP_NAME
public static final String LAYOUT_TYPES_EP_NAME
public static final String WIDGETS_EP_NAME
public static final String LAYOUTS_EP_NAME
public static final String PROPS_REF_EP_NAME
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public String getDefaultStoreCategory()
LayoutManager
getDefaultStoreCategory
in interface LayoutManager
getDefaultStoreCategory
in class AbstractLayoutManager
public WidgetTypeHandler getWidgetTypeHandler(String typeName) throws WidgetException
WebLayoutManager
If the no widget type is found with this name, return null.
getWidgetTypeHandler
in interface WebLayoutManager
WidgetException
public WidgetTypeHandler getWidgetTypeHandler(String typeCategory, String typeName) throws WidgetException
WebLayoutManager
If the no widget type is found with this name, return null.
getWidgetTypeHandler
in interface WebLayoutManager
WidgetException
public Widget getWidget(javax.faces.view.facelets.FaceletContext ctx, String widgetName, String widgetCategory, String layoutMode, String valueName, String layoutName)
WebLayoutManager
getWidget
in interface WebLayoutManager
ctx
- the facelet context this widget will be computed in. If context is null, no expressions can be
resolved during computing.widgetName
- the widget namewidgetCategory
- the widget categorylayoutMode
- the pseudo layout modelayoutName
- the pseudo layout name (if any)public Widget getWidget(javax.faces.view.facelets.FaceletContext ctx, WidgetDefinition wDef, String layoutMode, String valueName, String layoutName)
WebLayoutManager
getWidget
in interface WebLayoutManager
ctx
- the facelet context this widget will be computed in. If context is null, no expressions can be
resolved during computing.wDef
- the widget definitionlayoutMode
- the pseudo layout modevalueName
- the value name to use when computing tag attributes (useful for fields mapping)layoutName
- the pseudo layout name (if any)public Layout getLayout(javax.faces.view.facelets.FaceletContext ctx, String layoutName, String mode, String valueName) throws LayoutException
WebLayoutManager
When a widget is configured not to be rendered in this mode, the layout will hold a null value instead. As well, when a row does not hold any non-null widget in this mode, the layout will not hold it.
getLayout
in interface WebLayoutManager
ctx
- the facelet context this layout will be computed in. If context is null, no expressions can be
resolved during computing.layoutName
- the layout definition name.mode
- the mode.valueName
- the value name to use when computing tag attributes.LayoutException
WebLayoutManager.getLayout(FaceletContext, String, String, String, List, boolean)
public Layout getLayout(javax.faces.view.facelets.FaceletContext ctx, String layoutName, String mode, String valueName, List<String> selectedRows, boolean selectAllRowsByDefault)
WebLayoutManager
getLayout
in interface WebLayoutManager
layoutName
- the layout definition name.LayoutManager.getLayoutDefinition(String)
,
WebLayoutManager.getLayout(FaceletContext, LayoutDefinition, String, String, List, boolean)
public Layout getLayout(javax.faces.view.facelets.FaceletContext ctx, String layoutName, String layoutCategory, String mode, String valueName, List<String> selectedRows, boolean selectAllRowsByDefault)
WebLayoutManager
getLayout
in interface WebLayoutManager
layoutName
- the layout definition name.LayoutManager.getLayoutDefinition(String)
,
WebLayoutManager.getLayout(FaceletContext, LayoutDefinition, String, String, List, boolean)
public Layout getLayout(javax.faces.view.facelets.FaceletContext ctx, LayoutDefinition layoutDef, String mode, String valueName, List<String> selectedRows, boolean selectAllRowsByDefault)
WebLayoutManager
When a widget is configured not to be rendered in this mode, the layout will hold a null value instead. As well, when a row does not hold any non-null widget in this mode, the layout will not hold it.
If parameter selectedRows is not null, layout rows will be filtered according to this value. If selectedRows is null and parameter selectAllRowsByDefault is true, all rows will be taken into account, even rows marked as not selected by default.
getLayout
in interface WebLayoutManager
ctx
- the facelet context this layout will be computed in. If context is null, no expressions can be
resolved during computing.layoutDef
- the layout definition instance.mode
- the mode.valueName
- the value name to use when computing tag attributes (useful for fields mapping)selectedRows
- the list of selected rows namesselectAllRowsByDefault
- boolean indicating if all rows should be considered selected by default in case
parameter selectedRows resolves to null.public javax.faces.view.facelets.FaceletHandler getFaceletHandler(javax.faces.view.facelets.FaceletContext ctx, javax.faces.view.facelets.TagConfig config, Widget widget)
WebLayoutManager
getFaceletHandler
in interface WebLayoutManager
ctx
- the facelet context.config
- the tag config, used to hook the handler in the jsf tree.widget
- the computed widget.public javax.faces.view.facelets.FaceletHandler getFaceletHandler(javax.faces.view.facelets.FaceletContext ctx, javax.faces.view.facelets.TagConfig config, Widget widget, javax.faces.view.facelets.FaceletHandler nextHandler)
WebLayoutManager
getFaceletHandler
in interface WebLayoutManager
ctx
- the facelet context.config
- the tag config, used to hook the handler in the jsf tree.widget
- the computed widget.nextHandler
- the next handler in the execution chainpublic Widget createWidget(javax.faces.view.facelets.FaceletContext ctx, String type, String mode, String valueName, Map<String,Serializable> properties, Widget[] subWidgets)
WebLayoutManager
createWidget
in interface WebLayoutManager
ctx
- the facelet context this layout will be computed in. If context is null, no expressions can be
resolved during computing.type
- the widget type name.mode
- the mode.valueName
- the value name to use when computing tag attributes.properties
- optional properties to use when computing the widget.subWidgets
- optional sub widgets for this widget.WebLayoutManager.createWidget(FaceletContext, String, String, String, List, String, String, Boolean, Map, Widget[])
public Widget createWidget(javax.faces.view.facelets.FaceletContext ctx, String type, String mode, String valueName, List<FieldDefinition> fieldDefinitions, String label, String helpLabel, Boolean translated, Map<String,Serializable> properties, Widget[] subWidgets)
WebLayoutManager
createWidget
in interface WebLayoutManager
ctx
- the facelet context this layout will be computed in. If context is null, no expressions can be
resolved during computing.type
- the widget type name.mode
- the mode.valueName
- the value name to use when computing tag attributes.label
- the widget labelhelpLabel
- the widget help labeltranslated
- if true, the labels will be translatedproperties
- optional properties to use when computing the widget.subWidgets
- optional sub widgets for this widget.public Widget createWidget(javax.faces.view.facelets.FaceletContext ctx, WidgetDefinition wDef, String mode, String valueName, Widget[] subWidgets)
WebLayoutManager
createWidget
in interface WebLayoutManager
ctx
- the facelet context this layout will be computed in. If context is null, no expressions can be
resolved during computing.mode
- the mode.valueName
- the value name to use when computing tag attributes.subWidgets
- optional sub widgets for this widget.public boolean referencePropertyAsExpression(String name, Serializable value, String widgetType, String widgetMode, String template)
WebLayoutManager
Assumes the widget type is in category #JSF_CATEGORY for backward compatibility.
referencePropertyAsExpression
in interface WebLayoutManager
WebLayoutManager.referencePropertyAsExpression(String, Serializable, String, String, String)
public boolean referencePropertyAsExpression(String name, Serializable value, String widgetType, String widgetTypeCategory, String widgetMode, String template)
WebLayoutManager
Referencing properties as value expressions makes it possible to resolve this value again when reloading components in ajax for instance, as literal values kept by JSF components are not evaluated again.
But some components wait for a literal value and do not evaluate value expressions, so their properties should not be referenced as value expressions. An extension point on the service makes it possible to declare these properties: by default other properties will be using references.
This method returns false if it finds a matching disabled property ref for given criteria. If any of the given parameters are null, this criterion is ignored, and this looks up any matching (and enabled) contribution.
referencePropertyAsExpression
in interface WebLayoutManager
name
- the property namevalue
- the property valuewidgetType
- the widget type if anywidgetTypeCategory
- the widget type category if anywidgetMode
- the widget mode if anytemplate
- the widget template if anyCopyright © 2015 Nuxeo SA. All rights reserved.