Class ComponentWrapper
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
LabeledComponentWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface Component
Component.ComponentFilter, Component.DataNavigationType, Component.DisplayType, Component.Position -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionComponentWrapper(Component component, ComponentWrapperHandler handler) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(Component component) Deprecated.Add a (child) component, only possible ifComponent.isLeaf()is false.voidaddComponent(Component component, int index) Deprecated.Adds a child component to the child-list of this component at the specified index.Deprecated.voidDeprecated.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 ComponentfindFirstByName(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 FormgetForm()Deprecated.Returns the parent form, if any.getName()Deprecated.@Nullable ComponentDeprecated.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 StringDeprecated.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.booleanDeprecated.protected booleanDeprecated.booleanDeprecated.booleanisLeaf()Deprecated.Tells if this component is at an end of the tree.booleanDeprecated.voidoverrideParent(@Nullable Component parent) Deprecated.Overrides the parent.booleanremoveComponent(String name) Deprecated.Removes a component by its name, return false if the component couldn't be foundvoidreplaceComponent(Component oldComponent, Component newComponent) Deprecated.Replaces oldComponent with newComponent.voidreplaceComponent(String oldComponentName, Component newComponent) Deprecated.voidsetAttributeProps(Map<String, Object> attributeProps) Deprecated.voidsetChildren(Collection<Component> children) Deprecated.Set the children explicitvoidsetDisplayType(Component.DisplayType displayType) Deprecated.voidsetEventHandler(@Nullable String eventHandler) Deprecated.voidsetExtProps(Map<String, Object> extProps) Deprecated.voidsetForceEditable(boolean forceEditable) Deprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidsetReplace(boolean replace) Deprecated.voidDeprecated.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:ComponentReturns the children. IfComponent.isLeaf()is false, it has to return at least one Component, otherwise it has to return an empty iterator- Specified by:
getChildrenin interfaceComponent- Returns:
- iterator
-
getChild
-
hideChild
Deprecated. -
createCopy
Deprecated.Modified delegate method: return type convertion to (T).- Specified by:
createCopyin interfaceComponent- Returns:
- the copy
-
createCopy
Deprecated.Modified delegate method: return type convertion to (T).- Specified by:
createCopyin interfaceComponent- Parameters:
newParent- the new parent- Returns:
- the copy
-
getName
-
findByName
Deprecated.Description copied from interface:ComponentWalks through the component tree and compares the component's name with thepattern.- Specified by:
findByNamein 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:
findFirstByNamein interfaceComponent
-
setScopes
-
getScopes
Deprecated.Description copied from interface:ComponentReturns 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:ComponentReturns all components that match the given filter.Iterates the component tree, doing children recursively of each item first.
-
findFirst
Deprecated.Description copied from interface:ComponentReturns 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:ComponentReturns 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:
findByTypein 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
-
isLeaf
public boolean isLeaf()Deprecated.Description copied from interface:ComponentTells 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:
getDisplayTypein interfaceComponent
-
isForceEditable
-
isReplace
-
getParent
Deprecated.Description copied from interface:ComponentEvery 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:ComponentReturns the parent, or an exception for root components (forms, templates).- Specified by:
getParentOrExin interfaceComponent- Returns:
- The parent, or an ex if it is null.
- Throws:
IllegalStateException- When the parent is null.- See Also:
-
hasParent
-
getForm
-
overrideParent
Deprecated.Description copied from interface:ComponentOverrides 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:
overrideParentin interfaceComponent- Parameters:
parent- The new one.
-
collectDataParts
-
collectDataParts
-
setChildren
Deprecated.Description copied from interface:ComponentSet the children explicit- Specified by:
setChildrenin interfaceComponent- Parameters:
children- childern
-
setName
-
addComponent
Deprecated.Description copied from interface:ComponentAdd a (child) component, only possible ifComponent.isLeaf()is false.- Specified by:
addComponentin interfaceComponent- Parameters:
component- Child to add.
-
addComponent
Deprecated.Description copied from interface:ComponentAdds a child component to the child-list of this component at the specified index.- Specified by:
addComponentin interfaceComponent
-
removeComponent
Deprecated.Description copied from interface:ComponentRemoves a component by its name, return false if the component couldn't be found- Specified by:
removeComponentin interfaceComponent- Parameters:
name- The component-name
-
replaceComponent
Deprecated.Description copied from interface:ComponentReplaces oldComponent with newComponent.- Specified by:
replaceComponentin interfaceComponent- Parameters:
oldComponent- Component to remove.newComponent- Component to add (on position of the old one)
-
replaceComponent
Deprecated.- Specified by:
replaceComponentin interfaceComponent
-
setDisplayType
Deprecated.- Specified by:
setDisplayTypein interfaceComponent
-
setForceEditable
public void setForceEditable(boolean forceEditable) Deprecated.- Specified by:
setForceEditablein interfaceComponent
-
setReplace
-
getPosition
Deprecated.- Specified by:
getPositionin interfaceComponent- Returns:
- the position
-
getRelativeToPositionName
Deprecated.Description copied from interface:ComponentGet the name of the component this component has its relative-position to.- Specified by:
getRelativeToPositionNamein interfaceComponent- Returns:
- name or null.
-
setPosition
Deprecated.- Specified by:
setPositionin interfaceComponent
-
setRelativeToPositionName
Deprecated.- Specified by:
setRelativeToPositionNamein interfaceComponent
-
getExtProps
Deprecated.- Specified by:
getExtPropsin interfaceComponent
-
setExtProps
Deprecated.- Specified by:
setExtPropsin interfaceComponent
-
getAttributeProps
Deprecated.- Specified by:
getAttributePropsin interfaceComponent
-
setAttributeProps
Deprecated.- Specified by:
setAttributePropsin interfaceComponent
-
setEventHandler
Deprecated.- Specified by:
setEventHandlerin interfaceComponent
-
getEventHandler
-
wrap
Deprecated.Description copied from interface:ComponentWraps the component with the given interceptor handler.Feel free to add an unwrap() method when needed.
-