Interface I_CmsWidgetService

    • 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
      • addWidgetFactory

        void addWidgetFactory​(java.lang.String widgetName,
                              I_CmsWidgetFactory widgetFactory)
        Registers the given widget factory with the service.

        Parameters:
        widgetName - the widget name
        widgetFactory - 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 name
        element - 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 name
        simpleValuePath - 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 attribute
        attributeType - 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 name
        renderer - the renderer to register for the attribute
        configuration - the renderer configuration
      • 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