Package is.codion.swing.framework.model
Interface SwingEntityModel.Builder
- Enclosing class:
- SwingEntityModel
public static interface SwingEntityModel.Builder
Builds a
SwingEntityModel
.-
Method Summary
Modifier and TypeMethodDescriptionbuildEditModel
(EntityConnectionProvider connectionProvider) Builds aSwingEntityEditModel
instancebuildModel
(EntityConnectionProvider connectionProvider) Builds aSwingEntityModel
instancebuildTableModel
(EntityConnectionProvider connectionProvider) Builds aSwingEntityTableModel
instancedetailModelBuilder
(SwingEntityModel.Builder detailModelBuilder) Adds a detail model builder to this model buildereditModelClass
(Class<? extends SwingEntityEditModel> editModelClass) Sets the edit model classeditModelFactory
(Function<EntityConnectionProvider, SwingEntityEditModel> editModelFactory) Takes precedence overeditModelClass(Class)
.modelClass
(Class<? extends SwingEntityModel> modelClass) Sets the model classmodelFactory
(Function<EntityConnectionProvider, SwingEntityModel> modelFactory) Takes precedence overmodelClass(Class)
.onBuildEditModel
(Consumer<SwingEntityEditModel> onBuildEditModel) onBuildModel
(Consumer<SwingEntityModel> onBuildModel) onBuildTableModel
(Consumer<SwingEntityTableModel> onBuildTableModel) tableModelClass
(Class<? extends SwingEntityTableModel> tableModelClass) Sets the table model classtableModelFactory
(Function<EntityConnectionProvider, SwingEntityTableModel> tableModelFactory) Takes precedence overtableModelClass(Class)
.
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the underlying entity type
-
modelClass
Sets the model class- Parameters:
modelClass
- the model class- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case the edit or table model classes have already been set
-
editModelClass
Sets the edit model class- Parameters:
editModelClass
- the edit model class- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case the model class has already been setIllegalStateException
- in case the table model class has already been set
-
tableModelClass
Sets the table model class- Parameters:
tableModelClass
- the table model class- Returns:
- this builder instance
- Throws:
IllegalStateException
- in case the model class has already been setIllegalStateException
- in case the edit model class has already been set
-
modelFactory
SwingEntityModel.Builder modelFactory(Function<EntityConnectionProvider, SwingEntityModel> modelFactory) Takes precedence overmodelClass(Class)
.- Parameters:
modelFactory
- creates the model- Returns:
- this builder instance
-
editModelFactory
SwingEntityModel.Builder editModelFactory(Function<EntityConnectionProvider, SwingEntityEditModel> editModelFactory) Takes precedence overeditModelClass(Class)
.- Parameters:
editModelFactory
- creates the edit model- Returns:
- this builder instance
-
tableModelFactory
SwingEntityModel.Builder tableModelFactory(Function<EntityConnectionProvider, SwingEntityTableModel> tableModelFactory) Takes precedence overtableModelClass(Class)
.- Parameters:
tableModelFactory
- creates the table model- Returns:
- this builder instance
-
onBuildModel
- Parameters:
onBuildModel
- called after the entity model has been built- Returns:
- this builder instance
-
onBuildEditModel
- Parameters:
onBuildEditModel
- called after the edit model has been built- Returns:
- this builder instance
-
onBuildTableModel
- Parameters:
onBuildTableModel
- called after the table model has been built- Returns:
- this builder instance
-
detailModelBuilder
Adds a detail model builder to this model builder- Parameters:
detailModelBuilder
- the detail model builder to add- Returns:
- this builder instance
-
buildModel
Builds aSwingEntityModel
instance- Parameters:
connectionProvider
- the connection provider- Returns:
- a SwingEntityModel instance
-
buildEditModel
Builds aSwingEntityEditModel
instance- Parameters:
connectionProvider
- the connection provider- Returns:
- a SwingEntityEditModel instance
-
buildTableModel
Builds aSwingEntityTableModel
instance- Parameters:
connectionProvider
- the connection provider- Returns:
- a SwingEntityTableModel instance
-