Package org.opencms.acacia.client
Class CmsWidgetService
java.lang.Object
org.opencms.acacia.client.CmsWidgetService
- All Implemented Interfaces:
I_CmsWidgetService
- Direct Known Subclasses:
CmsDefaultWidgetService
Service providing form widget renderer for entity attributes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangedOrderPath(String valuePath) Adds the given path to the list of paths where child attributes have change their order.voidaddConfigurations(Map<String, org.opencms.acacia.shared.CmsAttributeConfiguration> configurations) Adds all configurations.voidaddRenderer(String typeName, I_CmsEntityRenderer renderer) Adds a renderer for the given type.voidaddRenderer(I_CmsEntityRenderer renderer) Adds a renderer.voidaddWidgetFactory(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) Gets the renderer instance for a specific attribute.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.voidinit(org.opencms.acacia.shared.CmsContentDefinition definition) Initializes the widget service with the given content definition.booleanisDisplayCompact(String attributeName) Returns the if the attribute widget should be displayed in compact view.booleanisDisplaySingleLine(String attributeName) Returns if the attribute widget should be displayed in single line view.booleanReturns if the given attribute should be visible in the editor.voidregisterComplexWidgetAttribute(String attrName, String rendererName, String configuration) Registers a complex widget attribute which should be handled by a special renderer.voidsetDefaultRenderer(I_CmsEntityRenderer renderer) Adds the default complex type renderer.voidsetWidgetFactories(Map<String, I_CmsWidgetFactory> widgetFactories) Sets the widget factories.booleanReturns 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.
-
Constructor Details
-
CmsWidgetService
public CmsWidgetService()Constructor.
-
-
Method Details
-
addChangedOrderPath
Description copied from interface:I_CmsWidgetServiceAdds the given path to the list of paths where child attributes have change their order.- Specified by:
addChangedOrderPathin interfaceI_CmsWidgetService- Parameters:
valuePath- the attribute path- See Also:
-
addConfigurations
public void addConfigurations(Map<String, org.opencms.acacia.shared.CmsAttributeConfiguration> configurations) Description copied from interface:I_CmsWidgetServiceAdds all configurations.- Specified by:
addConfigurationsin interfaceI_CmsWidgetService- Parameters:
configurations- the configurations to add- See Also:
-
addRenderer
Description copied from interface:I_CmsWidgetServiceAdds a renderer.- Specified by:
addRendererin interfaceI_CmsWidgetService- Parameters:
renderer- the renderer to add- See Also:
-
addRenderer
Adds a renderer for the given type.- Parameters:
typeName- the type namerenderer- the renderer
-
addWidgetFactory
Description copied from interface:I_CmsWidgetServiceRegisters the given widget factory with the service.- Specified by:
addWidgetFactoryin interfaceI_CmsWidgetService- Parameters:
widgetName- the widget namewidgetFactory- the widget factory- See Also:
-
getAttributeFormWidget
Description copied from interface:I_CmsWidgetServiceReturns the attribute form editing widget.- Specified by:
getAttributeFormWidgetin interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
- the attribute widget
- See Also:
-
getAttributeHelp
Description copied from interface:I_CmsWidgetServiceReturns the attribute help information.- Specified by:
getAttributeHelpin interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
- the attribute help information
- See Also:
-
getAttributeInlineWidget
public I_CmsEditWidget getAttributeInlineWidget(String attributeName, com.google.gwt.dom.client.Element element) Description copied from interface:I_CmsWidgetServiceReturns the attribute inline editing widget wrapping the given DOM element.- Specified by:
getAttributeInlineWidgetin interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute nameelement- the DOM element to wrap- Returns:
- the attribute widget
- See Also:
-
getAttributeLabel
Description copied from interface:I_CmsWidgetServiceReturns the label for the given attribute.- Specified by:
getAttributeLabelin interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
- the attribute label
- See Also:
-
getDefaultAttributeValue
Description copied from interface:I_CmsWidgetServiceReturns the default attribute value.- Specified by:
getDefaultAttributeValuein interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute namesimpleValuePath- the value path- Returns:
- the default value
- See Also:
-
getRendererForAttribute
Gets the renderer instance for a specific attribute.- Parameters:
attributeName- the attribute for which we want the renderer- Returns:
- the renderer instance
-
isDisplayCompact
Description copied from interface:I_CmsWidgetServiceReturns the if the attribute widget should be displayed in compact view.- Specified by:
isDisplayCompactin interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
trueif the attribute widget should be displayed in compact view- See Also:
-
isDisplaySingleLine
Description copied from interface:I_CmsWidgetServiceReturns if the attribute widget should be displayed in single line view.- Specified by:
isDisplaySingleLinein interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
trueif the attribute widget should be displayed in single line view- See Also:
-
isVisible
Description copied from interface:I_CmsWidgetServiceReturns if the given attribute should be visible in the editor.- Specified by:
isVisiblein interfaceI_CmsWidgetService- Parameters:
attributeName- the attribute name- Returns:
trueif the given attribute should be visible in the editor- See Also:
-
registerComplexWidgetAttribute
public void registerComplexWidgetAttribute(String attrName, String rendererName, String configuration) Description copied from interface:I_CmsWidgetServiceRegisters a complex widget attribute which should be handled by a special renderer.- Specified by:
registerComplexWidgetAttributein interfaceI_CmsWidgetService- Parameters:
attrName- the attribute namerendererName- the renderer to register for the attributeconfiguration- the renderer configuration- See Also:
-
setDefaultRenderer
Adds the default complex type renderer.- Specified by:
setDefaultRendererin interfaceI_CmsWidgetService- Parameters:
renderer- the renderer
-
setWidgetFactories
Description copied from interface:I_CmsWidgetServiceSets the widget factories.- Specified by:
setWidgetFactoriesin interfaceI_CmsWidgetService- Parameters:
widgetFactories- the widget factories- See Also:
-
shouldRemoveLastValueAfterUnfocus
Description copied from interface:I_CmsWidgetServiceReturns 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.
- Specified by:
shouldRemoveLastValueAfterUnfocusin interfaceI_CmsWidgetService- Parameters:
widget- the widget to check- Returns:
- true if the value should be disabled
- See Also:
-