Class EditorComponents
SwingEntityEditor-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefaults applied to a component builder when set, changing these has no effect on previously created components.static final classCreatesSwingEntityEditorbased componentsfinal classManages detailEditorComponents.final classstatic interfaceThe attributes which components have a persist toggle, seepersistToggle(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Boolean> Specifies whether every field gets a persist toggle by default, thepersistToggle()set of each instance, detail instances included, then containing every attribute it accepts when the instance is created, as byEditorComponents.PersistToggle.all(), an attribute removed opting its field out.static final PropertyValue<Integer> Specifies the default number of text field columns, applying to text fields, search fields, text inputs and temporal inputs, masked text fields excluded, 0 disabling the default, the fields then sizing to their contents Value type: Integer Default value: 12 -
Method Summary
Modifier and TypeMethodDescriptioncreate()defaults()detail()editor()static EditorComponentseditorComponents(SwingEntityEditor editor) Specifies the attributes which components have a persist toggle, letting the user choose whether their values persist when the editor is reset to its defaults, after an insert or on clear.
-
Field Details
-
TEXT_FIELD_COLUMNS
Specifies the default number of text field columns, applying to text fields, search fields, text inputs and temporal inputs, masked text fields excluded, 0 disabling the default, the fields then sizing to their contents- Value type: Integer
- Default value: 12
- See Also:
-
PERSIST_TOGGLE
Specifies whether every field gets a persist toggle by default, thepersistToggle()set of each instance, detail instances included, then containing every attribute it accepts when the instance is created, as byEditorComponents.PersistToggle.all(), an attribute removed opting its field out.- Value type: Boolean
- Default value: false
- See Also:
-
-
Method Details
-
editor
- Returns:
- the underlying editor
-
defaults
- Returns:
- the component defaults, shared with the detail
EditorComponentsinstances - See Also:
-
create
- Returns:
- the
EditorComponents.ComponentFactoryinstance
-
component
- Type Parameters:
T- the value type- Parameters:
attribute- the attribute- Returns:
- the
EditorComponents.EditorComponentcontaining the component associated with the given attribute
-
detail
- Returns:
- the
EditorComponents.DetailEditorComponentsinstance - See Also:
-
persistToggle
Specifies the attributes which components have a persist toggle, letting the user choose whether their values persist when the editor is reset to its defaults, after an insert or on clear.A pin following the caption of the component's label shows the state, dimmed while the value does not persist. Clicking the pin toggles it, as does the
EntityEditPanel.ControlKeys.PERSISTkey stroke while the component has the focus. A component without a label gets the key stroke alone.The pin shows, and the toggle is enabled, only while the edit panel can insert, its editor being neither read-only nor insert disabled, a persisted value applying when a new entity is started.
The
EntityEditPanelapplies the persist toggles of itsEditorComponents, and of theirdetail()instances, when initialized, locking this set. The states the user changes are stored with the edit panel preferences.EditorComponents.PersistToggle.all()adds every attribute this set accepts, an attribute removed opting its field out, and those without a component being skipped on initialization. WithPERSIST_TOGGLEset, the set contains them when the instance is created. An attribute added otherwise must have a component.Adding an attribute throws
IllegalArgumentExceptionin case it is not found in the underlying entity, is derived, or is a read-only column or a foreign key based on read-only columns, having no value for the user to set, or, for a detail instance, in case it is the foreign key linking the detail editor to its master.- Returns:
- the
EditorComponents.PersistTogglespecifying the attributes which components have a persist toggle - See Also:
-
editorComponents
- Parameters:
editor- the editor- Returns:
- a new
EditorComponentsinstance
-