public class CmsEditableGroup extends java.lang.Object
This class is not itself a widget, it just coordinates the other widgets actually used to display the multivalue widget group.
| Modifier and Type | Class and Description |
|---|---|
static class |
CmsEditableGroup.AddButtonEmptyHandler
Empty handler which shows or hides an 'Add' button to add new rows, depending on whether the group is empty.
|
static class |
CmsEditableGroup.DefaultRowBuilder
Default implementation for row builder.
|
static interface |
CmsEditableGroup.I_EmptyHandler
Handles state changes when the group becomes empty/not empty.
|
static interface |
CmsEditableGroup.I_HasError
Interface for group row components that can have errors.
|
static interface |
CmsEditableGroup.I_RowBuilder
Builds editable group rows by wrapping other components.
|
| Constructor and Description |
|---|
CmsEditableGroup(com.vaadin.ui.AbstractOrderedLayout container,
com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory,
CmsEditableGroup.I_EmptyHandler emptyHandler)
Creates a new instance.
|
CmsEditableGroup(com.vaadin.ui.AbstractOrderedLayout container,
com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory,
java.lang.String addButtonCaption)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRow(com.vaadin.ui.Component component)
Adds a row for the given component at the end of the group.
|
void |
addRowAfter(I_CmsEditableGroupRow row)
Adds a new row after the given one.
|
com.vaadin.ui.AbstractOrderedLayout |
getContainer()
Gets the row container.
|
com.vaadin.ui.Component.Listener |
getErrorListener()
Gets the error listener.
|
com.google.common.base.Supplier<com.vaadin.ui.Component> |
getNewComponentFactory()
Gets the factory used for creating new components.
|
java.lang.String |
getRowCaption()
Returns the row caption.
|
java.util.List<I_CmsEditableGroupRow> |
getRows()
Gets all rows.
|
protected boolean |
hasError(com.vaadin.ui.Component component)
Checks if the given group component has an error.
|
void |
init()
Initializes the multivalue group.
|
void |
moveDown(I_CmsEditableGroupRow row)
Moves the given row down.
|
void |
moveUp(I_CmsEditableGroupRow row)
Moves the given row up.
|
void |
remove(I_CmsEditableGroupRow row)
Removes the given row.
|
void |
setAddButtonVisible(boolean visible) |
void |
setErrorMessage(java.lang.String errorMessage)
Sets the error message.
|
void |
setRowBuilder(CmsEditableGroup.I_RowBuilder rowBuilder)
Sets the row builder.
|
void |
setRowCaption(java.lang.String rowCaption)
Sets the row caption.
|
public CmsEditableGroup(com.vaadin.ui.AbstractOrderedLayout container, com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory, CmsEditableGroup.I_EmptyHandler emptyHandler)
container - the container in which to render the individual rowscomponentFactory - the factory used to create new input fieldsplaceholder - the placeholder to display when there are no rowspublic CmsEditableGroup(com.vaadin.ui.AbstractOrderedLayout container, com.google.common.base.Supplier<com.vaadin.ui.Component> componentFactory, java.lang.String addButtonCaption)
container - the container in which to render the individual rowscomponentFactory - the factory used to create new input fieldsaddButtonCaption - the caption for the button which is used to add a new row to an empty listpublic void addRow(com.vaadin.ui.Component component)
component - the component to wrap in the row to be addedpublic void addRowAfter(I_CmsEditableGroupRow row)
row - the row after which a new one should be addedpublic com.vaadin.ui.AbstractOrderedLayout getContainer()
public com.vaadin.ui.Component.Listener getErrorListener()
public com.google.common.base.Supplier<com.vaadin.ui.Component> getNewComponentFactory()
public java.lang.String getRowCaption()
public java.util.List<I_CmsEditableGroupRow> getRows()
public void init()
public void moveDown(I_CmsEditableGroupRow row)
row - the row to movepublic void moveUp(I_CmsEditableGroupRow row)
row - the row to movepublic void remove(I_CmsEditableGroupRow row)
row - the row to removepublic void setAddButtonVisible(boolean visible)
org.opencms.ui.components.editablegroup.I_CmsEditableGroup#setAddButtonVisible(boolean)public void setErrorMessage(java.lang.String errorMessage)
errorMessage - the error messagepublic void setRowBuilder(CmsEditableGroup.I_RowBuilder rowBuilder)
rowBuilder - the row builderpublic void setRowCaption(java.lang.String rowCaption)
rowCaption - the row caption to setprotected boolean hasError(com.vaadin.ui.Component component)
component - the component to check