Class AbstractCompositeComponent
java.lang.Object
ch.tocco.nice2.model.form.impl.form2.components.AbstractComponent
ch.tocco.nice2.model.form.impl.form2.components.AbstractCompositeComponent
- All Implemented Interfaces:
Component
,CompositeComponent
,Cloneable
- Direct Known Subclasses:
AbstractAction
,AbstractComponentContainer
,ActionBarImpl
,ActionGroupImpl
,FormImpl
,LayoutImpl
public abstract class AbstractCompositeComponent
extends AbstractComponent
implements CompositeComponent
Base class for composite components that contains a list of child components.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.model.form.api.form2.components.Component
Component.Configuration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
accept
(ComponentVisitor visitor) Implement method (and add new method toComponentVisitor
), if during traversing the form something should happen with this specific component typevoid
addComponent
(AbstractComponent component) void
void
addScopes
(Collection<FormScope> scopes) clone()
Returns all child components.Returns the defined the scopes.boolean
Returns `true` if the list of children is not empty.int
void
insertComponent
(int index, AbstractComponent component) void
parseScopes
(String scopes) void
removeComponent
(AbstractComponent component) void
removeScope
(FormScope scope) void
removeScopes
(Collection<FormScope> scopes) void
replaceComponent
(Component oldComponent, AbstractComponent newComponent) void
validate()
Will be called when the form has been built completely.Methods inherited from class ch.tocco.nice2.model.form.impl.form2.components.AbstractComponent
getDefaultFormLabel, getId, getLabel, getParent, getPosition, setId, setLabel, setParent, setPosition
-
Constructor Details
-
AbstractCompositeComponent
public AbstractCompositeComponent()
-
-
Method Details
-
getScopes
Description copied from interface:CompositeComponent
Returns the defined the scopes. If the set is empty, the component is meant for all scopes.- Specified by:
getScopes
in interfaceCompositeComponent
-
addScope
-
addScopes
-
removeScope
-
removeScopes
-
parseScopes
-
hasChildren
public boolean hasChildren()Description copied from interface:CompositeComponent
Returns `true` if the list of children is not empty.- Specified by:
hasChildren
in interfaceCompositeComponent
-
getChildren
Description copied from interface:CompositeComponent
Returns all child components.- Specified by:
getChildren
in interfaceCompositeComponent
-
findById
- Specified by:
findById
in interfaceCompositeComponent
- Returns:
- the component with the passed `id` if it exists in the component tree. Otherwise
Optional.empty()
will be returned.
-
addComponent
-
replaceComponent
-
insertComponent
-
removeComponent
-
indexOf
-
validate
Description copied from interface:Component
Will be called when the form has been built completely. Can be used to validate values (and throwModelBuildException
) or the fill in default value.- Specified by:
validate
in interfaceComponent
- Throws:
ModelBuildException
-
accept
Description copied from interface:Component
Implement method (and add new method toComponentVisitor
), if during traversing the form something should happen with this specific component type -
clone
- Overrides:
clone
in classAbstractComponent
- Throws:
CloneNotSupportedException
-