java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
is.codion.swing.framework.ui.EntityTablePanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
The EntityTablePanel is a UI class based on the EntityTableModel class.
It consists of a JTable as well as filtering/searching and summary panels.
The default layout is as follows
____________________________________________________ | conditionPanel | |____________________________________________________| | | | | | | | | | entityTable (FilteredTable) | | | | | | | | | |____________________________________________________| | summaryPanel | |____________________________________________________| | southPanel | |____________________________________________________|The condition and summary panels can be hidden Note that
initialize() must be called to initialize this panel before displaying it.- See Also:
-
EntityTableModel- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies how column selection is presented.static enumThe standard controls availablestatic enumSpecifies the refresh button visibility.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final is.codion.common.property.PropertyValue<EntityTablePanel.ColumnSelection>Specifies how column selection is presented to the user.
Value type:EntityTablePanel.ColumnSelection
Default value:EntityTablePanel.ColumnSelection.DIALOGstatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether table condition panels should be visible or not by default
Value type: Boolean
Default value: falsestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether table filter panels should be visible or not by default
Value type: Boolean
Default value: falsestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether to include a 'Clear' control in the popup menu.
Value type: Boolean
Default value: falsestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether to include a condition panel.
Value type: Boolean
Default value: truestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether to include aEntityPopupMenuon this table, triggered with CTRL-ALT-V.
Value type: Boolean
Default value: truestatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether to include a filter panel.
Value type: Boolean
Default value: truestatic final is.codion.common.property.PropertyValue<EntityTablePanel.RefreshButtonVisible>Specifies whether the refresh button should always be visible or only when the condition panel is visible
Value type: Boolean
Default value:EntityTablePanel.RefreshButtonVisible.WHEN_CONDITION_PANEL_IS_VISIBLEstatic final is.codion.common.property.PropertyValue<Boolean>Specifies whether to show an indeterminate progress bar while the model is refreshing.
Value type: Boolean
Default value: falseFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionEntityTablePanel(is.codion.swing.framework.model.SwingEntityTableModel tableModel) Initializes a new EntityTablePanel instanceEntityTablePanel(is.codion.swing.framework.model.SwingEntityTableModel tableModel, EntityConditionPanelFactory conditionPanelFactory) Initializes a new EntityTablePanel instance -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddPopupMenuControls(is.codion.swing.common.ui.control.Controls additionalPopupMenuControls) final voidaddToolBarControls(is.codion.swing.common.ui.control.Controls additionalToolBarControls) protected voidCalled before delete is performed on the selected entities.final is.codion.swing.common.ui.component.table.FilteredTableConditionPanel<is.codion.framework.domain.entity.attribute.Attribute<?>>final is.codion.common.state.Statefinal Optional<is.codion.swing.common.ui.control.Control>control(EntityTablePanel.ControlCode controlCode) protected is.codion.swing.common.ui.control.ControlscreatePopupMenuControls(List<is.codion.swing.common.ui.control.Controls> additionalPopupMenuControls) Creates a Controls instance containing the controls to include in the table popup menu.protected is.codion.swing.common.ui.control.ControlsBy default this method returns aControlsinstance containing theControlassociated withEntityTablePanel.ControlCode.PRINT.protected JToolBarCreates the south panel toolbar, by default based oncreateToolBarControls(List)protected TableCellEditorcreateTableCellEditor(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a TableCellEditor for the given attribute, returns null if no editor is available, such as for non-updatable attributes.protected TableCellRenderercreateTableCellRenderer(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a TableCellRenderer to use for the given attribute in this EntityTablePanelprotected is.codion.swing.common.ui.control.ControlscreateToolBarControls(List<is.codion.swing.common.ui.control.Controls> additionalToolBarControls) final booleandelete()Deletes the entities selected in the underlying table model without asking for confirmation.final booleanDeletes the entities selected in the underlying table model after asking for confirmation using theEntityEditPanel.Confirmerset viasetDeleteConfirmer(Confirmer).protected final voiddisplayException(Throwable exception) Displays the exception in a dialog, with the dialog owner as the current focus owner or this panel if none is available.final is.codion.common.value.ValueSet<is.codion.framework.domain.entity.attribute.Attribute<?>>Specifies the attributes that should be editable in this table panel, such as via the edit selected entities menu.final <T> voideditSelectedEntities(is.codion.framework.domain.entity.attribute.Attribute<T> attributeToEdit) Retrieves a new value via input dialog and performs an update on the selected entities assigning the value to the attributefinal is.codion.common.state.Statefinal EntityTablePanelInitializes the UI, while presenting a wait cursor to the user.protected JPanelInitializes the south panel, override and return null for no south panel.protected voidlayoutPanel(JComponent tableComponent, JPanel southPanel) This method simply addstablePanelat location BorderLayout.CENTER and, if non-null, the givensouthPanelto theBorderLayout.SOUTHlocation.protected voidonException(Throwable exception) Handles the given exception, simply displays the error message to the user by default.protected voidonReferentialIntegrityException(is.codion.common.db.exception.ReferentialIntegrityException exception) Called when aReferentialIntegrityExceptionoccurs during a delete operation on the selected entities.protected voidonValidationException(is.codion.framework.domain.entity.exception.ValidationException exception) Displays the exception message.final voidPrints the tablefinal voidAllows the user to select one of the available search condition panelsfinal voidAllows the user to select one of the available filter condition panelsfinal voidsetColumnSelection(EntityTablePanel.ColumnSelection columnSelection) protected final voidsetControl(EntityTablePanel.ControlCode controlCode, is.codion.swing.common.ui.control.Control control) AssociatescontrolwithcontrolCodefinal voidsetDeleteConfirmer(EntityEditPanel.Confirmer deleteConfirmer) final <T,A extends is.codion.framework.domain.entity.attribute.Attribute<T>, C extends JComponent>
voidsetEditComponentFactory(A attribute, EntityComponentFactory<T, A, C> componentFactory) Sets the component factory for the given attribute, used when editing entities viaeditSelectedEntities(Attribute).final voidsetIncludeClearControl(boolean includeClearControl) final voidsetIncludeConditionPanel(boolean includeConditionPanel) final voidsetIncludeFilterPanel(boolean includeFilterPanel) final voidsetIncludePopupMenu(boolean includePopupMenu) final voidsetIncludeSelectionModeControl(boolean includeSelectionModeControl) final voidsetIncludeSouthPanel(boolean includeSouthPanel) final voidsetReferentialIntegrityErrorHandling(ReferentialIntegrityErrorHandling referentialIntegrityErrorHandling) final voidsetRefreshButtonVisible(EntityTablePanel.RefreshButtonVisible refreshButtonVisible) final <T,A extends is.codion.framework.domain.entity.attribute.Attribute<T>, C extends JComponent>
voidsetTableCellEditorFactory(A attribute, EntityComponentFactory<T, A, C> componentFactory) Sets the table cell editor component factory for the given attribute.protected voidSets up the default keyboard actions.final is.codion.common.state.Statefinal is.codion.common.value.Value<Function<is.codion.swing.framework.model.SwingEntityTableModel,String>> final is.codion.common.state.Statefinal is.codion.swing.common.ui.component.table.FilteredTable<is.codion.framework.domain.entity.Entity,is.codion.framework.domain.entity.attribute.Attribute<?>> table()final <T extends is.codion.swing.framework.model.SwingEntityTableModel>
Tfinal voidToggles the condition panel through the states hidden, visible and advancedfinal voidToggles the filter panel through the states hidden, visible and advancedfinal StringtoString()voidupdateUI()final voidDisplays a dialog containing tables of entities depending on the selected entities via non-soft foreign keysMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
CONDITION_PANEL_VISIBLE
Specifies whether table condition panels should be visible or not by default
Value type: Boolean
Default value: false -
FILTER_PANEL_VISIBLE
Specifies whether table filter panels should be visible or not by default
Value type: Boolean
Default value: false -
INCLUDE_ENTITY_MENU
Specifies whether to include aEntityPopupMenuon this table, triggered with CTRL-ALT-V.
Value type: Boolean
Default value: true -
INCLUDE_CLEAR_CONTROL
Specifies whether to include a 'Clear' control in the popup menu.
Value type: Boolean
Default value: false -
INCLUDE_CONDITION_PANEL
Specifies whether to include a condition panel.
Value type: Boolean
Default value: true -
INCLUDE_FILTER_PANEL
Specifies whether to include a filter panel.
Value type: Boolean
Default value: true -
SHOW_REFRESH_PROGRESS_BAR
Specifies whether to show an indeterminate progress bar while the model is refreshing.
Value type: Boolean
Default value: false -
REFRESH_BUTTON_VISIBLE
public static final is.codion.common.property.PropertyValue<EntityTablePanel.RefreshButtonVisible> REFRESH_BUTTON_VISIBLESpecifies whether the refresh button should always be visible or only when the condition panel is visible
Value type: Boolean
Default value:EntityTablePanel.RefreshButtonVisible.WHEN_CONDITION_PANEL_IS_VISIBLE -
COLUMN_SELECTION
public static final is.codion.common.property.PropertyValue<EntityTablePanel.ColumnSelection> COLUMN_SELECTIONSpecifies how column selection is presented to the user.
Value type:EntityTablePanel.ColumnSelection
Default value:EntityTablePanel.ColumnSelection.DIALOG
-
-
Constructor Details
-
EntityTablePanel
public EntityTablePanel(is.codion.swing.framework.model.SwingEntityTableModel tableModel) Initializes a new EntityTablePanel instance- Parameters:
tableModel- the SwingEntityTableModel instance
-
EntityTablePanel
public EntityTablePanel(is.codion.swing.framework.model.SwingEntityTableModel tableModel, EntityConditionPanelFactory conditionPanelFactory) Initializes a new EntityTablePanel instance- Parameters:
tableModel- the SwingEntityTableModel instanceconditionPanelFactory- the condition panel factory, if any
-
-
Method Details
-
updateUI
public void updateUI() -
table
public final is.codion.swing.common.ui.component.table.FilteredTable<is.codion.framework.domain.entity.Entity,is.codion.framework.domain.entity.attribute.Attribute<?>> table()- Returns:
- the table
-
tableModel
public final <T extends is.codion.swing.framework.model.SwingEntityTableModel> T tableModel()- Type Parameters:
T- the table model type- Returns:
- the EntityTableModel used by this EntityTablePanel
-
conditionPanel
public final is.codion.swing.common.ui.component.table.FilteredTableConditionPanel<is.codion.framework.domain.entity.attribute.Attribute<?>> conditionPanel()- Returns:
- the condition panel
- Throws:
IllegalStateException- in case no condition panel is available
-
editableAttributes
public final is.codion.common.value.ValueSet<is.codion.framework.domain.entity.attribute.Attribute<?>> editableAttributes()Specifies the attributes that should be editable in this table panel, such as via the edit selected entities menu. Modifying thisValueSetafter the panel has been initialized will result in aIllegalStateExceptionbeing thrown- Returns:
- the attributes that should be editable via this table panel
-
addPopupMenuControls
public final void addPopupMenuControls(is.codion.swing.common.ui.control.Controls additionalPopupMenuControls) - Parameters:
additionalPopupMenuControls- a set of controls to add to the table popup menu- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
addToolBarControls
public final void addToolBarControls(is.codion.swing.common.ui.control.Controls additionalToolBarControls) - Parameters:
additionalToolBarControls- a set of controls to add to the table toolbar menu- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludeSouthPanel
public final void setIncludeSouthPanel(boolean includeSouthPanel) - Parameters:
includeSouthPanel- true if the south panel should be included- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludeConditionPanel
public final void setIncludeConditionPanel(boolean includeConditionPanel) - Parameters:
includeConditionPanel- true if the condition panel should be included- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludeFilterPanel
public final void setIncludeFilterPanel(boolean includeFilterPanel) - Parameters:
includeFilterPanel- true if the filter panel should be included- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludePopupMenu
public final void setIncludePopupMenu(boolean includePopupMenu) - Parameters:
includePopupMenu- true if a popup menu should be included- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludeClearControl
public final void setIncludeClearControl(boolean includeClearControl) - Parameters:
includeClearControl- true if a 'Clear' control should be included in the popup menu- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setIncludeSelectionModeControl
public final void setIncludeSelectionModeControl(boolean includeSelectionModeControl) - Parameters:
includeSelectionModeControl- true if a 'Single Selection' control should be included in the popup menu- Throws:
IllegalStateException- in case the panel has already been initialized- See Also:
-
setColumnSelection
- Parameters:
columnSelection- specifies how columns are selected
-
getRefreshButtonVisible
- Returns:
- the refresh button visible setting
-
setRefreshButtonVisible
public final void setRefreshButtonVisible(EntityTablePanel.RefreshButtonVisible refreshButtonVisible) - Parameters:
refreshButtonVisible- the refresh button visible setting
-
conditionPanelVisible
public final is.codion.common.state.State conditionPanelVisible()- Returns:
- the state controlling whether the condition panel is visible
-
filterPanelVisible
public final is.codion.common.state.State filterPanelVisible()- Returns:
- the state controlling whether the filter panel is visible
-
summaryPanelVisible
public final is.codion.common.state.State summaryPanelVisible()- Returns:
- the state controlling whether the summary panel is visible
-
showRefreshProgressBar
public final is.codion.common.state.State showRefreshProgressBar()- Returns:
- the state controlling whether an indeterminate progress bar should be shown while the model is refreshing
- See Also:
-
statusMessage
public final is.codion.common.value.Value<Function<is.codion.swing.framework.model.SwingEntityTableModel,String>> statusMessage()- Returns:
- the value containing the function for creating the table status message
- See Also:
-
setEditComponentFactory
public final <T,A extends is.codion.framework.domain.entity.attribute.Attribute<T>, void setEditComponentFactoryC extends JComponent> (A attribute, EntityComponentFactory<T, A, C> componentFactory) Sets the component factory for the given attribute, used when editing entities viaeditSelectedEntities(Attribute).- Type Parameters:
T- the value typeA- the attribute typeC- the component type- Parameters:
attribute- the attributecomponentFactory- the component factory
-
setTableCellEditorFactory
public final <T,A extends is.codion.framework.domain.entity.attribute.Attribute<T>, void setTableCellEditorFactoryC extends JComponent> (A attribute, EntityComponentFactory<T, A, C> componentFactory) Sets the table cell editor component factory for the given attribute.- Type Parameters:
T- the value typeA- the attribute typeC- the component type- Parameters:
attribute- the attributecomponentFactory- the component factory
-
toggleConditionPanel
public final void toggleConditionPanel()Toggles the condition panel through the states hidden, visible and advanced -
toggleFilterPanel
public final void toggleFilterPanel()Toggles the filter panel through the states hidden, visible and advanced -
selectConditionPanel
public final void selectConditionPanel()Allows the user to select one of the available search condition panels -
selectFilterPanel
public final void selectFilterPanel()Allows the user to select one of the available filter condition panels -
setReferentialIntegrityErrorHandling
public final void setReferentialIntegrityErrorHandling(ReferentialIntegrityErrorHandling referentialIntegrityErrorHandling) - Parameters:
referentialIntegrityErrorHandling- the action to take on a referential integrity error during delete
-
setDeleteConfirmer
- Parameters:
deleteConfirmer- the delete confirmer, null for the default one
-
toString
-
control
public final Optional<is.codion.swing.common.ui.control.Control> control(EntityTablePanel.ControlCode controlCode) - Parameters:
controlCode- the control code- Returns:
- the control associated with
controlCodeor an empty Optional if no control is available
-
editSelectedEntities
public final <T> void editSelectedEntities(is.codion.framework.domain.entity.attribute.Attribute<T> attributeToEdit) Retrieves a new value via input dialog and performs an update on the selected entities assigning the value to the attribute- Type Parameters:
T- the attribute value type- Parameters:
attributeToEdit- the attribute which value to edit- See Also:
-
viewDependencies
public final void viewDependencies()Displays a dialog containing tables of entities depending on the selected entities via non-soft foreign keys -
deleteWithConfirmation
public final boolean deleteWithConfirmation()Deletes the entities selected in the underlying table model after asking for confirmation using theEntityEditPanel.Confirmerset viasetDeleteConfirmer(Confirmer).- Returns:
- true if the delete operation was successful
- See Also:
-
delete
public final boolean delete()Deletes the entities selected in the underlying table model without asking for confirmation.- Returns:
- true if the delete operation was successful
- See Also:
-
printTable
Prints the table- Throws:
PrinterException- in case of a print exception- See Also:
-
initialize
Initializes the UI, while presenting a wait cursor to the user. Note that calling this method more than once has no effect.- Returns:
- this EntityTablePanel instance
-
initializeSouthPanel
Initializes the south panel, override and return null for no south panel. Not called if the south panel has been disabled viasetIncludeSouthPanel(boolean).- Returns:
- the south panel, or null if no south panel should be included
-
setupKeyboardActions
protected void setupKeyboardActions()Sets up the default keyboard actions. -
setControl
protected final void setControl(EntityTablePanel.ControlCode controlCode, is.codion.swing.common.ui.control.Control control) AssociatescontrolwithcontrolCode- Parameters:
controlCode- the control codecontrol- the control to associate withcontrolCode, null for none- Throws:
IllegalStateException- in case the panel has already been initialized
-
createToolBarControls
protected is.codion.swing.common.ui.control.Controls createToolBarControls(List<is.codion.swing.common.ui.control.Controls> additionalToolBarControls) -
createPopupMenuControls
protected is.codion.swing.common.ui.control.Controls createPopupMenuControls(List<is.codion.swing.common.ui.control.Controls> additionalPopupMenuControls) Creates a Controls instance containing the controls to include in the table popup menu. Returns null or an empty Controls instance to indicate that no popup menu should be included.- Parameters:
additionalPopupMenuControls- any additional controls to include in the popup menu- Returns:
- Controls on which to base the table popup menu, null or an empty Controls instance if no popup menu should be included
-
createPrintMenuControls
protected is.codion.swing.common.ui.control.Controls createPrintMenuControls()By default this method returns aControlsinstance containing theControlassociated withEntityTablePanel.ControlCode.PRINT. If noControlhas been assigned to that control key, an emptyControlsinstance is returned. Override to add print actions, which will then appear in the table popup menu.- Returns:
- the print controls to display in the table popup menu
-
createTableCellRenderer
protected TableCellRenderer createTableCellRenderer(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a TableCellRenderer to use for the given attribute in this EntityTablePanel- Parameters:
attribute- the attribute- Returns:
- the TableCellRenderer for the given attribute
-
createTableCellEditor
protected TableCellEditor createTableCellEditor(is.codion.framework.domain.entity.attribute.Attribute<?> attribute) Creates a TableCellEditor for the given attribute, returns null if no editor is available, such as for non-updatable attributes.- Parameters:
attribute- the attribute- Returns:
- a TableCellEditor for the given attribute, null in case none is available
-
layoutPanel
This method simply addstablePanelat location BorderLayout.CENTER and, if non-null, the givensouthPanelto theBorderLayout.SOUTHlocation. By overriding this method you can override the default layout.- Parameters:
tableComponent- the component containing the table, condition and summary panelsouthPanel- the south toolbar panel, null if not required- See Also:
-
createSouthToolBar
Creates the south panel toolbar, by default based oncreateToolBarControls(List)- Returns:
- the toolbar to add to the south panel, null if none should be included
-
beforeDelete
protected void beforeDelete()Called before delete is performed on the selected entities. To cancel the delete throw aCancelException. -
onReferentialIntegrityException
protected void onReferentialIntegrityException(is.codion.common.db.exception.ReferentialIntegrityException exception) Called when aReferentialIntegrityExceptionoccurs during a delete operation on the selected entities. If the referential error handling isReferentialIntegrityErrorHandling.DISPLAY_DEPENDENCIES, the dependencies of the entities involved are displayed to the user, otherwiseonException(Throwable)is called.- Parameters:
exception- the exception- See Also:
-
onValidationException
protected void onValidationException(is.codion.framework.domain.entity.exception.ValidationException exception) Displays the exception message.- Parameters:
exception- the exception
-
onException
Handles the given exception, simply displays the error message to the user by default.- Parameters:
exception- the exception to handle- See Also:
-
displayException
Displays the exception in a dialog, with the dialog owner as the current focus owner or this panel if none is available.- Parameters:
exception- the exception to display
-