Class ComponentButton

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

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

    • ComponentButton

      public ComponentButton(String text)
  • Method Details

    • text

      public ComponentButton text(String text)
    • 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,ComponentButton>
      Returns:
      true if it should be expanded, otherwise false
    • initialValue

      public ComponentButton 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,ComponentButton>
      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,ComponentButton>
      Returns:
      The entered value of this component.
    • action

      public ComponentButton action(Consumer<ActionEvent> action)
    • create

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