Module is.codion.swing.framework.ui
Package is.codion.swing.framework.ui
Interface EntityPanel.Builder
- Enclosing class:
- EntityPanel
public static interface EntityPanel.Builder
A builder for
EntityPanel
instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild
(EntityConnectionProvider connectionProvider) Creates an EntityPanel based on this builderbuild
(SwingEntityModel model) Creates an EntityPanel based on this buildercaption()
conditionView
(ConditionPanel.ConditionView conditionView) description
(String description) detailLayout
(Function<EntityPanel, EntityPanel.DetailLayout> detailLayout) detailPanel
(EntityPanel.Builder panelBuilder) Adds the given detail panel builder to this panel builder, if it hasn't been previously addededitPanel
(Class<? extends EntityEditPanel> editPanelClass) filterView
(ConditionPanel.ConditionView filterView) icon()
onBuildEditPanel
(Consumer<EntityEditPanel> onBuildEditPanel) onBuildPanel
(Consumer<EntityPanel> onBuildPanel) onBuildTablePanel
(Consumer<EntityTablePanel> onBuildTablePanel) panel
(Class<? extends EntityPanel> panelClass) Note that setting the EntityPanel class overrides any table panel or edit panel classes that have been set.preferredSize
(Dimension preferredSize) refreshWhenInitialized
(boolean refreshWhenInitialized) Default true.tablePanel
(Class<? extends EntityTablePanel> tablePanelClass)
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the entityType
-
description
- Parameters:
description
- the panel description- Returns:
- this builder instance
-
description
- Returns:
- the description, an empty Optional if none has been set
-
icon
- Parameters:
icon
- the panel icon- Returns:
- this builder instance
-
icon
- Returns:
- the icon, an empty Optional if none has been set
-
detailPanel
Adds the given detail panel builder to this panel builder, if it hasn't been previously added- Parameters:
panelBuilder
- the detail panel provider- Returns:
- this builder instance
-
refreshWhenInitialized
Default true.- Parameters:
refreshWhenInitialized
- if true then the table model this panel is based on will be refreshed when the panel is initialized- Returns:
- this builder instance
-
conditionView
- Parameters:
conditionView
- the initial condition panel view- Returns:
- this builder instance
-
filterView
- Parameters:
filterView
- the initial filter panel view- Returns:
- this builder instance
-
detailLayout
- Parameters:
detailLayout
- provides the detail panel layout to use- Returns:
- this builder instane
-
preferredSize
- Parameters:
preferredSize
- the preferred panel size- Returns:
- this builder instance
-
panel
Note that setting the EntityPanel class overrides any table panel or edit panel classes that have been set.- Parameters:
panelClass
- the EntityPanel class to use when providing this panel- Returns:
- this builder instance
-
editPanel
- Parameters:
editPanelClass
- the EntityEditPanel class to use when providing this panel- Returns:
- this builder instance
-
tablePanel
- Parameters:
tablePanelClass
- the EntityTablePanel class to use when providing this panel- Returns:
- this builder instance
-
onBuildPanel
- Parameters:
onBuildPanel
- called after the entity panel has been built- Returns:
- this builder instance
-
onBuildEditPanel
- Parameters:
onBuildEditPanel
- called after the edit panel has been built- Returns:
- this builder instance
-
onBuildTablePanel
- Parameters:
onBuildTablePanel
- called after the table panel has been built- Returns:
- this builder instance
-
build
Creates an EntityPanel based on this builder- Parameters:
connectionProvider
- the connection provider- Returns:
- an EntityPanel based on this builder
- Throws:
IllegalStateException
- in case noSwingEntityModel.Builder
has been set
-
build
Creates an EntityPanel based on this builder- Parameters:
model
- the EntityModel to base this panel on- Returns:
- an EntityPanel based on this builder
-