Class ComponentSpinner

java.lang.Object
de.julianweinelt.datacat.dbx.api.ui.Component<Integer,ComponentSpinner>
de.julianweinelt.datacat.dbx.api.ui.components.ComponentSpinner

public class ComponentSpinner extends Component<Integer,ComponentSpinner>
  • Constructor Details

    • ComponentSpinner

      public ComponentSpinner()
  • Method Details

    • 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<Integer,ComponentSpinner>
      Returns:
      true if it should be expanded, otherwise false
    • initialValue

      public ComponentSpinner 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<Integer,ComponentSpinner>
      Parameters:
      val - The value to set.
      Returns:
      The Component's instance.
    • action

      public ComponentSpinner action(Consumer<Integer> action)
    • value

      public Integer 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<Integer,ComponentSpinner>
      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<Integer,ComponentSpinner>
      Returns:
      An object extending JComponent