Module is.codion.swing.framework.ui
Class DefaultEditComponentFactory<C extends JComponent,T>
java.lang.Object
is.codion.swing.framework.ui.component.DefaultEditComponentFactory<C,T>
- Type Parameters:
C- the component typeT- the attribute type
- All Implemented Interfaces:
EditComponentFactory<C,T>
public class DefaultEditComponentFactory<C extends JComponent,T>
extends Object
implements EditComponentFactory<C,T>
A default
EditComponentFactory implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Integer> Specifies the default number of text field columns Value type: Integer Default value: 20 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EntityComboBox.BuildercomboBox(ForeignKey foreignKey, EntityDefinition entityDefinition, EntityComboBoxModel comboBoxModel) component(SwingEntityEditModel editModel) Provides an inputComponentValuefor editing a single attribute value for one or more entities.protected EntitySearchField.SingleSelectionBuildersearchField(ForeignKey foreignKey, EntityDefinition entityDefinition, EntitySearchModel searchModel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface is.codion.swing.framework.ui.component.EditComponentFactory
caption
-
Field Details
-
DEFAULT_TEXT_FIELD_COLUMNS
Specifies the default number of text field columns- Value type: Integer
- Default value: 20
-
-
Constructor Details
-
DefaultEditComponentFactory
- Parameters:
attribute- the attribute for which this factory creates aComponentValue
-
-
Method Details
-
component
Description copied from interface:EditComponentFactoryProvides an inputComponentValuefor editing a single attribute value for one or more entities.- Specified by:
componentin interfaceEditComponentFactory<C extends JComponent,T> - Parameters:
editModel- the edit model used to create foreign key input models- Returns:
- a new
ComponentValueinstance
-
attribute
- Returns:
- the attribute
-
comboBox
protected EntityComboBox.Builder comboBox(ForeignKey foreignKey, EntityDefinition entityDefinition, EntityComboBoxModel comboBoxModel) - Parameters:
foreignKey- the foreign keyentityDefinition- the entity definitioncomboBoxModel- theEntityComboBoxModelto base the combo box on- Returns:
- a
EntityComboBox.Builderinstance
-
searchField
protected EntitySearchField.SingleSelectionBuilder searchField(ForeignKey foreignKey, EntityDefinition entityDefinition, EntitySearchModel searchModel) - Parameters:
foreignKey- the foreign keyentityDefinition- the entity definitionsearchModel- theEntitySearchModelto base the search field on- Returns:
- a
EntitySearchField.SingleSelectionBuilderinstance - Throws:
IllegalArgumentException- in casesearchModelis not configured for single selection
-