Class ComponentWrapper
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
LabeledComponentWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.model.form.api.components.Component
Component.ComponentFilter, Component.DataNavigationType, Component.DisplayType, Component.Position
-
Field Summary
-
Constructor Summary
ConstructorDescriptionComponentWrapper
(Component component, ComponentWrapperHandler handler) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addComponent
(Component component) Deprecated.Add a (child) component, only possible ifComponent.isLeaf()
is false.void
addComponent
(Component component, int index) Deprecated.Adds a child component to the child-list of this component at the specified index.Deprecated.void
Deprecated.Internal method for recursive loops.<T extends Component>
TDeprecated.Modified delegate method: return type convertion to (T).<T extends Component>
TcreateCopy
(Component newParent) Deprecated.Modified delegate method: return type convertion to (T).find
(Component.ComponentFilter filter) Deprecated.Returns all components that match the given filter.findByName
(String pattern) Deprecated.Walks through the component tree and compares the component's name with thepattern
.findByType
(Class<? extends Component> type) Deprecated.Returns all components that match the given class.findFirst
(Component.ComponentFilter filter) Deprecated.Returns the first component that match the given filter.@Nullable Component
findFirstByName
(String pattern) Deprecated.Deprecated.Deprecated.Returns the child with the given name, or null.Collection
<? extends Component> Deprecated.Returns the children.Deprecated.Deprecated.Deprecated.Deprecated.@Nullable Form
getForm()
Deprecated.Returns the parent form, if any.getName()
Deprecated.@Nullable Component
Deprecated.Every component has a reference to its parent except for the root-components (forms, templates).Deprecated.Returns the parent, or an exception for root components (forms, templates).Deprecated.@Nullable String
Deprecated.Get the name of the component this component has its relative-position to.Deprecated.Returns the scopes as defined in the component, or an empty set if none were defined which means that this component is meant for all scopes.getType()
Deprecated.boolean
Deprecated.protected boolean
Deprecated.boolean
Deprecated.boolean
isLeaf()
Deprecated.Tells if this component is at an end of the tree.boolean
Deprecated.void
overrideParent
(@Nullable Component parent) Deprecated.Overrides the parent.boolean
removeComponent
(String name) Deprecated.Removes a component by its name, return false if the component couldn't be foundvoid
replaceComponent
(Component oldComponent, Component newComponent) Deprecated.Replaces oldComponent with newComponent.void
replaceComponent
(String oldComponentName, Component newComponent) Deprecated.void
setAttributeProps
(Map<String, Object> attributeProps) Deprecated.void
setChildren
(Collection<Component> children) Deprecated.Set the children explicitvoid
setDisplayType
(Component.DisplayType displayType) Deprecated.void
setEventHandler
(@Nullable String eventHandler) Deprecated.void
setExtProps
(Map<String, Object> extProps) Deprecated.void
setForceEditable
(boolean forceEditable) Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
setReplace
(boolean replace) Deprecated.void
Deprecated.wrap
(ComponentWrapperHandler handler) Deprecated.Wraps the component with the given interceptor handler.
-
Field Details
-
handler
Deprecated.
-
-
Constructor Details
-
ComponentWrapper
Deprecated.
-
-
Method Details
-
getChildren
Deprecated.Description copied from interface:Component
Returns the children. IfComponent.isLeaf()
is false, it has to return at least one Component, otherwise it has to return an empty iterator- Specified by:
getChildren
in interfaceComponent
- Returns:
- iterator
-
getChild
Deprecated.Description copied from interface:Component
Returns the child with the given name, or null. -
hideChild
Deprecated. -
createCopy
Deprecated.Modified delegate method: return type convertion to (T).- Specified by:
createCopy
in interfaceComponent
- Returns:
- the copy
-
createCopy
Deprecated.Modified delegate method: return type convertion to (T).- Specified by:
createCopy
in interfaceComponent
- Parameters:
newParent
- the new parent- Returns:
- the copy
-
getName
Deprecated. -
findByName
Deprecated.Description copied from interface:Component
Walks through the component tree and compares the component's name with thepattern
.- Specified by:
findByName
in interfaceComponent
- Parameters:
pattern
- The name of the component we search (regular expressions are supported)- Returns:
- ordered list of components (flat structure).
-
findFirstByName
Deprecated.- Specified by:
findFirstByName
in interfaceComponent
-
setScopes
Deprecated. -
getScopes
Deprecated.Description copied from interface:Component
Returns the scopes as defined in the component, or an empty set if none were defined which means that this component is meant for all scopes. -
find
Deprecated.Description copied from interface:Component
Returns all components that match the given filter.Iterates the component tree, doing children recursively of each item first.
-
findFirst
Deprecated.Description copied from interface:Component
Returns the first component that match the given filter.Iterates the component tree, doing children recursively of each item first.
-
findByType
Deprecated.Description copied from interface:Component
Returns all components that match the given class.Iterates the component tree, doing children recursively of each item first.
Matching is determined by: type.isAssignableFrom( component.getClass() )
- Specified by:
findByType
in interfaceComponent
- Parameters:
type
- component type, eg InputComponent.class- Returns:
- ordered list of components (flat structure) it may be, that you
can access components in the list through the
Component.getChildren()
method aswell.
-
getType
Deprecated. -
isLeaf
public boolean isLeaf()Deprecated.Description copied from interface:Component
Tells if this component is at an end of the tree.More precise, it means the component has no children. It also returns true if the component is not meant to be a leaf, but happens to have no children, or the children are disabled or something (wrapper). This could even happen to a Form component.
-
getDisplayType
Deprecated.- Specified by:
getDisplayType
in interfaceComponent
-
isForceEditable
public boolean isForceEditable()Deprecated.- Specified by:
isForceEditable
in interfaceComponent
-
isReplace
public boolean isReplace()Deprecated. -
getParent
Deprecated.Description copied from interface:Component
Every component has a reference to its parent except for the root-components (forms, templates).
So this condition has to be true:
for(Compoent child : parent.getChildren())
assert child.getParent().equals(parent);
} -
getParentOrEx
Deprecated.Description copied from interface:Component
Returns the parent, or an exception for root components (forms, templates).- Specified by:
getParentOrEx
in interfaceComponent
- Returns:
- The parent, or an ex if it is null.
- Throws:
IllegalStateException
- When the parent is null.- See Also:
-
hasParent
public boolean hasParent()Deprecated. -
getForm
Deprecated.Description copied from interface:Component
Returns the parent form, if any. This loops all all parents until it either finds a form, or arrives at the top. -
overrideParent
Deprecated.Description copied from interface:Component
Overrides the parent.Originally this was not possible, the parent was final. But it is required for dynamically wrapping components in other components, see the table as an example which wraps fields in columns.
- Specified by:
overrideParent
in interfaceComponent
- Parameters:
parent
- The new one.
-
collectDataParts
Deprecated.- Specified by:
collectDataParts
in interfaceComponent
-
collectDataParts
Deprecated.Description copied from interface:Component
Internal method for recursive loops.- Specified by:
collectDataParts
in interfaceComponent
- Parameters:
path
- .collector
- .
-
setChildren
Deprecated.Description copied from interface:Component
Set the children explicit- Specified by:
setChildren
in interfaceComponent
- Parameters:
children
- childern
-
setName
Deprecated. -
addComponent
Deprecated.Description copied from interface:Component
Add a (child) component, only possible ifComponent.isLeaf()
is false.- Specified by:
addComponent
in interfaceComponent
- Parameters:
component
- Child to add.
-
addComponent
Deprecated.Description copied from interface:Component
Adds a child component to the child-list of this component at the specified index.- Specified by:
addComponent
in interfaceComponent
-
removeComponent
Deprecated.Description copied from interface:Component
Removes a component by its name, return false if the component couldn't be found- Specified by:
removeComponent
in interfaceComponent
- Parameters:
name
- The component-name
-
replaceComponent
Deprecated.Description copied from interface:Component
Replaces oldComponent with newComponent.- Specified by:
replaceComponent
in interfaceComponent
- Parameters:
oldComponent
- Component to remove.newComponent
- Component to add (on position of the old one)
-
replaceComponent
Deprecated.- Specified by:
replaceComponent
in interfaceComponent
-
setDisplayType
Deprecated.- Specified by:
setDisplayType
in interfaceComponent
-
setForceEditable
public void setForceEditable(boolean forceEditable) Deprecated.- Specified by:
setForceEditable
in interfaceComponent
-
setReplace
public void setReplace(boolean replace) Deprecated.- Specified by:
setReplace
in interfaceComponent
-
getPosition
Deprecated.- Specified by:
getPosition
in interfaceComponent
- Returns:
- the position
-
getRelativeToPositionName
Deprecated.Description copied from interface:Component
Get the name of the component this component has its relative-position to.- Specified by:
getRelativeToPositionName
in interfaceComponent
- Returns:
- name or null.
-
setPosition
Deprecated.- Specified by:
setPosition
in interfaceComponent
-
setRelativeToPositionName
Deprecated.- Specified by:
setRelativeToPositionName
in interfaceComponent
-
getExtProps
Deprecated.- Specified by:
getExtProps
in interfaceComponent
-
setExtProps
Deprecated.- Specified by:
setExtProps
in interfaceComponent
-
getAttributeProps
Deprecated.- Specified by:
getAttributeProps
in interfaceComponent
-
setAttributeProps
Deprecated.- Specified by:
setAttributeProps
in interfaceComponent
-
setEventHandler
Deprecated.- Specified by:
setEventHandler
in interfaceComponent
-
getEventHandler
Deprecated.- Specified by:
getEventHandler
in interfaceComponent
-
wrap
Deprecated.Description copied from interface:Component
Wraps the component with the given interceptor handler.Feel free to add an unwrap() method when needed.
-