Package is.codion.swing.framework.model
Interface SwingEntityModel.Builder
- Enclosing class:
- SwingEntityModel
public static interface SwingEntityModel.Builder
Builds a
SwingEntityModel
.-
Method Summary
Modifier and TypeMethodDescriptionbuild
(EntityConnectionProvider connectionProvider) Builds aSwingEntityModel
instancedetailModel
(SwingEntityModel.Builder detailModelBuilder) Adds a detail model builder to this model buildereditModel
(Class<? extends SwingEntityEditModel> editModelClass) Sets the edit model classeditModel
(Function<EntityConnectionProvider, SwingEntityEditModel> editModelFactory) Takes precedence overeditModel(Class)
.model
(Class<? extends SwingEntityModel> modelClass) Sets the model classmodel
(Function<EntityConnectionProvider, SwingEntityModel> modelFactory) Takes precedence overmodel(Class)
.onBuildEditModel
(Consumer<SwingEntityEditModel> onBuildEditModel) onBuildModel
(Consumer<SwingEntityModel> onBuildModel) onBuildTableModel
(Consumer<SwingEntityTableModel> onBuildTableModel) tableModel
(Class<? extends SwingEntityTableModel> tableModelClass) Sets the table model classtableModel
(Function<EntityConnectionProvider, SwingEntityTableModel> tableModelFactory) Takes precedence overtableModel(Class)
.
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the underlying entity type
-
model
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
-
editModel
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
-
tableModel
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
-
model
Takes precedence overmodel(Class)
.- Parameters:
modelFactory
- creates the model- Returns:
- this builder instance
-
editModel
SwingEntityModel.Builder editModel(Function<EntityConnectionProvider, SwingEntityEditModel> editModelFactory) Takes precedence overeditModel(Class)
.- Parameters:
editModelFactory
- creates the edit model- Returns:
- this builder instance
-
tableModel
SwingEntityModel.Builder tableModel(Function<EntityConnectionProvider, SwingEntityTableModel> tableModelFactory) Takes precedence overtableModel(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
-
detailModel
Adds a detail model builder to this model builder- Parameters:
detailModelBuilder
- the detail model builder to add- Returns:
- this builder instance
-
build
Builds aSwingEntityModel
instance- Parameters:
connectionProvider
- the connection provider- Returns:
- a SwingEntityModel instance
-