Module is.codion.swing.framework.ui
Package is.codion.swing.framework.ui
Interface EntityEditorPanel.EditorComponent<T>
- Type Parameters:
T- the value type
- Enclosing class:
EntityEditorPanel
protected static interface EntityEditorPanel.EditorComponent<T>
Manages the component used to edit an attribute
-
Method Summary
Modifier and TypeMethodDescriptionget()label()optional()voidreplace(JComponent component) Replaces an already set component.<C extends JComponent,B extends ComponentValueBuilder<C, T, B>>
Bset(B componentBuilder) Associates the given component builder with this attribute, configuring it with standard defaults (caption, mnemonic, enabled state, focus transfer, tooltips, and valid/modified indicators) and linking it to the underlying editor value.voidset(ComponentValue<? extends JComponent, T> componentValue) Sets the component and links the value with the underlying editor valuevoidset(JComponent component) Note that when setting the component directly using this method, no value linking is performed.
-
Method Details
-
get
JComponent get()- Returns:
- the component
- Throws:
IllegalStateException- in case no component has been set
-
optional
Optional<JComponent> optional()- Returns:
- the component or an empty Optional in case none has been set
-
set
Note that when setting the component directly using this method, no value linking is performed.- Parameters:
component- the component- Throws:
IllegalStateException- in case the component has already been set- See Also:
-
set
Sets the component and links the value with the underlying editor value- Parameters:
componentValue- the component value
-
set
Associates the given component builder with this attribute, configuring it with standard defaults (caption, mnemonic, enabled state, focus transfer, tooltips, and valid/modified indicators) and linking it to the underlying editor value.This method enables integration of custom or third-party components by extending
AbstractComponentValueBuilder.- Type Parameters:
C- the component typeB- the component builder type- Parameters:
componentBuilder- the component builder providing the component for the attribute- Returns:
- the component builder
- Throws:
IllegalStateException- in case a component or a component builder has already been associated with the attribute
-
replace
Replaces an already set component. Note that when replacing the component using this method, no value linking is performed.- Parameters:
component- the component- Throws:
IllegalStateException- in case no component has been previously set- See Also:
-
label
JLabel label()- Returns:
- the label associated with the component
- Throws:
IllegalStateException- in case no component has been set or if no label is associated with it- See Also:
-