Module is.codion.swing.framework.ui
Package is.codion.swing.framework.ui
Class EntityEditPanel.Config
java.lang.Object
is.codion.swing.framework.ui.EntityEditPanel.Config
- Enclosing class:
EntityEditPanel
Contains configuration settings for a
EntityEditPanel which must be set before the panel is initialized.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Boolean> Indicates whether the panel should ask for confirmation before deleting Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Indicates whether the panel should ask for confirmation before inserting Value type: Boolean Default value: falsestatic final PropertyValue<Boolean> Indicates whether the panel should ask for confirmation before updating Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Specifies whether to include aEntityVieweraction on this edit panel, triggered with CTRL-ALT-V by default.static final PropertyValue<Boolean> Specifies whether to include a Query Inspector on this edit panel, triggered with CTRL-ALT-Q.static final PropertyValue<Boolean> Specifies whether components should indicate that the value is modified Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Indicates whether the panel should ask for confirmation before discarding unsaved modifications Value type: Boolean Default value: falsestatic final PropertyValue<Integer> Specifies the default number of text field columns Value type: Integer Default value: 12static final PropertyValue<Boolean> Specifies whether components should transfer focus on enter Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Specifies whether edit panels should be activated when the panel (or its parent EntityPanel) receives focus Value type: Boolean Default value: truestatic final PropertyValue<Boolean> Specifies whether the add/insert button caption should be 'Save' (mnemonic S), instead of 'Add' (mnemonic A) Value type: Boolean Default value: falsestatic final PropertyValue<Boolean> Specifies whether components should indicate the validity of their current value Value type: Boolean Default value: true -
Method Summary
Modifier and TypeMethodDescriptionclearAfterInsert(boolean clearAfterInsert) confirmDelete(boolean confirmDelete) confirmInsert(boolean confirmInsert) confirmUpdate(boolean confirmUpdate) deleteConfirmer(EntityEditPanel.Confirmer deleteConfirmer) excludeFromSelection(Collection<Attribute<?>> excludeFromSelection) Specifies the attributes that should be excluded when presenting a component selection list.focusActivation(boolean focusActivation) includeEntityViewer(boolean includeEntityViewer) includeQueryInspector(boolean includeQueryInspector) insertConfirmer(EntityEditPanel.Confirmer insertConfirmer) keyStroke(ControlKey<?> controlKey, Consumer<Value<KeyStroke>> keyStroke) modifiedIndicator(boolean modifiedIndicator) If set to true then component labels will indicate that the value is modified.modifiedWarning(boolean modifiedWarning) referentialIntegrityErrorHandling(ReferentialIntegrityErrorHandling referentialIntegrityErrorHandling) requestFocusAfterInsert(boolean requestFocusAfterInsert) textFieldColumns(int textFieldColumns) Specifies the default number of text field columnstransferFocusOnEnter(boolean transferFocusOnEnter) updateConfirmer(EntityEditPanel.Confirmer updateConfirmer) validIndicator(boolean validIndicator) If set to true then components will indicate whether the current value is valid.
-
Field Details
-
USE_SAVE_CAPTION
Specifies whether the add/insert button caption should be 'Save' (mnemonic S), instead of 'Add' (mnemonic A)- Value type: Boolean
- Default value: false
-
INCLUDE_ENTITY_VIEWER
Specifies whether to include aEntityVieweraction on this edit panel, triggered with CTRL-ALT-V by default.- Value type: Boolean
- Default value: true
-
INCLUDE_QUERY_INSPECTOR
Specifies whether to include a Query Inspector on this edit panel, triggered with CTRL-ALT-Q.- Value type: Boolean
- Default value: false
-
USE_FOCUS_ACTIVATION
Specifies whether edit panels should be activated when the panel (or its parent EntityPanel) receives focus- Value type: Boolean
- Default value: true
-
CONFIRM_INSERT
Indicates whether the panel should ask for confirmation before inserting- Value type: Boolean
- Default value: false
-
CONFIRM_UPDATE
Indicates whether the panel should ask for confirmation before updating- Value type: Boolean
- Default value: true
-
CONFIRM_DELETE
Indicates whether the panel should ask for confirmation before deleting- Value type: Boolean
- Default value: true
-
MODIFIED_WARNING
Indicates whether the panel should ask for confirmation before discarding unsaved modifications- Value type: Boolean
- Default value: false
-
VALID_INDICATOR
Specifies whether components should indicate the validity of their current value- Value type: Boolean
- Default value: true
- See Also:
-
MODIFIED_INDICATOR
Specifies whether components should indicate that the value is modified- Value type: Boolean
- Default value: true
- See Also:
-
TRANSFER_FOCUS_ON_ENTER
Specifies whether components should transfer focus on enter- Value type: Boolean
- Default value: true
-
TEXT_FIELD_COLUMNS
Specifies the default number of text field columns- Value type: Integer
- Default value: 12
-
-
Method Details
-
keyStroke
public EntityEditPanel.Config keyStroke(ControlKey<?> controlKey, Consumer<Value<KeyStroke>> keyStroke) - Parameters:
controlKey- the control keykeyStroke- provides access to theValuecontrolling the keyStroke for the given control- Returns:
- this Config instance
-
clearAfterInsert
- Parameters:
clearAfterInsert- controls whether the UI should be cleared after insert has been performed- Returns:
- this Config instance
-
requestFocusAfterInsert
- Parameters:
requestFocusAfterInsert- controls whether the UI should request focus after insert has been performed- Returns:
- this Config instance
- See Also:
-
referentialIntegrityErrorHandling
public EntityEditPanel.Config referentialIntegrityErrorHandling(ReferentialIntegrityErrorHandling referentialIntegrityErrorHandling) - Parameters:
referentialIntegrityErrorHandling- controls which action to take on a referential integrity error on delete- Returns:
- this Config instance
-
focusActivation
- Parameters:
focusActivation- true if the edit panel should be activated when it or its parent EntityPanel receives focus- Returns:
- this Config instance
- See Also:
-
includeEntityViewer
- Parameters:
includeEntityViewer- true if aEntityVieweraction should be available in this panel, triggered with CTRL-ALT-V.- Returns:
- this Config instance
- See Also:
-
includeQueryInspector
- Parameters:
includeQueryInspector- true if a Query Inspector should be available in this edit panel, triggered with CTRL-ALT-Q.- Returns:
- this Config instance
-
confirmInsert
- Parameters:
confirmInsert- whether to confirm before inserting- Returns:
- this Config instance
- See Also:
-
confirmUpdate
- Parameters:
confirmUpdate- whether to confirm before updating- Returns:
- this Config instance
- See Also:
-
confirmDelete
- Parameters:
confirmDelete- whether to confirm before deleting- Returns:
- this Config instance
- See Also:
-
insertConfirmer
- Parameters:
insertConfirmer- the insert confirmer- Returns:
- this Config instance
- See Also:
-
deleteConfirmer
- Parameters:
deleteConfirmer- the delete confirmer- Returns:
- this Config instance
- See Also:
-
updateConfirmer
- Parameters:
updateConfirmer- the update confirmer- Returns:
- this Config instance
- See Also:
-
excludeFromSelection
Specifies the attributes that should be excluded when presenting a component selection list.- Parameters:
excludeFromSelection- aCollectioncontaining the attributes to exclude from component selection- Returns:
- this Config instance
- Throws:
IllegalArgumentException- in case an attribute is not found in the underlying entity- See Also:
-
modifiedWarning
- Parameters:
modifiedWarning- specifies whether this edit panel presents a warning before discarding unsaved modifications- Returns:
- this Config instance
- See Also:
-
validIndicator
If set to true then components will indicate whether the current value is valid. This applies to all components created by this edit component panel as well as components set viaEntityEditPanel.component(Attribute)- Parameters:
validIndicator- specifies whether components should indicate validity- Returns:
- this Config instance
- See Also:
-
modifiedIndicator
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 viaEntityEditPanel.component(Attribute)as long as the component has a JLabel associated with its 'labeledBy' client property.- Parameters:
modifiedIndicator- specifies whether components should indicate modification- Returns:
- this Config instance
- See Also:
-
textFieldColumns
Specifies the default number of text field columns- Parameters:
textFieldColumns- the default number of text field columns- Returns:
- this Config instance
- See Also:
-
transferFocusOnEnter
- Parameters:
transferFocusOnEnter- specifies whether components will transfer focus on enter- Returns:
- this Config instance
- See Also:
-