Interface Component

All Known Subinterfaces:
Action, ActionSeparator, AmountField, BirthDateField, Box, Checkbox, CodeField, Column, ComboBox, ConstantField, 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, ConstantFieldImpl, ConstantFieldWrapper, 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

@Deprecated public interface Component
Deprecated.
Root-Interface for all components is the form-system.

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

  • Method Details

    • getName

      String getName()
      Deprecated.
      Returns:
      the component's name
    • getDataNavigationType

      Component.DataNavigationType getDataNavigationType()
      Deprecated.
      Returns:
      Tells what kind of component it is in relation to data.
    • setScopes

      void setScopes(Set<String> scopes)
      Deprecated.
      Parameters:
      scopes - No null values, strings in lower case!
    • getScopes

      Set<String> 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

      List<Component> findByName(String pattern)
      Deprecated.
      Walks through the component tree and compares the component's name with the pattern.
      Parameters:
      pattern - The name of the component we search (regular expressions are supported)
      Returns:
      ordered list of components (flat structure).
    • findFirstByName

      @Nullable @Nullable Component findFirstByName(String pattern)
      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

      @Nullable @Nullable Component findFirst(Component.ComponentFilter filter)
      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

      List<Component> findByType(Class<? extends Component> type)
      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

      <T extends Component> T 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

      <T extends Component> T createCopy(Component newParent)
      Deprecated.
      Creates a copy of this component with the given parent.
      Parameters:
      newParent - the new parent
      Returns:
      the copy
    • getType

      Class<? extends Component> 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

      @Nullable @Nullable Component 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

      Component getParentOrEx() throws IllegalStateException
      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

      @Nullable @Nullable Form 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

      void overrideParent(@Nullable @Nullable Component parent)
      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. If isLeaf() is false, it has to return at least one Component, otherwise it has to return an empty iterator
      Returns:
      iterator
    • collectDataParts

      Map<List<String>,Set<String>> collectDataParts()
      Deprecated.
    • collectDataParts

      void collectDataParts(List<String> path, Map<List<String>,Set<String>> collector)
      Deprecated.
      Internal method for recursive loops.
      Parameters:
      path - .
      collector - .
    • setChildren

      void setChildren(Collection<Component> children)
      Deprecated.
      Set the children explicit
      Parameters:
      children - childern
      Throws:
      IllegalStateException - when trying to change the model after finished model-reading
    • setName

      void setName(String name)
      Deprecated.
      Parameters:
      name - name
      Throws:
      IllegalStateException - when trying to change the model after finished model-reading
    • addComponent

      void addComponent(Component component)
      Deprecated.
      Add a (child) component, only possible if isLeaf() is false.
      Parameters:
      component - Child to add.
      Throws:
      IllegalStateException - When trying to change the model after finished model-reading.
    • addComponent

      void addComponent(Component component, int index)
      Deprecated.
      Adds a child component to the child-list of this component at the specified index.
    • getChild

      @Nullable @Nullable Component getChild(String name)
      Deprecated.
      Returns the child with the given name, or null.
      Parameters:
      name - The component's name.
    • removeComponent

      boolean removeComponent(String name)
      Deprecated.
      Removes a component by its name, return false if the component couldn't be found
      Parameters:
      name - The component-name
    • replaceComponent

      void replaceComponent(Component oldComponent, Component newComponent)
      Deprecated.
      Replaces oldComponent with newComponent.
      Parameters:
      oldComponent - Component to remove.
      newComponent - Component to add (on position of the old one)
    • replaceComponent

      void replaceComponent(String oldComponentName, Component newComponent)
      Deprecated.
    • setForceEditable

      void setForceEditable(boolean forceEditable)
      Deprecated.
    • setDisplayType

      void setDisplayType(Component.DisplayType displayType)
      Deprecated.
    • setReplace

      void setReplace(boolean replace)
      Deprecated.
    • getPosition

      Component.Position getPosition()
      Deprecated.
      Returns:
      the position
    • getRelativeToPositionName

      @Nullable @Nullable String getRelativeToPositionName()
      Deprecated.
      Get the name of the component this component has its relative-position to.
      Returns:
      name or null.
    • setPosition

      void setPosition(Component.Position pos)
      Deprecated.
    • setRelativeToPositionName

      void setRelativeToPositionName(String name)
      Deprecated.
    • getExtProps

      @Nullable @Nullable Map<String,Object> getExtProps()
      Deprecated.
    • setExtProps

      void setExtProps(Map<String,Object> extProps)
      Deprecated.
    • setAttributeProps

      void setAttributeProps(Map<String,Object> attributeProps)
      Deprecated.
    • getAttributeProps

      @Nullable @Nullable Map<String,Object> getAttributeProps()
      Deprecated.
    • setEventHandler

      void setEventHandler(@Nullable @Nullable String eventHandler)
      Deprecated.
    • getEventHandler

      @Nullable @Nullable String getEventHandler()
      Deprecated.
    • wrap

      Deprecated.
      Wraps the component with the given interceptor handler.

      Feel free to add an unwrap() method when needed.