Class ComponentLabel

java.lang.Object
de.julianweinelt.datacat.dbx.api.ui.Component<Void,ComponentLabel>
de.julianweinelt.datacat.dbx.api.ui.components.ComponentLabel

public class ComponentLabel extends Component<Void,ComponentLabel>
  • Constructor Details

    • ComponentLabel

      public ComponentLabel(boolean header)
  • Method Details

    • text

      public ComponentLabel text(String text)
    • font

      public ComponentLabel font(String font, int size)
    • font

      public ComponentLabel font(Font font)
    • fontSize

      public ComponentLabel fontSize(float size)
    • bold

      public ComponentLabel bold()
    • italic

      public ComponentLabel italic()
    • expandHorizontally

      public boolean expandHorizontally()
      Description copied from class: Component
      Defines if the component should be expanded to the window's width size in the component's parent screen.

      Example: a horizontal line for splitting content
      Specified by:
      expandHorizontally in class Component<Void,ComponentLabel>
      Returns:
      true if it should be expanded, otherwise false
    • initialValue

      public ComponentLabel initialValue(Object val)
      Description copied from class: Component
      For setting an initial value that should be displayed before any of the user's input.
      It should always return the instance of the Component.

      Implementation example:
      
       protected JTextField textField;
      
       @Override
       public ComponentTextField initialValue(Object value) {
           if (value instanceof String) {
               textField.setText((String) value);
           }
           return this;
       }
       
      Specified by:
      initialValue in class Component<Void,ComponentLabel>
      Parameters:
      val - The value to set.
      Returns:
      The Component's instance.
    • value

      public Void value()
      Description copied from class: Component
      Should return the value of the Component's Swing Object. e.g., if implementing a text field, it should return the entered value of the text field.
      Specified by:
      value in class Component<Void,ComponentLabel>
      Returns:
      The entered value of this component.
    • create

      public JComponent create()
      Description copied from class: Component
      Should return the internal Swing object.
      Specified by:
      create in class Component<Void,ComponentLabel>
      Returns:
      An object extending JComponent