Class CmsEditableGroup


  • public class CmsEditableGroup
    extends java.lang.Object
    Manages a group of widgets used as a multivalue input.

    This class is not itself a widget, it just coordinates the other widgets actually used to display the multivalue widget group.

    • Constructor Detail

      • CmsEditableGroup

        public CmsEditableGroup​(com.vaadin.ui.AbstractOrderedLayout container,
                                com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory,
                                CmsEditableGroup.I_EmptyHandler emptyHandler)
        Creates a new instance.

        Parameters:
        container - the container in which to render the individual rows
        componentFactory - the factory used to create new input fields
        placeholder - the placeholder to display when there are no rows
      • CmsEditableGroup

        public CmsEditableGroup​(com.vaadin.ui.AbstractOrderedLayout container,
                                com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory,
                                java.lang.String addButtonCaption)
        Creates a new instance.

        Parameters:
        container - the container in which to render the individual rows
        componentFactory - the factory used to create new input fields
        addButtonCaption - the caption for the button which is used to add a new row to an empty list
    • Method Detail

      • addRow

        public void addRow​(com.vaadin.ui.Component component)
        Adds a row for the given component at the end of the group.
        Parameters:
        component - the component to wrap in the row to be added
      • addRowAfter

        public void addRowAfter​(I_CmsEditableGroupRow row)
        Adds a new row after the given one.
        Parameters:
        row - the row after which a new one should be added
      • getContainer

        public com.vaadin.ui.AbstractOrderedLayout getContainer()
        Gets the row container.
        Returns:
        the row container
      • getErrorListener

        public com.vaadin.ui.Component.Listener getErrorListener()
        Gets the error listener.
        Returns:
        t
      • getNewComponentFactory

        public com.google.common.base.Supplier<com.vaadin.ui.Component> getNewComponentFactory()
        Gets the factory used for creating new components.
        Returns:
        the factory used for creating new components
      • getRowCaption

        public java.lang.String getRowCaption()
        Returns the row caption.

        Returns:
        the row caption
      • init

        public void init()
        Initializes the multivalue group.

      • setAddButtonVisible

        public void setAddButtonVisible​(boolean visible)
        See Also:
        org.opencms.ui.components.editablegroup.I_CmsEditableGroup#setAddButtonVisible(boolean)
      • setEditEnabled

        public void setEditEnabled​(boolean enabled)
        Enables / disables edit button.
        Parameters:
        enabled - true if edit button should be enabled
      • setErrorMessage

        public void setErrorMessage​(java.lang.String errorMessage)
        Sets the error message.

        Parameters:
        errorMessage - the error message
      • setRowCaption

        public void setRowCaption​(java.lang.String rowCaption)
        Sets the row caption.

        Parameters:
        rowCaption - the row caption to set
      • hasError

        protected boolean hasError​(com.vaadin.ui.Component component)
        Checks if the given group component has an error.

        Parameters:
        component - the component to check
        Returns:
        true if the component has an error