Class EntityEditComponentPanel

    • Constructor Detail

      • EntityEditComponentPanel

        protected EntityEditComponentPanel​(SwingEntityEditModel editModel)
        Instantiates a new EntityEditComponentPanel
        Parameters:
        editModel - the edit model
    • Method Detail

      • getEditModel

        public final SwingEntityEditModel getEditModel()
        Returns:
        the edit model this panel is based on
      • getComponentAttributes

        public final List<Attribute<?>> getComponentAttributes()
        Returns:
        the attributes that have been associated with components.
      • getComponent

        public final JComponent getComponent​(Attribute<?> attribute)
        Parameters:
        attribute - the attribute
        Returns:
        the component associated with the given attribute, null if no component or component builder has been associated with the given attribute
      • getAttribute

        public final <T> Attribute<T> getAttribute​(JComponent component)
        Type Parameters:
        T - the attribute type
        Parameters:
        component - the component
        Returns:
        the attribute the given component is associated with, null if the component has not been associated with a attribute
      • setInitialFocusComponent

        public final JComponent setInitialFocusComponent​(JComponent initialFocusComponent)
        Sets the component that should receive the focus when the UI is cleared or activated. Overrides the value set via setInitialFocusAttribute(Attribute)
        Parameters:
        initialFocusComponent - the component
        Returns:
        the component
      • setInitialFocusAttribute

        public final void setInitialFocusAttribute​(Attribute<?> attribute)
        Sets the component associated with the given attribute as the component that should receive the initial focus in this edit panel. This is overridden by setInitialFocusComponent().
        Parameters:
        attribute - the component attribute
        See Also:
        setInitialFocusComponent(javax.swing.JComponent)
      • setAfterInsertFocusComponent

        public final JComponent setAfterInsertFocusComponent​(JComponent afterInsertFocusComponent)
        Sets the component that should receive the focus after an insert has been performed.. Overrides the value set via setAfterInsertFocusAttribute(Attribute)
        Parameters:
        afterInsertFocusComponent - the component
        Returns:
        the component
      • setAfterInsertFocusAttribute

        public final void setAfterInsertFocusAttribute​(Attribute<?> attribute)
        Sets the component associated with the given attribute as the component that should receive the focus after an insert is performed in this edit panel. This is overridden by setAfterInsertFocusComponent().
        Parameters:
        attribute - the component attribute
        See Also:
        setAfterInsertFocusComponent(JComponent)
      • requestComponentFocus

        public final void requestComponentFocus​(Attribute<?> attribute)
        Request focus for the component associated with the given attribute
        Parameters:
        attribute - the attribute of the component to select
      • excludeComponentFromSelection

        public final void excludeComponentFromSelection​(Attribute<?> attribute)
        Specifies that the given attribute should be excluded when presenting a component selection list.
        Parameters:
        attribute - the attribute to exclude from selection
        See Also:
        selectInputComponent()
      • setTransferFocusOnEnter

        protected final void setTransferFocusOnEnter​(boolean transferFocusOnEnter)
        If set to true then components created subsequently will transfer focus on enter, otherwise not. Note that this has no effect on components that have already been created.
        Parameters:
        transferFocusOnEnter - the new value
        See Also:
        ComponentBuilder.TRANSFER_FOCUS_ON_ENTER
      • setComponent

        protected final void setComponent​(Attribute<?> attribute,
                                          JComponent component)
        Associates the given input component with the given attribute.
        Parameters:
        attribute - the attribute
        component - the input component
      • addInputPanel

        protected final void addInputPanel​(Attribute<?> attribute)
        Adds a panel for the given attribute to this panel
        Parameters:
        attribute - the attribute
        See Also:
        createInputPanel(Attribute)
      • addInputPanel

        protected final void addInputPanel​(Attribute<?> attribute,
                                           Object constraints)
        Adds a panel for the given attribute to this panel using the given layout constraints
        Parameters:
        attribute - the attribute
        constraints - the layout constraints
        See Also:
        createInputPanel(Attribute)
      • addInputPanel

        protected final void addInputPanel​(Attribute<?> attribute,
                                           JComponent inputComponent)
        Adds a panel for the given attribute to this panel
        Parameters:
        attribute - the attribute
        inputComponent - a component bound to attribute
        See Also:
        createInputPanel(Attribute, JComponent)
      • addInputPanel

        protected final void addInputPanel​(Attribute<?> attribute,
                                           JComponent inputComponent,
                                           Object constraints)
        Adds a panel for the given attribute to this panel using the given layout constraints
        Parameters:
        attribute - the attribute
        inputComponent - a component bound to attribute
        constraints - the layout constraints
        See Also:
        createInputPanel(Attribute, JComponent)
      • createInputPanel

        protected final JPanel createInputPanel​(Attribute<?> attribute)
        Creates a panel containing a label and the component associated with the given attribute. The label text is the caption of the property based on attribute. The default layout of the resulting panel is with the label on top and inputComponent below.
        Parameters:
        attribute - the attribute from which property 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
      • createInputPanel

        protected final JPanel createInputPanel​(Attribute<?> attribute,
                                                JComponent inputComponent)
        Creates a panel containing a label and the component associated with the given attribute. The label text is the caption of the property based on attribute. The default layout of the resulting panel is with the label on top and inputComponent below.
        Parameters:
        attribute - the attribute from which property to retrieve the label caption
        inputComponent - a component bound to the property with id attribute
        Returns:
        a panel containing a label and a component
      • createInputPanel

        protected final JPanel createInputPanel​(Attribute<?> attribute,
                                                JComponent inputComponent,
                                                String labelBorderLayoutConstraints)
        Creates a panel containing a label and the component associated with the given attribute. The label text is the caption of the property based on attribute.
        Parameters:
        attribute - the attribute from which property to retrieve the label caption
        inputComponent - a component bound to the property with id attribute
        labelBorderLayoutConstraints - BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST
        Returns:
        a panel containing a label and a component
      • createInputPanel

        protected final JPanel createInputPanel​(Attribute<?> attribute,
                                                JComponent inputComponent,
                                                String labelBorderLayoutConstraints,
                                                int labelAlignment)
        Creates a panel containing a label and the given component. The label text is the caption of attribute.
        Parameters:
        attribute - the attribute from which property to retrieve the label caption
        inputComponent - a component bound to the property with id attribute
        labelBorderLayoutConstraints - BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST
        labelAlignment - the label alignment
        Returns:
        a panel containing a label and a component
      • createInputPanel

        protected final JPanel createInputPanel​(JComponent labelComponent,
                                                JComponent inputComponent)
        Creates a panel containing a label component and the inputComponent with the label component positioned above the input component.
        Parameters:
        labelComponent - the label component
        inputComponent - a input component
        Returns:
        a panel containing a label and a component
      • createInputPanel

        protected final JPanel createInputPanel​(JComponent labelComponent,
                                                JComponent inputComponent,
                                                String labelBorderLayoutConstraints)
        Creates a panel with a BorderLayout, with the inputComponent at BorderLayout.CENTER and the labelComponent at a specified location.
        Parameters:
        labelComponent - the label component
        inputComponent - a input component
        labelBorderLayoutConstraints - BorderLayout.NORTH, BorderLayout.SOUTH, BorderLayout.EAST or BorderLayout.WEST
        Returns:
        a panel containing a label and a component
      • createTextArea

        protected final TextAreaBuilder createTextArea​(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
      • createTextInputPanel

        protected final TextInputPanelBuilder createTextInputPanel​(Attribute<String> attribute)
        Creates a builder for text input panels.
        Parameters:
        attribute - the attribute for which to build a text input panel
        Returns:
        a text input panel builder
      • createTemporalInputPanel

        protected final <T extends TemporalTemporalInputPanelBuilder<T> createTemporalInputPanel​(Attribute<T> attribute)
        Creates a builder for temporal input panels.
        Type Parameters:
        T - the temporal type
        Parameters:
        attribute - the attribute for which to build a temporal input panel
        Returns:
        a text area builder
      • createTextField

        protected final <T,​C extends JTextField,​B extends TextFieldBuilder<T,​C,​B>> TextFieldBuilder<T,​C,​B> createTextField​(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
      • createLocalTimeField

        protected final LocalTimeFieldBuilder createLocalTimeField​(Attribute<LocalTime> attribute)
        Creates a builder for temporal fields.
        Parameters:
        attribute - the attribute for which to build a temporal field
        Returns:
        a local time field builder
      • createLocalDateField

        protected final LocalDateFieldBuilder createLocalDateField​(Attribute<LocalDate> attribute)
        Creates a builder for temporal fields.
        Parameters:
        attribute - the attribute for which to build a temporal field
        Returns:
        a local date field builder
      • createLocalDateTimeField

        protected final LocalDateTimeFieldBuilder createLocalDateTimeField​(Attribute<LocalDateTime> attribute)
        Creates a builder for temporal fields.
        Parameters:
        attribute - the attribute for which to build a temporal field
        Returns:
        a local date time field builder
      • createOffsetDateTimeField

        protected final OffsetDateTimeFieldBuilder createOffsetDateTimeField​(Attribute<OffsetDateTime> attribute)
        Creates a builder for temporal fields.
        Parameters:
        attribute - the attribute for which to build a temporal field
        Returns:
        a offset date time field builder
      • createIntegerField

        protected final IntegerFieldBuilder createIntegerField​(Attribute<Integer> attribute)
        Creates a builder for integer fields.
        Parameters:
        attribute - the attribute for which to build a text field
        Returns:
        a integer field builder
      • createLongField

        protected final LongFieldBuilder createLongField​(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
      • createDoubleField

        protected final DoubleFieldBuilder createDoubleField​(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
      • createBigDecimalField

        protected final BigDecimalFieldBuilder createBigDecimalField​(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
      • createFormattedTextField

        protected final FormattedTextFieldBuilder createFormattedTextField​(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
      • createBooleanComboBox

        protected BooleanComboBoxBuilder createBooleanComboBox​(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
      • createComboBox

        protected final <T> ComboBoxBuilder<T> createComboBox​(Attribute<T> attribute,
                                                              ComboBoxModel<T> comboBoxModel)
        Creates a builder for combo boxes.
        Type Parameters:
        T - the value type
        Parameters:
        attribute - the attribute for which to build combo box
        comboBoxModel - the combo box model
        Returns:
        a combo box builder
      • createItemComboBox

        protected final <T> ItemComboBoxBuilder<T> createItemComboBox​(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
      • createAttributeComboBox

        protected final <T> ComboBoxBuilder<T> createAttributeComboBox​(Attribute<T> attribute)
        Creates a builder for combo boxes, containing the values of the given attribute.
        Type Parameters:
        T - the value type
        Parameters:
        attribute - the attribute for which to build a combo box
        Returns:
        a combo box builder
      • createForeignKeyComboBox

        protected final ForeignKeyComboBoxBuilder createForeignKeyComboBox​(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
      • createForeignKeySearchField

        protected final ForeignKeySearchFieldBuilder createForeignKeySearchField​(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
      • createForeignKeyField

        protected final ForeignKeyFieldBuilder createForeignKeyField​(ForeignKey foreignKey)
        Creates a builder for read-only foreign key fields.
        Parameters:
        foreignKey - the foreign key for which to build a field
        Returns:
        a foreign key field builder
      • createLabel

        protected final <T> JLabel createLabel​(Attribute<T> attribute)
        Creates a JLabel with a caption from attribute, if a input component exists for the given attribute this label is associated with it via JLabel.setLabelFor(Component).
        Type Parameters:
        T - the attribute type
        Parameters:
        attribute - the attribute from which to retrieve the caption
        Returns:
        a JLabel for the given attribute
      • createLabel

        protected final <T> JLabel createLabel​(Attribute<T> attribute,
                                               int horizontalAlignment)
        Creates a JLabel with a caption from attribute, if an input component exists for the given attribute this label is associated with it via JLabel.setLabelFor(Component).
        Type Parameters:
        T - the attribute type
        Parameters:
        attribute - the attribute from which to retrieve the caption
        horizontalAlignment - the horizontal text alignment
        Returns:
        a JLabel for the given attribute
      • getInitialFocusComponent

        protected JComponent getInitialFocusComponent()
        Returns:
        the component that should get the initial focus when the UI is cleared
      • getAfterInsertFocusComponent

        protected JComponent getAfterInsertFocusComponent()
        Returns:
        the component that should get the focus when the UI is prepared after insert
      • requestAfterInsertFocus

        protected final void requestAfterInsertFocus()