Class AbstractLabeledComponent<CC extends Component>

java.lang.Object
ch.tocco.nice2.model.form.api.components.AbstractComponent<CC>
ch.tocco.nice2.model.form.api.components.AbstractLabeledComponent<CC>
All Implemented Interfaces:
Component, LabeledComponent
Direct Known Subclasses:
AbstractBox, AbstractDataComponent, ActionSeparatorImpl, ContainerImpl, DefaultAction, DefaultColumn, DefaultTemplate, DescriptionFieldImpl, LocationFieldImpl, SearchFilterFieldImpl

@Deprecated public abstract class AbstractLabeledComponent<CC extends Component> extends AbstractComponent<CC> implements LabeledComponent
Deprecated.
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)
      Deprecated.
      Parameters:
      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()
      Deprecated.
      Specified by:
      getLabel in interface LabeledComponent
    • setLabel

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

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

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

      protected void mapAllAttributesTo(Component comp)
      Deprecated.
      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).

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

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