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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaccept(ComponentVisitor visitor) Implement method (and add new method toComponentVisitor), if during traversing the form something should happen with this specific component typevoidaddComponent(AbstractComponent component) voidvoidaddScopes(Collection<FormScope> scopes) clone()Returns all child components.Returns the defined the scopes.booleanReturns `true` if the list of children is not empty.intvoidinsertComponent(int index, AbstractComponent component) voidparseScopes(String scopes) voidremoveComponent(AbstractComponent component) voidremoveScope(FormScope scope) voidremoveScopes(Collection<FormScope> scopes) voidreplaceComponent(Component oldComponent, AbstractComponent newComponent) voidvalidate()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:CompositeComponentReturns the defined the scopes. If the set is empty, the component is meant for all scopes.- Specified by:
getScopesin interfaceCompositeComponent
-
addScope
-
addScopes
-
removeScope
-
removeScopes
-
parseScopes
-
hasChildren
public boolean hasChildren()Description copied from interface:CompositeComponentReturns `true` if the list of children is not empty.- Specified by:
hasChildrenin interfaceCompositeComponent
-
getChildren
Description copied from interface:CompositeComponentReturns all child components.- Specified by:
getChildrenin interfaceCompositeComponent
-
findById
- Specified by:
findByIdin 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:ComponentWill 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:
validatein interfaceComponent- Throws:
ModelBuildException
-
accept
Description copied from interface:ComponentImplement method (and add new method toComponentVisitor), if during traversing the form something should happen with this specific component type -
clone
- Overrides:
clonein classAbstractComponent- Throws:
CloneNotSupportedException
-