Module is.codion.swing.framework.ui
Package is.codion.swing.framework.ui
Class EntityEditComponentPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
is.codion.swing.framework.ui.EntityEditComponentPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
- Direct Known Subclasses:
EntityEditPanel
A base class for entity edit panels, providing components for editing entities.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final is.codion.common.property.PropertyValue<Integer>The type of underline to use to indicate a modified value
Value type: Integer
Default value:TextAttribute.UNDERLINE_LOW_DOTTED
Valid values:TextAttribute.UNDERLINE_*static final is.codion.common.property.PropertyValue<Boolean>Specifies whether label text should be underlined to indicate that the associated value is modified
Value type: Boolean
Default value: trueFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityEditComponentPanel(is.codion.swing.framework.model.SwingEntityEditModel editModel) Instantiates a new EntityEditComponentPanelprotectedEntityEditComponentPanel(is.codion.swing.framework.model.SwingEntityEditModel editModel, EntityComponents entityComponents) Instantiates a new EntityEditComponentPanel -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Adds a panel for the given attribute to this panelprotected final voidaddInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, Object constraints) Adds a panel for the given attribute to this panel using the given layout constraintsprotected final voidaddInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent) Adds a panel for the given attribute to this panelprotected final voidaddInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent, Object constraints) Adds a panel for the given attribute to this panel using the given layout constraintsfinal is.codion.common.value.Value<is.codion.framework.domain.entity.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.final is.codion.common.value.Value<JComponent>Sets the component that should receive the focus after an insert has been performed.final <T> is.codion.framework.domain.entity.attribute.Attribute<T>attribute(JComponent component) final Collection<is.codion.framework.domain.entity.attribute.Attribute<?>>final JComponentcomponent(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) protected final is.codion.swing.common.ui.component.text.NumberField.Builder<BigDecimal>createBigDecimalField(is.codion.framework.domain.entity.attribute.Attribute<BigDecimal> attribute) Creates a builder for big decimal fields.protected final is.codion.swing.common.ui.component.combobox.ItemComboBoxBuilder<Boolean>createBooleanComboBox(is.codion.framework.domain.entity.attribute.Attribute<Boolean> attribute) Creates a builder for boolean combo boxes.protected final is.codion.swing.common.ui.component.button.CheckBoxBuildercreateCheckBox(is.codion.framework.domain.entity.attribute.Attribute<Boolean> attribute) Creates a builder for check boxes.protected final <T,C extends JComboBox<T>, B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T, C, B>>
is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T,C, B> createComboBox(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, ComboBoxModel<T> comboBoxModel) Creates a builder for combo boxes.protected final <T,C extends JComboBox<T>, B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T, C, B>>
is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T,C, B> createComboBox(is.codion.framework.domain.entity.attribute.Column<T> column) Creates a builder for a combo boxe, containing the values of the given column.protected final is.codion.swing.common.ui.component.text.NumberField.Builder<Double>createDoubleField(is.codion.framework.domain.entity.attribute.Attribute<Double> attribute) Creates a builder for double fields.protected final is.codion.swing.common.ui.component.spinner.NumberSpinnerBuilder<Double>createDoubleSpinner(is.codion.framework.domain.entity.attribute.Attribute<Double> attribute) Creates a builder for a spinnerprotected final <B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<is.codion.framework.domain.entity.Entity,EntityComboBox, B>>
is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<is.codion.framework.domain.entity.Entity,EntityComboBox, B> createForeignKeyComboBox(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for foreign key combo boxes.protected final EntityComboBoxPanel.BuildercreateForeignKeyComboBoxPanel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, Supplier<EntityEditPanel> editPanelSupplier) Creates a builder for a foreign key combo box panel with optional buttons for adding and editing items.protected final is.codion.swing.common.ui.component.label.LabelBuilder<is.codion.framework.domain.entity.Entity>createForeignKeyLabel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for a read-only foreign key label.protected final EntitySearchField.BuildercreateForeignKeySearchField(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for foreign key search fields.protected final EntitySearchFieldPanel.BuildercreateForeignKeySearchFieldPanel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, Supplier<EntityEditPanel> editPanelSupplier) Creates a builder for a foreign key search field panel with optional buttons for adding and editing items.protected final <B extends is.codion.swing.common.ui.component.text.TextFieldBuilder<is.codion.framework.domain.entity.Entity,JTextField, B>>
is.codion.swing.common.ui.component.text.TextFieldBuilder<is.codion.framework.domain.entity.Entity,JTextField, B> createForeignKeyTextField(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for a read-only, non-focusable foreign key text field.protected final JPanelcreateInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a panel containing a label and the component associated with the given attribute.protected final JPanelcreateInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent) Creates a panel containing a label and the component associated with the given attribute.protected final JPanelcreateInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent, String labelBorderLayoutConstraints) Creates a panel containing a label and the component associated with the given attribute.protected final JPanelcreateInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent, String labelBorderLayoutConstraints, int labelAlignment) Creates a panel containing a label and the given component.protected final JPanelcreateInputPanel(JComponent labelComponent, JComponent inputComponent) Creates a panel containing a label component and theinputComponentwith the label component positioned above the input component.protected final JPanelcreateInputPanel(JComponent labelComponent, JComponent inputComponent, String labelBorderLayoutConstraints) Creates a panel with a BorderLayout, with theinputComponentatBorderLayout.CENTERand thelabelComponentat a specified location.protected final is.codion.swing.common.ui.component.text.NumberField.Builder<Integer>createIntegerField(is.codion.framework.domain.entity.attribute.Attribute<Integer> attribute) Creates a builder for integer fields.protected final is.codion.swing.common.ui.component.spinner.NumberSpinnerBuilder<Integer>createIntegerSpinner(is.codion.framework.domain.entity.attribute.Attribute<Integer> attribute) Creates a builder for a spinnerprotected final <T> is.codion.swing.common.ui.component.combobox.ItemComboBoxBuilder<T>createItemComboBox(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for value item list combo boxes.protected final <T> is.codion.swing.common.ui.component.spinner.ItemSpinnerBuilder<T>createItemSpinner(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for a list spinnerprotected final <T> is.codion.swing.common.ui.component.label.LabelBuilder<T>createLabel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for a label using the caption and mnemonic associated withattribute.protected final <T> is.codion.swing.common.ui.component.spinner.ListSpinnerBuilder<T>createListSpinner(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, SpinnerListModel spinnerListModel) Creates a builder for a list spinnerprotected final is.codion.swing.common.ui.component.text.NumberField.Builder<Long>createLongField(is.codion.framework.domain.entity.attribute.Attribute<Long> attribute) Creates a builder for long fields.protected final is.codion.swing.common.ui.component.text.MaskedTextFieldBuildercreateMaskedTextField(is.codion.framework.domain.entity.attribute.Attribute<String> attribute) Creates a builder for formatted text fields.protected final is.codion.swing.common.ui.component.slider.SliderBuildercreateSlider(is.codion.framework.domain.entity.attribute.Attribute<Integer> attribute) Creates a builder for a sliderprotected final <T extends Temporal>
is.codion.swing.common.ui.component.text.TemporalField.Builder<T>createTemporalField(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for temporal fields.protected final <T extends Temporal>
is.codion.swing.common.ui.component.text.TemporalField.Builder<T>createTemporalField(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, String dateTimePattern) Creates a builder for temporal fields.protected final <T extends Temporal>
is.codion.swing.common.ui.component.text.TemporalFieldPanel.Builder<T>createTemporalFieldPanel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for temporal field panels.protected final <T extends Temporal>
is.codion.swing.common.ui.component.text.TemporalFieldPanel.Builder<T>createTemporalFieldPanel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, String dateTimePattern) Creates a builder for temporal field panels.protected final is.codion.swing.common.ui.component.text.TextAreaBuildercreateTextArea(is.codion.framework.domain.entity.attribute.Attribute<String> attribute) Creates a builder for text areas.protected final <T,C extends JTextField, B extends is.codion.swing.common.ui.component.text.TextFieldBuilder<T, C, B>>
is.codion.swing.common.ui.component.text.TextFieldBuilder<T,C, B> createTextField(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for text fields.protected final is.codion.swing.common.ui.component.text.TextFieldPanel.BuildercreateTextFieldPanel(is.codion.framework.domain.entity.attribute.Attribute<String> attribute) Creates a builder for text field panels.protected final voiddisplayException(Throwable exception) Displays the exception in a dialogfinal <T extends is.codion.swing.framework.model.SwingEntityEditModel>
Tfinal voidexcludeComponentsFromSelection(is.codion.framework.domain.entity.attribute.Attribute<?>... attributes) Specifies that the given attributes should be excluded when presenting a component selection list.protected JComponentprotected JComponentfinal is.codion.common.value.Value<is.codion.framework.domain.entity.attribute.Attribute<?>>Sets the component associated with the given attribute as the component that should receive the initial focus in this edit panel.final is.codion.common.value.Value<JComponent>Sets the component that should receive the focus when the UI is cleared or activated.protected voidonException(Throwable exception) Handles the given exception, simply displays the error message to the user by default.protected final voidprotected final voidfinal voidrequestComponentFocus(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Request focus for the component associated with the given attribute.final voidSets the initial focus, if an initial focus component or component attribute has been set that component receives the focus, if not, or if that component is not focusable, this panel receives the focus.final Collection<is.codion.framework.domain.entity.attribute.Attribute<?>>final voidDisplays a dialog allowing the user the select an input component which should receive the keyboard focus, if only one input component is available then that component is selected automatically.protected final voidsetComponent(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent component) Associates the given input component with the given attribute.protected final voidsetDefaultTextFieldColumns(int defaultTextFieldColumns) Sets the default number of text field columnsprotected final voidsetTransferFocusOnEnter(boolean transferFocusOnEnter) If set to true then components created subsequently will transfer focus on enter, otherwise not.protected final voidsetUseModifiedIndicator(boolean useModifiedIndicator) If set to true then component labels will indicate that the value is modified.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
USE_MODIFIED_INDICATOR
Specifies whether label text should be underlined to indicate that the associated value is modified
Value type: Boolean
Default value: true- See Also:
-
MODIFIED_INDICATOR_UNDERLINE_STYLE
public static final is.codion.common.property.PropertyValue<Integer> MODIFIED_INDICATOR_UNDERLINE_STYLEThe type of underline to use to indicate a modified value
Value type: Integer
Default value:TextAttribute.UNDERLINE_LOW_DOTTED
Valid values:TextAttribute.UNDERLINE_*- See Also:
-
-
Constructor Details
-
EntityEditComponentPanel
protected EntityEditComponentPanel(is.codion.swing.framework.model.SwingEntityEditModel editModel) Instantiates a new EntityEditComponentPanel- Parameters:
editModel- the edit model
-
EntityEditComponentPanel
protected EntityEditComponentPanel(is.codion.swing.framework.model.SwingEntityEditModel editModel, EntityComponents entityComponents) Instantiates a new EntityEditComponentPanel- Parameters:
editModel- the edit modelentityComponents- the entity components to use when creating components- Throws:
IllegalArgumentException- in case the edit model and entity components entityTypes don't match
-
-
Method Details
-
editModel
public final <T extends is.codion.swing.framework.model.SwingEntityEditModel> T editModel()- Type Parameters:
T- the edit model type- Returns:
- the edit model this panel is based on
-
attributes
- Returns:
- an unmodifiable view of the attributes that have associated components.
-
component
public final JComponent component(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) - Parameters:
attribute- the attribute- Returns:
- the component associated with the given attribute
- Throws:
IllegalArgumentException- in case no component or component builder has been associated with the given attribute
-
attribute
public final <T> is.codion.framework.domain.entity.attribute.Attribute<T> attribute(JComponent component) - Type Parameters:
T- the attribute type- Parameters:
component- the component- Returns:
- the attribute the given component is associated with
- Throws:
IllegalArgumentException- in case no attribute is associated with the given component
-
initialFocusComponent
Sets the component that should receive the focus when the UI is cleared or activated. Overrides the value set viainitialFocusAttribute()- Returns:
- the Value controlling the initial focus component
-
initialFocusAttribute
public final is.codion.common.value.Value<is.codion.framework.domain.entity.attribute.Attribute<?>> initialFocusAttribute()Sets the component associated with the given attribute as the component that should receive the initial focus in this edit panel. This is overridden byinitialFocusComponent().- Returns:
- the Value controlling the initial focus attribute
- See Also:
-
afterInsertFocusComponent
Sets the component that should receive the focus after an insert has been performed. Overrides the value set viaafterInsertFocusAttribute()- Returns:
- the Value controlling the after insert focus component
-
afterInsertFocusAttribute
public final is.codion.common.value.Value<is.codion.framework.domain.entity.attribute.Attribute<?>> afterInsertFocusAttribute()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 byafterInsertFocusComponent().- Returns:
- the Value controlling the after insert focus attribute
- See Also:
-
requestInitialFocus
public final void requestInitialFocus()Sets the initial focus, if an initial focus component or component attribute has been set that component receives the focus, if not, or if that component is not focusable, this panel receives the focus. Note that if this panel is not visible then calling this method has no effect. -
requestComponentFocus
public final void requestComponentFocus(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Request focus for the component associated with the given attribute. If no component is associated with the attribute calling this method has no effect.- Parameters:
attribute- the attribute of the component to select
-
selectInputComponent
public final void selectInputComponent()Displays a dialog allowing the user the select an input component which should receive the keyboard focus, if only one input component is available then that component is selected automatically. -
selectComponentAttributes
public final Collection<is.codion.framework.domain.entity.attribute.Attribute<?>> selectComponentAttributes()- Returns:
- an unmodifiable view of the attributes to present when selecting an input component in this panel, this returns all (non-excluded) attributes that have an associated component in this panel that is enabled, displayable, visible and focusable.
- See Also:
-
excludeComponentsFromSelection
public final void excludeComponentsFromSelection(is.codion.framework.domain.entity.attribute.Attribute<?>... attributes) Specifies that the given attributes should be excluded when presenting a component selection list.- Parameters:
attributes- the attributes to exclude from selection- See Also:
-
onException
Handles the given exception, simply displays the error message to the user by default.- Parameters:
exception- the exception to handle- See Also:
-
displayException
Displays the exception in a dialog- Parameters:
exception- the exception to display
-
setUseModifiedIndicator
protected final void setUseModifiedIndicator(boolean useModifiedIndicator) If set to true then component labels will indicate that the value is modified. This applies to all components created by this edit component panel as well as components set viasetComponent(Attribute, JComponent)as long as the component has a JLabel associated with its 'labeledBy' client property. Note that this has no effect on components that have already been created.- Parameters:
useModifiedIndicator- the new value- See Also:
-
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
-
setDefaultTextFieldColumns
protected final void setDefaultTextFieldColumns(int defaultTextFieldColumns) Sets the default number of text field columns- Parameters:
defaultTextFieldColumns- the default text field columns- See Also:
-
setComponent
protected final void setComponent(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent component) Associates the given input component with the given attribute.- Parameters:
attribute- the attributecomponent- the input component
-
addInputPanel
protected final void addInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Adds a panel for the given attribute to this panel- Parameters:
attribute- the attribute- See Also:
-
addInputPanel
protected final void addInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, Object constraints) Adds a panel for the given attribute to this panel using the given layout constraints- Parameters:
attribute- the attributeconstraints- the layout constraints- See Also:
-
addInputPanel
protected final void addInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent) Adds a panel for the given attribute to this panel- Parameters:
attribute- the attributeinputComponent- a component bound toattribute- See Also:
-
addInputPanel
protected final void addInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent, Object constraints) Adds a panel for the given attribute to this panel using the given layout constraints- Parameters:
attribute- the attributeinputComponent- a component bound toattributeconstraints- the layout constraints- See Also:
-
createInputPanel
protected final JPanel createInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a panel containing a label and the component associated with the given attribute. The label text is the caption defined forattribute. 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
-
createInputPanel
protected final JPanel createInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent) Creates a panel containing a label and the component associated with the given attribute. The label text is the caption defined forattribute. The default layout of the resulting panel is with the label on top andinputComponentbelow.- Parameters:
attribute- the attribute from which definition to retrieve the label captioninputComponent- a component bound to the value ofattribute- Returns:
- a panel containing a label and a component
-
createInputPanel
protected final JPanel createInputPanel(is.codion.framework.domain.entity.attribute.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 defined for onattribute.- Parameters:
attribute- the attribute from which definition to retrieve the label captioninputComponent- a component bound to the value ofattributelabelBorderLayoutConstraints-BorderLayout.NORTH,BorderLayout.SOUTH,BorderLayout.EASTorBorderLayout.WEST- Returns:
- a panel containing a label and a component
-
createInputPanel
protected final JPanel createInputPanel(is.codion.framework.domain.entity.attribute.Attribute<?> attribute, JComponent inputComponent, String labelBorderLayoutConstraints, int labelAlignment) Creates a panel containing a label and the given component. The label text is the caption ofattribute.- Parameters:
attribute- the attribute from which definition to retrieve the label captioninputComponent- a component bound to the value ofattributelabelBorderLayoutConstraints-BorderLayout.NORTH,BorderLayout.SOUTH,BorderLayout.EASTorBorderLayout.WESTlabelAlignment- the label alignment- Returns:
- a panel containing a label and a component
-
createInputPanel
Creates a panel containing a label component and theinputComponentwith the label component positioned above the input component.- Parameters:
labelComponent- the label componentinputComponent- 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 theinputComponentatBorderLayout.CENTERand thelabelComponentat a specified location.- Parameters:
labelComponent- the label componentinputComponent- a input componentlabelBorderLayoutConstraints-BorderLayout.NORTH,BorderLayout.SOUTH,BorderLayout.EASTorBorderLayout.WEST- Returns:
- a panel containing a label and a component
-
createTextArea
protected final is.codion.swing.common.ui.component.text.TextAreaBuilder createTextArea(is.codion.framework.domain.entity.attribute.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
-
createTextFieldPanel
protected final is.codion.swing.common.ui.component.text.TextFieldPanel.Builder createTextFieldPanel(is.codion.framework.domain.entity.attribute.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
-
createTemporalFieldPanel
protected final <T extends Temporal> is.codion.swing.common.ui.component.text.TemporalFieldPanel.Builder<T> createTemporalFieldPanel(is.codion.framework.domain.entity.attribute.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
-
createTemporalFieldPanel
protected final <T extends Temporal> is.codion.swing.common.ui.component.text.TemporalFieldPanel.Builder<T> createTemporalFieldPanel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, String dateTimePattern) Creates a builder for temporal field panels.- Type Parameters:
T- the temporal type- Parameters:
attribute- the attribute for which to build a temporal field paneldateTimePattern- the date time pattern- Returns:
- a text area builder
-
createTextField
protected final <T,C extends JTextField, is.codion.swing.common.ui.component.text.TextFieldBuilder<T,B extends is.codion.swing.common.ui.component.text.TextFieldBuilder<T, C, B>> C, createTextFieldB> (is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for text fields.- Type Parameters:
T- the value typeC- the text field typeB- the builder type- Parameters:
attribute- the attribute for which to build a text field- Returns:
- a text field builder
-
createTemporalField
protected final <T extends Temporal> is.codion.swing.common.ui.component.text.TemporalField.Builder<T> createTemporalField(is.codion.framework.domain.entity.attribute.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
-
createTemporalField
protected final <T extends Temporal> is.codion.swing.common.ui.component.text.TemporalField.Builder<T> createTemporalField(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, String dateTimePattern) Creates a builder for temporal fields.- Type Parameters:
T- the temporal type- Parameters:
attribute- the attribute for which to build a temporal fielddateTimePattern- the date time pattern- Returns:
- an offset date time field builder
-
createSlider
protected final is.codion.swing.common.ui.component.slider.SliderBuilder createSlider(is.codion.framework.domain.entity.attribute.Attribute<Integer> attribute) Creates a builder for a slider- Parameters:
attribute- the attribute- Returns:
- a slider builder
-
createIntegerSpinner
protected final is.codion.swing.common.ui.component.spinner.NumberSpinnerBuilder<Integer> createIntegerSpinner(is.codion.framework.domain.entity.attribute.Attribute<Integer> attribute) Creates a builder for a spinner- Parameters:
attribute- the attribute- Returns:
- a spinner builder
-
createDoubleSpinner
protected final is.codion.swing.common.ui.component.spinner.NumberSpinnerBuilder<Double> createDoubleSpinner(is.codion.framework.domain.entity.attribute.Attribute<Double> attribute) Creates a builder for a spinner- Parameters:
attribute- the attribute- Returns:
- a spinner builder
-
createListSpinner
protected final <T> is.codion.swing.common.ui.component.spinner.ListSpinnerBuilder<T> createListSpinner(is.codion.framework.domain.entity.attribute.Attribute<T> attribute, SpinnerListModel spinnerListModel) Creates a builder for a list spinner- Type Parameters:
T- the value type- Parameters:
attribute- the attributespinnerListModel- the spinner model- Returns:
- a spinner builder
-
createItemSpinner
protected final <T> is.codion.swing.common.ui.component.spinner.ItemSpinnerBuilder<T> createItemSpinner(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for a list spinner- Type Parameters:
T- the value type- Parameters:
attribute- the attribute- Returns:
- a spinner builder
-
createIntegerField
protected final is.codion.swing.common.ui.component.text.NumberField.Builder<Integer> createIntegerField(is.codion.framework.domain.entity.attribute.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 is.codion.swing.common.ui.component.text.NumberField.Builder<Long> createLongField(is.codion.framework.domain.entity.attribute.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 is.codion.swing.common.ui.component.text.NumberField.Builder<Double> createDoubleField(is.codion.framework.domain.entity.attribute.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 is.codion.swing.common.ui.component.text.NumberField.Builder<BigDecimal> createBigDecimalField(is.codion.framework.domain.entity.attribute.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
-
createMaskedTextField
protected final is.codion.swing.common.ui.component.text.MaskedTextFieldBuilder createMaskedTextField(is.codion.framework.domain.entity.attribute.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
-
createCheckBox
protected final is.codion.swing.common.ui.component.button.CheckBoxBuilder createCheckBox(is.codion.framework.domain.entity.attribute.Attribute<Boolean> attribute) Creates a builder for check boxes. IfCheckBoxBuilder.nullable(boolean)is set to true, aNullableCheckBoxis built.- Parameters:
attribute- the attribute for which to build a check-box- Returns:
- a check-box builder
-
createBooleanComboBox
protected final is.codion.swing.common.ui.component.combobox.ItemComboBoxBuilder<Boolean> createBooleanComboBox(is.codion.framework.domain.entity.attribute.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,C extends JComboBox<T>, is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T,B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T, C, B>> C, createComboBoxB> (is.codion.framework.domain.entity.attribute.Attribute<T> attribute, ComboBoxModel<T> comboBoxModel) Creates a builder for combo boxes.- Type Parameters:
T- the value typeC- the component typeB- the builder type- Parameters:
attribute- the attribute for which to build combo boxcomboBoxModel- the combo box model- Returns:
- a combo box builder
-
createItemComboBox
protected final <T> is.codion.swing.common.ui.component.combobox.ItemComboBoxBuilder<T> createItemComboBox(is.codion.framework.domain.entity.attribute.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
-
createComboBox
protected final <T,C extends JComboBox<T>, is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T,B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<T, C, B>> C, createComboBoxB> (is.codion.framework.domain.entity.attribute.Column<T> column) Creates a builder for a combo boxe, containing the values of the given column.- Type Parameters:
T- the value typeC- the component typeB- the builder type- Parameters:
column- the column for which to build a combo box- Returns:
- a combo box builder
-
createForeignKeyComboBox
protected final <B extends is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<is.codion.framework.domain.entity.Entity,EntityComboBox, is.codion.swing.common.ui.component.combobox.ComboBoxBuilder<is.codion.framework.domain.entity.Entity,B>> EntityComboBox, createForeignKeyComboBoxB> (is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for foreign key combo boxes.- Type Parameters:
B- the builder type- Parameters:
foreignKey- the foreign key for which to build a combo box- Returns:
- a foreign key combo box builder
-
createForeignKeyComboBoxPanel
protected final EntityComboBoxPanel.Builder createForeignKeyComboBoxPanel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, Supplier<EntityEditPanel> editPanelSupplier) Creates a builder for a foreign key combo box panel with optional buttons for adding and editing items.- Parameters:
foreignKey- the foreign keyeditPanelSupplier- the edit panel supplier to use for the add and/or edit buttons- Returns:
- a foreign key combo box panel builder
-
createForeignKeySearchField
protected final EntitySearchField.Builder createForeignKeySearchField(is.codion.framework.domain.entity.attribute.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
-
createForeignKeySearchFieldPanel
protected final EntitySearchFieldPanel.Builder createForeignKeySearchFieldPanel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey, Supplier<EntityEditPanel> editPanelSupplier) Creates a builder for a foreign key search field panel with optional buttons for adding and editing items.- Parameters:
foreignKey- the foreign keyeditPanelSupplier- the edit panel supplier to use for the add and/or edit buttons- Returns:
- a foreign key combo box panel builder
-
createForeignKeyTextField
protected final <B extends is.codion.swing.common.ui.component.text.TextFieldBuilder<is.codion.framework.domain.entity.Entity,JTextField, is.codion.swing.common.ui.component.text.TextFieldBuilder<is.codion.framework.domain.entity.Entity,B>> JTextField, createForeignKeyTextFieldB> (is.codion.framework.domain.entity.attribute.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
-
createForeignKeyLabel
protected final is.codion.swing.common.ui.component.label.LabelBuilder<is.codion.framework.domain.entity.Entity> createForeignKeyLabel(is.codion.framework.domain.entity.attribute.ForeignKey foreignKey) Creates a builder for a read-only foreign key label.- Parameters:
foreignKey- the foreign key for which to build a label- Returns:
- a foreign key label builder
-
createLabel
protected final <T> is.codion.swing.common.ui.component.label.LabelBuilder<T> createLabel(is.codion.framework.domain.entity.attribute.Attribute<T> attribute) Creates a builder for a label using the caption and mnemonic associated withattribute. If an input component exists for the given attribute the label is associated with it viaJLabel.setLabelFor(Component).- Type Parameters:
T- the attribute type- Parameters:
attribute- the attribute from which to retrieve the caption- Returns:
- a label builder for the given attribute
-
getInitialFocusComponent
- Returns:
- the component that should get the initial focus when the UI is initialized
-
getAfterInsertFocusComponent
- Returns:
- the component that should receive the focus when the UI is initialized after insert
-
requestAfterInsertFocus
protected final void requestAfterInsertFocus() -
requestAfterUpdateFocus
protected final void requestAfterUpdateFocus()
-