Package org.opencms.acacia.client
Interface I_CmsWidgetService
-
- All Known Implementing Classes:
CmsDefaultWidgetService
,CmsWidgetService
public interface I_CmsWidgetService
Provides widget renderer for entity attributes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangedOrderPath(java.lang.String attributePath)
Adds the given path to the list of paths where child attributes have change their order.void
addConfigurations(java.util.Map<java.lang.String,org.opencms.acacia.shared.CmsAttributeConfiguration> configurations)
Adds all configurations.void
addRenderer(I_CmsEntityRenderer renderer)
Adds a renderer.void
addWidgetFactory(java.lang.String widgetName, I_CmsWidgetFactory widgetFactory)
Registers the given widget factory with the service.I_CmsFormEditWidget
getAttributeFormWidget(java.lang.String attributeName)
Returns the attribute form editing widget.java.lang.String
getAttributeHelp(java.lang.String attributeName)
Returns the attribute help information.I_CmsEditWidget
getAttributeInlineWidget(java.lang.String attributeName, com.google.gwt.dom.client.Element element)
Returns the attribute inline editing widget wrapping the given DOM element.java.lang.String
getAttributeLabel(java.lang.String attributeName)
Returns the label for the given attribute.java.lang.String
getDefaultAttributeValue(java.lang.String attributeName, java.lang.String simpleValuePath)
Returns the default attribute value.I_CmsEntityRenderer
getRendererForAttribute(java.lang.String attributeName, org.opencms.acacia.shared.CmsType attributeType)
Returns the renderer for the given attribute.I_CmsEntityRenderer
getRendererForType(org.opencms.acacia.shared.CmsType entityType)
Returns the renderer for the given entity type.boolean
isDisplayCompact(java.lang.String attributeName)
Returns the if the attribute widget should be displayed in compact view.boolean
isDisplaySingleLine(java.lang.String attributeName)
Returns if the attribute widget should be displayed in single line view.boolean
isVisible(java.lang.String attributeName)
Returns if the given attribute should be visible in the editor.void
registerComplexWidgetAttribute(java.lang.String attrName, java.lang.String renderer, java.lang.String configuration)
Registers a complex widget attribute which should be handled by a special renderer.void
setDefaultRenderer(I_CmsEntityRenderer renderer)
Sets the default renderer.void
setWidgetFactories(java.util.Map<java.lang.String,I_CmsWidgetFactory> widgetFactories)
Sets the widget factories.boolean
shouldRemoveLastValueAfterUnfocus(I_CmsEditWidget widget)
Returns true if the value which this widget is being used for should be disabled if it is unfocused and the last remaining attribute value for a given attribute.
-
-
-
Method Detail
-
addChangedOrderPath
void addChangedOrderPath(java.lang.String attributePath)
Adds the given path to the list of paths where child attributes have change their order.- Parameters:
attributePath
- the attribute path
-
addConfigurations
void addConfigurations(java.util.Map<java.lang.String,org.opencms.acacia.shared.CmsAttributeConfiguration> configurations)
Adds all configurations.- Parameters:
configurations
- the configurations to add
-
addRenderer
void addRenderer(I_CmsEntityRenderer renderer)
Adds a renderer.- Parameters:
renderer
- the renderer to add
-
addWidgetFactory
void addWidgetFactory(java.lang.String widgetName, I_CmsWidgetFactory widgetFactory)
Registers the given widget factory with the service.- Parameters:
widgetName
- the widget namewidgetFactory
- the widget factory
-
getAttributeFormWidget
I_CmsFormEditWidget getAttributeFormWidget(java.lang.String attributeName)
Returns the attribute form editing widget.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute widget
-
getAttributeHelp
java.lang.String getAttributeHelp(java.lang.String attributeName)
Returns the attribute help information.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute help information
-
getAttributeInlineWidget
I_CmsEditWidget getAttributeInlineWidget(java.lang.String attributeName, com.google.gwt.dom.client.Element element)
Returns the attribute inline editing widget wrapping the given DOM element.- Parameters:
attributeName
- the attribute nameelement
- the DOM element to wrap- Returns:
- the attribute widget
-
getAttributeLabel
java.lang.String getAttributeLabel(java.lang.String attributeName)
Returns the label for the given attribute.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute label
-
getDefaultAttributeValue
java.lang.String getDefaultAttributeValue(java.lang.String attributeName, java.lang.String simpleValuePath)
Returns the default attribute value.- Parameters:
attributeName
- the attribute namesimpleValuePath
- the value path- Returns:
- the default value
-
getRendererForAttribute
I_CmsEntityRenderer getRendererForAttribute(java.lang.String attributeName, org.opencms.acacia.shared.CmsType attributeType)
Returns the renderer for the given attribute.- Parameters:
attributeName
- the name of the attributeattributeType
- the type of the attribute- Returns:
- the renderer
-
getRendererForType
I_CmsEntityRenderer getRendererForType(org.opencms.acacia.shared.CmsType entityType)
Returns the renderer for the given entity type.- Parameters:
entityType
- the type- Returns:
- the renderer
-
isDisplayCompact
boolean isDisplayCompact(java.lang.String attributeName)
Returns the if the attribute widget should be displayed in compact view.- Parameters:
attributeName
- the attribute name- Returns:
true
if the attribute widget should be displayed in compact view
-
isDisplaySingleLine
boolean isDisplaySingleLine(java.lang.String attributeName)
Returns if the attribute widget should be displayed in single line view.- Parameters:
attributeName
- the attribute name- Returns:
true
if the attribute widget should be displayed in single line view
-
isVisible
boolean isVisible(java.lang.String attributeName)
Returns if the given attribute should be visible in the editor.- Parameters:
attributeName
- the attribute name- Returns:
true
if the given attribute should be visible in the editor
-
registerComplexWidgetAttribute
void registerComplexWidgetAttribute(java.lang.String attrName, java.lang.String renderer, java.lang.String configuration)
Registers a complex widget attribute which should be handled by a special renderer.- Parameters:
attrName
- the attribute namerenderer
- the renderer to register for the attributeconfiguration
- the renderer configuration
-
setDefaultRenderer
void setDefaultRenderer(I_CmsEntityRenderer renderer)
Sets the default renderer.- Parameters:
renderer
- the default renderer
-
setWidgetFactories
void setWidgetFactories(java.util.Map<java.lang.String,I_CmsWidgetFactory> widgetFactories)
Sets the widget factories.- Parameters:
widgetFactories
- the widget factories
-
shouldRemoveLastValueAfterUnfocus
boolean shouldRemoveLastValueAfterUnfocus(I_CmsEditWidget widget)
Returns true if the value which this widget is being used for should be disabled if it is unfocused and the last remaining attribute value for a given attribute.The main use case is disabling empty text input fields.
- Parameters:
widget
- the widget to check- Returns:
- true if the value should be disabled
-
-