Class EditorComponents.CreateComponents

java.lang.Object
is.codion.swing.framework.ui.EditorComponents.CreateComponents
Enclosing interface:
EditorComponents

public static final class EditorComponents.CreateComponents extends Object
Creates SwingEntityEditor based components
  • Method Details

    • textArea

      public TextAreaBuilder textArea(Attribute<String> attribute)
      Creates a builder for text areas.
      Parameters:
      attribute - the attribute for which to build a text area
      Returns:
      a text area builder
    • textFieldPanel

      public TextFieldPanel.Builder textFieldPanel(Attribute<String> attribute)
      Creates a builder for text field panels.
      Parameters:
      attribute - the attribute for which to build a text field panel
      Returns:
      a text field panel builder
    • temporalFieldPanel

      public <T extends Temporal> TemporalFieldPanel.Builder<T> temporalFieldPanel(Attribute<T> attribute)
      Creates a builder for temporal field panels.
      Type Parameters:
      T - the temporal type
      Parameters:
      attribute - the attribute for which to build a temporal field panel
      Returns:
      a text area builder
    • textField

      public <T, C extends JTextField, B extends TextFieldBuilder<C, T, B>> TextFieldBuilder<C,T,B> textField(Attribute<T> attribute)
      Creates a builder for text fields.
      Type Parameters:
      T - the value type
      C - the text field type
      B - the builder type
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      a text field builder
    • temporalField

      public <T extends Temporal> TemporalField.Builder<T> temporalField(Attribute<T> attribute)
      Creates a builder for temporal fields.
      Type Parameters:
      T - the temporal type
      Parameters:
      attribute - the attribute for which to build a temporal field
      Returns:
      an offset date time field builder
    • slider

      public SliderBuilder slider(Attribute<Integer> attribute)
      Creates a builder for a slider
      Parameters:
      attribute - the attribute
      Returns:
      a slider builder
    • integerSpinner

      public NumberSpinnerBuilder<Integer> integerSpinner(Attribute<Integer> attribute)
      Creates a builder for a spinner
      Parameters:
      attribute - the attribute
      Returns:
      a spinner builder
    • doubleSpinner

      public NumberSpinnerBuilder<Double> doubleSpinner(Attribute<Double> attribute)
      Creates a builder for a spinner
      Parameters:
      attribute - the attribute
      Returns:
      a spinner builder
    • listSpinner

      public <T> ListSpinnerBuilder<T> listSpinner(Attribute<T> attribute, SpinnerListModel spinnerListModel)
      Creates a builder for a list spinner
      Type Parameters:
      T - the value type
      Parameters:
      attribute - the attribute
      spinnerListModel - the spinner model
      Returns:
      a spinner builder
    • itemSpinner

      public <T> ItemSpinnerBuilder<T> itemSpinner(Attribute<T> attribute)
      Creates a builder for a list spinner
      Type Parameters:
      T - the value type
      Parameters:
      attribute - the attribute
      Returns:
      a spinner builder
    • integerField

      public NumberField.Builder<Integer> integerField(Attribute<Integer> attribute)
      Creates a builder for integer fields.
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      an integer field builder
    • longField

      public NumberField.Builder<Long> longField(Attribute<Long> attribute)
      Creates a builder for long fields.
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      a long field builder
    • bigIntegerField

      public NumberField.Builder<BigInteger> bigIntegerField(Attribute<BigInteger> attribute)
      Creates a builder for big integer fields.
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      a big integer field builder
    • doubleField

      public NumberField.Builder<Double> doubleField(Attribute<Double> attribute)
      Creates a builder for double fields.
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      a double field builder
    • bigDecimalField

      public NumberField.Builder<BigDecimal> bigDecimalField(Attribute<BigDecimal> attribute)
      Creates a builder for big decimal fields.
      Parameters:
      attribute - the attribute for which to build a text field
      Returns:
      a big decimal field builder
    • maskedTextField

      public MaskedTextFieldBuilder maskedTextField(Attribute<String> attribute)
      Creates a builder for formatted text fields.
      Parameters:
      attribute - the attribute for which to build a formatted text field
      Returns:
      a formatted text field builder
    • checkBox

      public CheckBoxBuilder checkBox(Attribute<Boolean> attribute)
      Creates a builder for check boxes for non-nullable attributes.
      Parameters:
      attribute - the attribute for which to build a check-box
      Returns:
      a check-box builder
    • nullableCheckBox

      public NullableCheckBoxBuilder nullableCheckBox(Attribute<Boolean> attribute)
      Creates a builder for nullable check boxes.
      Parameters:
      attribute - the attribute for which to build a check-box
      Returns:
      a check-box builder
    • booleanComboBox

      public ItemComboBoxBuilder<Boolean> booleanComboBox(Attribute<Boolean> attribute)
      Creates a builder for boolean combo boxes.
      Parameters:
      attribute - the attribute for which to build boolean combo box
      Returns:
      a boolean combo box builder
    • comboBox

      public <T, C extends JComboBox<T>, B extends ComboBoxBuilder<C, T, B>> ComboBoxBuilder<C,T,B> comboBox(Attribute<T> attribute, ComboBoxModel<T> comboBoxModel)
      Creates a builder for combo boxes.
      Type Parameters:
      T - the value type
      C - the component type
      B - the builder type
      Parameters:
      attribute - the attribute for which to build combo box
      comboBoxModel - the combo box model
      Returns:
      a combo box builder
    • itemComboBox

      public <T> ItemComboBoxBuilder<T> itemComboBox(Attribute<T> attribute)
      Creates a builder for value item list combo boxes.
      Type Parameters:
      T - the value type
      Parameters:
      attribute - the attribute for which to build a value list combo box
      Returns:
      a value item list combo box builder
    • label

      public <T> LabelBuilder<T> label(Attribute<T> attribute)
      Creates a builder for labels.
      Type Parameters:
      T - the value type
      Parameters:
      attribute - the attribute for which to build a label
      Returns:
      a label builder
    • comboBox

      public <T, C extends JComboBox<T>, B extends ComboBoxBuilder<C, T, B>> ComboBoxBuilder<C,T,B> comboBox(Column<T> column)
      Creates a builder for a combo box, containing the values of the given column.
      Type Parameters:
      T - the value type
      C - the component type
      B - the builder type
      Parameters:
      column - the column for which to build a combo box
      Returns:
      a combo box builder
    • enumComboBox

      public <T extends Enum<T>, C extends JComboBox<T>, B extends ComboBoxBuilder<C, T, B>> ComboBoxBuilder<C,T,B> enumComboBox(Column<T> column)
      Creates a builder for an enum based combo box.
      Type Parameters:
      T - the value type
      C - the component type
      B - the builder type
      Parameters:
      column - the column for which to build a combo box
      Returns:
      a combo box builder
    • comboBox

      public EntityComboBox.Builder comboBox(ForeignKey foreignKey)
      Creates a builder for foreign key combo boxes.
      Parameters:
      foreignKey - the foreign key for which to build a combo box
      Returns:
      a foreign key combo box builder
    • comboBoxPanel

      public EntityComboBoxPanel.Builder comboBoxPanel(ForeignKey foreignKey, Supplier<EntityEditPanel> editPanel)
      Creates a builder for a foreign key combo box panel with optional buttons for adding and editing items.
      Parameters:
      foreignKey - the foreign key
      editPanel - supplies the edit panel to use for the add and/or edit buttons
      Returns:
      a foreign key combo box panel builder
    • searchField

      public EntitySearchField.SingleSelectionBuilder searchField(ForeignKey foreignKey)
      Creates a builder for foreign key search fields.
      Parameters:
      foreignKey - the foreign key for which to build a search field
      Returns:
      a foreign key search field builder
    • searchFieldPanel

      public EntitySearchFieldPanel.SingleSelectionBuilder searchFieldPanel(ForeignKey foreignKey, Supplier<EntityEditPanel> editPanel)
      Creates a builder for a foreign key search field panel with optional buttons for adding and editing items.
      Parameters:
      foreignKey - the foreign key
      editPanel - the edit panel supplier to use for the add and/or edit buttons
      Returns:
      a foreign key combo box panel builder
    • textField

      public <B extends TextFieldBuilder<JTextField, Entity, B>> TextFieldBuilder<JTextField,Entity,B> textField(ForeignKey foreignKey)
      Creates a builder for a read-only, non-focusable foreign key text field.
      Type Parameters:
      B - the builder type
      Parameters:
      foreignKey - the foreign key for which to build a text field
      Returns:
      a foreign key text field builder
    • list

      Creates a list builder factory
      Type Parameters:
      T - the value type
      Parameters:
      listModel - the list model to base the list on
      Returns:
      a list builder factory
    • inputPanel

      public InputPanelBuilder inputPanel(Attribute<?> attribute)
      Creates a panel containing a label and the component associated with the given attribute. The label text is the caption defined for attribute. The default layout of the resulting panel is with the label on top and inputComponent below.
      Parameters:
      attribute - the attribute from which definition to retrieve the label caption
      Returns:
      a panel containing a label and a component
      Throws:
      IllegalArgumentException - in case no component has been associated with the given attribute