Class AbstractLabeledComponent<CC extends Component>

All Implemented Interfaces:
Component, LabeledComponent
Direct Known Subclasses:
AbstractBox, AbstractDataComponent, ActionSeparatorImpl, ConstantFieldImpl, ContainerImpl, DefaultAction, DefaultColumn, DefaultTemplate, DescriptionFieldImpl, LocationFieldImpl, SearchFilterFieldImpl

@Deprecated public abstract class AbstractLabeledComponent<CC extends Component> extends AbstractComponent<CC> implements LabeledComponent
A labeled component defines a label, and wheter it should be used in the gui.

Most components will always use the label, for example a text field. Some components like box layout containers might use one, or not. To keep it the most flexible all labeled components may turn it off, even a text field (yes I see use cases for it).

If a component really depends on the label in the gui then it can still ignore the disabling feature. Just like a component may choose to ignore the label under certain circumstances.

  • Constructor Details

    • AbstractLabeledComponent

      protected AbstractLabeledComponent(boolean acceptChildren, @Nullable @Nullable Component parent)
      acceptChildren - set this explicit in your constructor. If true, the implementation will accept children, (For exaple an group-component), otherwise not (For example a textfield-component).
      parent - The parent of this component, null if none.
  • Method Details

    • getLabel

      public DisplayValue getLabel()
      Specified by:
      getLabel in interface LabeledComponent
    • setLabel

      public final void setLabel(DisplayValue value)
      Specified by:
      setLabel in interface LabeledComponent
      value - value
    • getUseLabel

      public LabeledComponent.UseLabel getUseLabel()
      Description copied from interface: LabeledComponent
      Tells if the label is to be used in the gui.
      Specified by:
      getUseLabel in interface LabeledComponent
      Tells if and how the label should be used.
    • setUseLabel

      public void setUseLabel(LabeledComponent.UseLabel useLabel)
      Description copied from interface: LabeledComponent
      Sets wheter the label is to be used in the gui.
      Specified by:
      setUseLabel in interface LabeledComponent
      useLabel - true to use it, false to ignore it
    • mapAllAttributesTo

      protected void mapAllAttributesTo(Component comp)
      Description copied from class: AbstractComponent
      Copies the attributes of this component into the passed component.

      This is used to copy the attributes collected by the xml reading process from "general" field tags into datatype-specific customized fields (mapped by FieldComponentConverter). And also for copying instances, kind of like cloning.

      Override this in your subclasses. Also, subclasses are required to let their anchestors do their work using super.copyOtherFields(cpy).

      mapAllAttributesTo in class AbstractComponent<CC extends Component>
      comp - The new field into which everything needs to be copied.
    • getDataNavigationType

      public Component.DataNavigationType getDataNavigationType()
      Subclasses must override this if they don't want to inherit the NONE value.
      Specified by:
      getDataNavigationType in interface Component
      Tells what kind of component it is in relation to data.