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
Modifier and TypeMethodDescriptionvoid
addChangedOrderPath
(String attributePath) Adds the given path to the list of paths where child attributes have change their order.void
addConfigurations
(Map<String, org.opencms.acacia.shared.CmsAttributeConfiguration> configurations) Adds all configurations.void
addRenderer
(I_CmsEntityRenderer renderer) Adds a renderer.void
addWidgetFactory
(String widgetName, I_CmsWidgetFactory widgetFactory) Registers the given widget factory with the service.getAttributeFormWidget
(String attributeName) Returns the attribute form editing widget.getAttributeHelp
(String attributeName) Returns the attribute help information.getAttributeInlineWidget
(String attributeName, com.google.gwt.dom.client.Element element) Returns the attribute inline editing widget wrapping the given DOM element.getAttributeLabel
(String attributeName) Returns the label for the given attribute.getDefaultAttributeValue
(String attributeName, String simpleValuePath) Returns the default attribute value.getRendererForAttribute
(String attributeName, org.opencms.acacia.shared.CmsType attributeType) Returns the renderer for the given attribute.getRendererForType
(org.opencms.acacia.shared.CmsType entityType) Returns the renderer for the given entity type.boolean
isDisplayCompact
(String attributeName) Returns the if the attribute widget should be displayed in compact view.boolean
isDisplaySingleLine
(String attributeName) Returns if the attribute widget should be displayed in single line view.boolean
Returns if the given attribute should be visible in the editor.void
registerComplexWidgetAttribute
(String attrName, String renderer, 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
(Map<String, I_CmsWidgetFactory> widgetFactories) Sets the widget factories.boolean
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 Details
-
addChangedOrderPath
Adds the given path to the list of paths where child attributes have change their order.- Parameters:
attributePath
- the attribute path
-
addConfigurations
void addConfigurations(Map<String, org.opencms.acacia.shared.CmsAttributeConfiguration> configurations) Adds all configurations.- Parameters:
configurations
- the configurations to add
-
addRenderer
Adds a renderer.- Parameters:
renderer
- the renderer to add
-
addWidgetFactory
Registers the given widget factory with the service.- Parameters:
widgetName
- the widget namewidgetFactory
- the widget factory
-
getAttributeFormWidget
Returns the attribute form editing widget.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute widget
-
getAttributeHelp
Returns the attribute help information.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute help information
-
getAttributeInlineWidget
I_CmsEditWidget getAttributeInlineWidget(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
Returns the label for the given attribute.- Parameters:
attributeName
- the attribute name- Returns:
- the attribute label
-
getDefaultAttributeValue
Returns the default attribute value.- Parameters:
attributeName
- the attribute namesimpleValuePath
- the value path- Returns:
- the default value
-
isDisplayCompact
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
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
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
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
Sets the default renderer.- Parameters:
renderer
- the default renderer
-
setWidgetFactories
Sets the widget factories.- Parameters:
widgetFactories
- the widget factories
-
shouldRemoveLastValueAfterUnfocus
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
-