Interface Component
- All Known Subinterfaces:
Action,ActionSeparator,AmountField,BirthDateField,Box,Checkbox,CodeField,Column,ComboBox,Container,CreatePasswordField,CustomDataField,DataComponent,DateField,DatetimeField,DescriptionField,DisplayExpressionField,DisplayField,DocumentField,DurationField,EmailField,Field,Form,HorizontalBox,HtmlField,ImageField,InputComponent,IteratorComponent,LabeledComponent,LatitudeField,LocationField,LoginField,LongitudeField,MoneyAmountField,MultiRemoteField,MultiSelectBox,NamedUploadField,NumberField,PasswordField,PathField,PercentField,PhoneField,PositionSearchField,PulldownDateField,RangeField,RemoteField,SearchFilterComponent,SearchFilterField,SingleSelectBox,Table,Template,TextArea,TextField,TimeField,UploadField,UrlField,UuidField,VerticalBox
- All Known Implementing Classes:
AbstractBox,AbstractComponent,AbstractDataComponent,AbstractDocumentField,AbstractLabeledComponent,ActionSeparatorImpl,ActionSeparatorWrapper,ActionWrapper,AmountFieldImpl,AmountFieldWrapper,BirthDateFieldImpl,BirthDateFieldWrapper,BoxWrapper,CheckboxImpl,CheckboxWrapper,CodeFieldImpl,CodeFieldWrapper,ColumnWrapper,ComboBoxImpl,ComboBoxWrapper,ComponentWrapper,ContainerImpl,ContainerWrapper,CreatePasswordFieldImpl,CreatePasswordFieldWrapper,CustomDataFieldImpl,CustomDataFieldWrapper,DataComponentWrapper,DateFieldImpl,DateFieldWrapper,DatetimeFieldImpl,DatetimeFieldWrapper,DefaultAction,DefaultColumn,DefaultIteratorComponent,DefaultTable,DefaultTemplate,DescriptionFieldImpl,DescriptionFieldWrapper,DisplayExpressionFieldImpl,DisplayExpressionFieldWrapper,DisplayFieldImpl,DisplayFieldWrapper,DocumentFieldImpl,DocumentFieldWrapper,DurationFieldImpl,DurationFieldWrapper,EmailFieldImpl,EmailFieldWrapper,FieldImpl,FieldWrapper,FormWrapper,HorizontalBoxImpl,HorizontalBoxWrapper,HtmlFieldImpl,HtmlFieldWrapper,ImageFieldImpl,ImageFieldWrapper,InputComponentWrapper,IteratorComponentWrapper,LabeledComponentWrapper,LatitudeFieldImpl,LatitudeFieldImpl.LatitudeFieldWrapper,LocationFieldImpl,LocationFieldWrapper,LoginFieldImpl,LoginFieldWrapper,LongitudeFieldImpl,LongitudeFieldImpl.LongitudeFieldWrapper,MoneyAmountFieldImpl,MoneyAmountFieldImpl.MoneyAmountFieldWrapper,MultiRemoteFieldImpl,MultiRemoteFieldWrapper,MultiSelectBoxImpl,MultiSelectBoxWrapper,NamedUploadFieldImpl,NamedUploadFieldWrapper,NumberFieldImpl,NumberFieldWrapper,PasswordFieldImpl,PasswordFieldWrapper,PathFieldImpl,PathFieldWrapper,PercentFieldImpl,PercentFieldWrapper,PhoneFieldImpl,PhoneFieldWrapper,PositionSearchFieldImpl,PositionSearchFieldImpl.PositionSearchFieldWrapper,PulldownDateFieldImpl,PulldownDateFieldWrapper,RangeFieldImpl,RangeFieldWrapper,RemoteFieldImpl,RemoteFieldWrapper,SearchFilterFieldImpl,SearchFilterFieldWrapper,SimpleForm,SingleSelectBoxImpl,SingleSelectBoxWrapper,TableWrapper,TemplateWrapper,TextAreaImpl,TextAreaWrapper,TextFieldImpl,TextFieldWrapper,TimeFieldImpl,TimeFieldWrapper,UploadFieldImpl,UploadFieldWrapper,UrlFieldImpl,UrlFieldWrapper,UuidFieldImpl,UuidFieldWrapper,VerticalBoxImpl,VerticalBoxWrapper
Components build a tree and have access to their parent.
Make sure that:
Component parent = comp.getParent();
true==parent.getChildren().containes(comp); // has to be true
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated.Implement this when you want to filter components.static enumDeprecated.Kinds of components in relation to data.static enumDeprecated.Same as AbstractFieldInfo.DisplayTypestatic enumDeprecated.The position-enum. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(Component component) Deprecated.Add a (child) component, only possible ifisLeaf()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.Creates a copy of this component.<T extends Component>
TcreateCopy(Component newParent) Deprecated.Creates a copy of this component with the given parent.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.@Nullable ComponentfindFirst(Component.ComponentFilter filter) Deprecated.Returns the first component that match the given filter.@Nullable ComponentfindFirstByName(String pattern) Deprecated.Deprecated.@Nullable ComponentDeprecated.Returns the child with the given name, or null.Collection<? extends Component> Deprecated.Returns the children.Deprecated.Deprecated.@Nullable StringDeprecated.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.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.
-
Method Details
-
getName
String getName()Deprecated.- Returns:
- the component's name
-
setScopes
Deprecated.- Parameters:
scopes- No null values, strings in lower case!
-
getScopes
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.- Returns:
- Unmodifiable set with the strings in lower case.
-
findByName
Deprecated.Walks through the component tree and compares the component's name with thepattern.- Parameters:
pattern- The name of the component we search (regular expressions are supported)- Returns:
- ordered list of components (flat structure).
-
findFirstByName
Deprecated. -
find
Deprecated.Returns all components that match the given filter.Iterates the component tree, doing children recursively of each item first.
- Parameters:
filter- your own component filter- Returns:
- ordered list of components (flat structure).
-
findFirst
Deprecated.Returns the first component that match the given filter.Iterates the component tree, doing children recursively of each item first.
- Parameters:
filter- your own component filter
-
findByType
Deprecated.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() )
- 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
getChildren()method aswell.
-
createCopy
Deprecated.Creates a copy of this component.This component has to be the root-component, it will loop all children recursively.
- Returns:
- the copy
-
createCopy
Deprecated.Creates a copy of this component with the given parent.- Parameters:
newParent- the new parent- Returns:
- the copy
-
getType
Deprecated. -
isLeaf
boolean isLeaf()Deprecated.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
Component.DisplayType getDisplayType()Deprecated. -
isForceEditable
boolean isForceEditable()Deprecated. -
isReplace
boolean isReplace()Deprecated. -
getParent
Deprecated.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);
}- Returns:
- null if root-component
- See Also:
-
getParentOrEx
Deprecated.Returns the parent, or an exception for root components (forms, templates).- Returns:
- The parent, or an ex if it is null.
- Throws:
IllegalStateException- When the parent is null.- See Also:
-
hasParent
boolean hasParent()Deprecated.- Returns:
- Tells if this component has a parent or not.
- See Also:
-
getForm
Deprecated.Returns the parent form, if any. This loops all all parents until it either finds a form, or arrives at the top. -
overrideParent
Deprecated.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.
- Parameters:
parent- The new one.
-
getChildren
Collection<? extends Component> getChildren()Deprecated.Returns the children. IfisLeaf()is false, it has to return at least one Component, otherwise it has to return an empty iterator- Returns:
- iterator
-
collectDataParts
Deprecated. -
collectDataParts
Deprecated.Internal method for recursive loops.- Parameters:
path- .collector- .
-
setChildren
Deprecated.Set the children explicit- Parameters:
children- childern- Throws:
IllegalStateException- when trying to change the model after finished model-reading
-
setName
Deprecated.- Parameters:
name- name- Throws:
IllegalStateException- when trying to change the model after finished model-reading
-
addComponent
Deprecated.Add a (child) component, only possible ifisLeaf()is false.- Parameters:
component- Child to add.- Throws:
IllegalStateException- When trying to change the model after finished model-reading.
-
addComponent
Deprecated.Adds a child component to the child-list of this component at the specified index. -
getChild
Deprecated.Returns the child with the given name, or null.- Parameters:
name- The component's name.
-
removeComponent
Deprecated.Removes a component by its name, return false if the component couldn't be found- Parameters:
name- The component-name
-
replaceComponent
Deprecated.Replaces oldComponent with newComponent.- Parameters:
oldComponent- Component to remove.newComponent- Component to add (on position of the old one)
-
replaceComponent
Deprecated. -
setForceEditable
void setForceEditable(boolean forceEditable) Deprecated. -
setDisplayType
Deprecated. -
setReplace
void setReplace(boolean replace) Deprecated. -
getPosition
Component.Position getPosition()Deprecated.- Returns:
- the position
-
getRelativeToPositionName
Deprecated.Get the name of the component this component has its relative-position to.- Returns:
- name or null.
-
setPosition
Deprecated. -
setRelativeToPositionName
Deprecated. -
getExtProps
Deprecated. -
setExtProps
Deprecated. -
setAttributeProps
Deprecated. -
getAttributeProps
Deprecated. -
setEventHandler
Deprecated. -
getEventHandler
Deprecated. -
wrap
Deprecated.Wraps the component with the given interceptor handler.Feel free to add an unwrap() method when needed.
-