org.jminor.framework.client.ui
Class EntityTablePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.jminor.common.ui.FilteredTablePanel<Entity,Property>
                      extended by org.jminor.framework.client.ui.EntityTablePanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class EntityTablePanel
extends FilteredTablePanel<Entity,Property>

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

  ____________________________________________________
 |                searchPanel                         |
 |____________________________________________________|
 |                                                    |
 |                                                    |
 |                                                    |
 |                                                    |
 |                entityTable (JTable)                |
 |                                                    |
 |                                                    |
 |                                                    |
 |                                                    |
 |____________________________________________________|
 |                summaryPanel                        |
 |____________________________________________________|
 |                southPanel                          |
 |____________________________________________________|
 
The search and summary panels can be hidden

See Also:
EntityTableModel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String CLEAR
           
static String CLEAR_SELECTION
           
static String CONFIGURE_QUERY
           
static String COPY_TABLE_DATA
           
static String DELETE_SELECTED
           
static String EXPORT_JSON
           
static String MOVE_SELECTION_DOWN
           
static String MOVE_SELECTION_UP
           
static String PRINT_TABLE
           
static String REFRESH
           
static String SEARCH_PANEL_VISIBLE
           
static String SELECT_COLUMNS
           
static String TOGGLE_SEARCH_PANEL
           
static String TOGGLE_SUMMARY_PANEL
           
static String UPDATE_SELECTED
           
static String VIEW_DEPENDENCIES
           
 
Fields inherited from class org.jminor.common.ui.FilteredTablePanel
FILTER_INDICATOR
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EntityTablePanel(EntityTableModel tableModel)
          Initializes a new EntityTablePanel instance
EntityTablePanel(EntityTableModel tableModel, EntityTableSearchPanel searchPanel)
          Initializes a new EntityTablePanel instance
EntityTablePanel(EntityTableModel tableModel, EntityTableSearchPanel searchPanel, EntityTableSummaryPanel summaryPanel)
          Initializes a new EntityTablePanel instance
EntityTablePanel(EntityTableModel tableModel, EntityTableSummaryPanel summaryPanel)
          Initializes a new EntityTablePanel instance
 
Method Summary
 void addPopupControls(ControlSet additionalPopupControls)
           
 void addSearchPanelVisibleListener(ActionListener listener)
           
 void addSummaryPanelVisibleListener(ActionListener listener)
           
 void addTableDoubleClickListener(ActionListener listener)
           
 void addToolbarControls(ControlSet additionalToolbarControls)
           
 void configureQuery()
          Shows a dialog for configuring the underlying EntityTableModel query.
protected  boolean confirmDelete()
          Called before a delete is performed, if true is returned the delete action is performed otherwise it is canceled
protected  InputProvider createEntityInputProvider(Property.ForeignKeyProperty foreignKeyProperty, Entity currentValue, EntityEditModel editModel)
          Creates a InputProvider for the given foreign key property
static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities, EntityConnectionProvider connectionProvider)
          Creates a static entity table panel showing the given entities
static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities, EntityConnectionProvider connectionProvider, String entityID)
          Creates a static entity table panel showing the given entities
 void delete()
          Performs a delete on the active entity or if a table model is available, the selected entities
 void exportSelected()
          Exports the selected records as a text file
protected  Control getClearControl()
           
 Control getClearSelectionControl()
           
 Control getConfigureQueryControl()
           
protected  String[] getConfirmDeleteMessages()
           
 Control getControl(String controlCode)
           
protected  ControlSet getCopyControlSet()
           
 Control getDeleteSelectedControl()
           
 EntityTableModel getEntityTableModel()
           
 Control getExportControl()
           
protected  InputProvider getInputProvider(Property property, List<Entity> toUpdate)
          Provides value input components for multiple entity update, override to supply specific InputValueProvider implementations for properties.
 Control getMoveSelectionDownControl()
           
 Control getMoveSelectionUpControl()
           
protected  ControlSet getPopupControls(List<ControlSet> additionalPopupControlSets)
           
protected  ControlSet getPrintControls()
           
 Control getPrintTableControl()
           
protected  Control getRefreshControl()
           
 EntityTableSearchPanel getSearchPanel()
           
protected  ToggleBeanValueLink getSearchPanelControl()
           
 Action getTableDoubleClickAction()
           
 Control getToggleSearchPanelControl()
          Initializes the button used to toggle the search panel state (hidden, visible and advanced)
 Control getToggleSummaryPanelControl()
          Initializes the button used to toggle the summary panel state (hidden and visible)
protected  ControlSet getToolbarControls(List<ControlSet> additionalToolbarControlSets)
           
 ControlSet getUpdateSelectedControlSet()
           
 Control getViewDependenciesControl()
           
 void handleException(Exception exception)
          By default this delegates to the edit panel
 EntityTablePanel initializePanel()
          Initializes the UI
protected  JPanel initializeSouthPanel()
          Initializes the south panel, override and return null for no south panel.
protected  EntityTableSummaryPanel initializeSummaryPanel()
          Initializes the panel containing the table column summary panels
protected  TableCellRenderer initializeTableCellRenderer()
          Returns the TableCellRenderer used for this EntityTablePanel
protected  MouseListener initializeTableMouseListener()
          Initialize the MouseListener for the table component.
protected  JToolBar initializeToolbar()
          Initializes the south panel toolbar, by default based on getToolbarControls()
 boolean isSearchPanelVisible()
           
 boolean isSummaryPanelVisible()
           
 void printTable()
          Prints the table if one is available
 void removeSearchPanelVisibleListener(ActionListener listener)
           
 void removeSummaryPanelVisibleListener(ActionListener listener)
           
 void removeTableDoubleClickListener(ActionListener listener)
           
protected  void setControl(String controlCode, Control control)
          Associates control with controlCode
 void setIncludeSearchPanel(boolean value)
           
 void setIncludeSouthPanel(boolean value)
           
 void setSearchPanelVisible(boolean visible)
          Hides or shows the column search panel for this EntityTablePanel
 void setSummaryPanelVisible(boolean visible)
          Hides or shows the column summary panel for this EntityTablePanel
 void setTableDoubleClickAction(Action doubleClickAction)
           
protected  void setTablePopupMenu(JTable table, ControlSet popupControls)
          Adds a popup menu to table
 void toggleSearchPanel()
          Toggles the search panel through the states hidden, visible and in case it is a EntityTableSearchPanel advanced
 String toString()
          
 void updateSelectedEntities()
          Queries the user on which property to update, after which it calls the updateSelectedEntities(property) with that property
 void updateSelectedEntities(Property propertyToUpdate)
          Retrieves a new property value via input dialog and performs an update on the selected entities
 void viewSelectionDependencies()
          Shows a dialog containing lists of entities depending on the selected entities via foreign key
 
Methods inherited from class org.jminor.common.ui.FilteredTablePanel
getColumnFilterPanels, getJTable, getSearchField, getSelectColumnsControl, getTableModel, getTableScrollPane, scrollToCoordinate, selectTableColumns, setFilterPanelsVisible
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, update
 
Methods 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRINT_TABLE

public static final String PRINT_TABLE
See Also:
Constant Field Values

DELETE_SELECTED

public static final String DELETE_SELECTED
See Also:
Constant Field Values

VIEW_DEPENDENCIES

public static final String VIEW_DEPENDENCIES
See Also:
Constant Field Values

UPDATE_SELECTED

public static final String UPDATE_SELECTED
See Also:
Constant Field Values

CONFIGURE_QUERY

public static final String CONFIGURE_QUERY
See Also:
Constant Field Values

SELECT_COLUMNS

public static final String SELECT_COLUMNS
See Also:
Constant Field Values

EXPORT_JSON

public static final String EXPORT_JSON
See Also:
Constant Field Values

CLEAR

public static final String CLEAR
See Also:
Constant Field Values

REFRESH

public static final String REFRESH
See Also:
Constant Field Values

TOGGLE_SUMMARY_PANEL

public static final String TOGGLE_SUMMARY_PANEL
See Also:
Constant Field Values

TOGGLE_SEARCH_PANEL

public static final String TOGGLE_SEARCH_PANEL
See Also:
Constant Field Values

SEARCH_PANEL_VISIBLE

public static final String SEARCH_PANEL_VISIBLE
See Also:
Constant Field Values

CLEAR_SELECTION

public static final String CLEAR_SELECTION
See Also:
Constant Field Values

MOVE_SELECTION_UP

public static final String MOVE_SELECTION_UP
See Also:
Constant Field Values

MOVE_SELECTION_DOWN

public static final String MOVE_SELECTION_DOWN
See Also:
Constant Field Values

COPY_TABLE_DATA

public static final String COPY_TABLE_DATA
See Also:
Constant Field Values
Constructor Detail

EntityTablePanel

public EntityTablePanel(EntityTableModel tableModel)
Initializes a new EntityTablePanel instance

Parameters:
tableModel - the EntityTableModel instance

EntityTablePanel

public EntityTablePanel(EntityTableModel tableModel,
                        EntityTableSearchPanel searchPanel)
Initializes a new EntityTablePanel instance

Parameters:
tableModel - the EntityTableModel instance
searchPanel - the search panel

EntityTablePanel

public EntityTablePanel(EntityTableModel tableModel,
                        EntityTableSummaryPanel summaryPanel)
Initializes a new EntityTablePanel instance

Parameters:
tableModel - the EntityTableModel instance
summaryPanel - the summary panel

EntityTablePanel

public EntityTablePanel(EntityTableModel tableModel,
                        EntityTableSearchPanel searchPanel,
                        EntityTableSummaryPanel summaryPanel)
Initializes a new EntityTablePanel instance

Parameters:
tableModel - the EntityTableModel instance
searchPanel - the search panel
summaryPanel - the summary panel
Method Detail

setTableDoubleClickAction

public final void setTableDoubleClickAction(Action doubleClickAction)
Parameters:
doubleClickAction - the action to perform when a double click is performed on the table
Throws:
IllegalStateException - in case the panel has already been initialized
See Also:
initializePanel()

getTableDoubleClickAction

public final Action getTableDoubleClickAction()
Returns:
the Action performed when the table receives a double click

addPopupControls

public final void addPopupControls(ControlSet additionalPopupControls)
Parameters:
additionalPopupControls - a set of controls to add to the table popup menu
Throws:
IllegalStateException - in case the panel has already been initialized
See Also:
initializePanel()

addToolbarControls

public final void addToolbarControls(ControlSet 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:
initializePanel()

setIncludeSouthPanel

public final void setIncludeSouthPanel(boolean value)
Parameters:
value - true if the south panel should be included
Throws:
IllegalStateException - in case the panel has already been initialized
See Also:
initializeSouthPanel(), initializePanel()

setIncludeSearchPanel

public final void setIncludeSearchPanel(boolean value)
Parameters:
value - true if the search panel should be included
Throws:
IllegalStateException - in case the panel has already been initialized
See Also:
initializePanel()

getEntityTableModel

public final EntityTableModel getEntityTableModel()
Returns:
the EntityTableModel used by this EntityTablePanel

configureQuery

public final void configureQuery()
Shows a dialog for configuring the underlying EntityTableModel query. If the underlying table model does not allow query configuration this method returns silently

See Also:
EntityTableModel.isQueryConfigurationAllowed()

setSummaryPanelVisible

public final void setSummaryPanelVisible(boolean visible)
Hides or shows the column summary panel for this EntityTablePanel

Parameters:
visible - if true then the summary panel is shown, if false it is hidden

isSummaryPanelVisible

public final boolean isSummaryPanelVisible()
Returns:
true if the column summary panel is visible, false if it is hidden

setSearchPanelVisible

public final void setSearchPanelVisible(boolean visible)
Hides or shows the column search panel for this EntityTablePanel

Parameters:
visible - if true the search panel is shown, if false it is hidden

isSearchPanelVisible

public final boolean isSearchPanelVisible()
Returns:
true if the search panel is visible, false if it is hidden

getSearchPanel

public final EntityTableSearchPanel getSearchPanel()
Returns:
the search panel being used by this EntityTablePanel

toggleSearchPanel

public final void toggleSearchPanel()
Toggles the search panel through the states hidden, visible and in case it is a EntityTableSearchPanel advanced


toString

public final String toString()

Overrides:
toString in class Component

getControl

public final Control getControl(String controlCode)
Parameters:
controlCode - the control code
Returns:
the control associated with controlCode
Throws:
IllegalArgumentException - in case no control is associated with the given control code

getUpdateSelectedControlSet

public ControlSet getUpdateSelectedControlSet()
Returns:
a control set containing a set of controls, one for each updatable property in the underlying entity, for performing an update on the selected entities
Throws:
IllegalStateException - in case the underlying model is read only or if updating is not allowed
See Also:
initializePanel()

getConfigureQueryControl

public final Control getConfigureQueryControl()
Returns:
a control for showing the query configuration dialog

getViewDependenciesControl

public final Control getViewDependenciesControl()
Returns:
a control for showing the dependencies dialog

getDeleteSelectedControl

public final Control getDeleteSelectedControl()
Returns:
a control for deleting the selected entities
Throws:
IllegalStateException - in case the underlying model is read only or if deleting is not allowed

getExportControl

public final Control getExportControl()
Returns:
a control for exporting the selected records to file

getPrintTableControl

public final Control getPrintTableControl()
Returns:
a control for printing the table

updateSelectedEntities

public final void updateSelectedEntities()
Queries the user on which property to update, after which it calls the updateSelectedEntities(property) with that property

See Also:
updateSelectedEntities(org.jminor.framework.domain.Property), getInputProvider(org.jminor.framework.domain.Property, java.util.List)

updateSelectedEntities

public final void updateSelectedEntities(Property propertyToUpdate)
Retrieves a new property value via input dialog and performs an update on the selected entities

Parameters:
propertyToUpdate - the property to update
See Also:
getInputProvider(org.jminor.framework.domain.Property, java.util.List)

viewSelectionDependencies

public final void viewSelectionDependencies()
                                     throws DatabaseException
Shows a dialog containing lists of entities depending on the selected entities via foreign key

Throws:
DatabaseException - in case of a database exception

delete

public final void delete()
                  throws DatabaseException,
                         CancelException
Performs a delete on the active entity or if a table model is available, the selected entities

Throws:
DatabaseException - in case of a database exception
CancelException - in the delete action is cancelled

exportSelected

public final void exportSelected()
                          throws CancelException,
                                 Serializer.SerializeException
Exports the selected records as a text file

Throws:
CancelException - in case the action is cancelled
Serializer.SerializeException - in case of an exception

printTable

public final void printTable()
Prints the table if one is available


handleException

public final void handleException(Exception exception)
By default this delegates to the edit panel

Parameters:
exception - the exception to handle

getToggleSummaryPanelControl

public final Control getToggleSummaryPanelControl()
Initializes the button used to toggle the summary panel state (hidden and visible)

Returns:
a summary panel toggle button

getToggleSearchPanelControl

public final Control getToggleSearchPanelControl()
Initializes the button used to toggle the search panel state (hidden, visible and advanced)

Returns:
a search panel toggle button

getClearSelectionControl

public final Control getClearSelectionControl()
Returns:
a control for clearing the table selection

getMoveSelectionDownControl

public final Control getMoveSelectionDownControl()
Returns:
a control for moving the table selection one index down

getMoveSelectionUpControl

public final Control getMoveSelectionUpControl()
Returns:
a control for moving the table selection one index up

addSearchPanelVisibleListener

public final void addSearchPanelVisibleListener(ActionListener listener)
Parameters:
listener - a listener notified each time the search panel visibility changes

removeSearchPanelVisibleListener

public final void removeSearchPanelVisibleListener(ActionListener listener)
Parameters:
listener - the listener to remove

addSummaryPanelVisibleListener

public final void addSummaryPanelVisibleListener(ActionListener listener)
Parameters:
listener - a listener notified each time the summary panel visibility changes

removeSummaryPanelVisibleListener

public final void removeSummaryPanelVisibleListener(ActionListener listener)
Parameters:
listener - the listener to remove

addTableDoubleClickListener

public final void addTableDoubleClickListener(ActionListener listener)
Parameters:
listener - a listener notified each time the table is double clicked

removeTableDoubleClickListener

public final void removeTableDoubleClickListener(ActionListener listener)
Parameters:
listener - the listener to remove

createStaticEntityTablePanel

public static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities,
                                                            EntityConnectionProvider connectionProvider)
Creates a static entity table panel showing the given entities

Parameters:
entities - the entities to show in the panel
connectionProvider - the EntityConnectionProvider, in case the returned panel should require one
Returns:
a static EntityTablePanel showing the given entities

createStaticEntityTablePanel

public static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities,
                                                            EntityConnectionProvider connectionProvider,
                                                            String entityID)
Creates a static entity table panel showing the given entities

Parameters:
entities - the entities to show in the panel
connectionProvider - the EntityConnectionProvider, in case the returned panel should require one
entityID - the entityID
Returns:
a static EntityTablePanel showing the given entities

initializePanel

public final EntityTablePanel initializePanel()
Initializes the UI

Returns:
this EntityTablePanel instance

initializeSouthPanel

protected JPanel initializeSouthPanel()
Initializes the south panel, override and return null for no south panel.

Returns:
the south panel, or null if no south panel should be used

setTablePopupMenu

protected final void setTablePopupMenu(JTable table,
                                       ControlSet popupControls)
Adds a popup menu to table

Parameters:
table - the table
popupControls - a ControlSet specifying the controls in the popup menu

setControl

protected final void setControl(String controlCode,
                                Control control)
Associates control with controlCode

Parameters:
controlCode - the control code
control - the control to associate with controlCode

getToolbarControls

protected ControlSet getToolbarControls(List<ControlSet> additionalToolbarControlSets)

getPopupControls

protected ControlSet getPopupControls(List<ControlSet> additionalPopupControlSets)

getPrintControls

protected ControlSet getPrintControls()

getSearchPanelControl

protected final ToggleBeanValueLink getSearchPanelControl()

getCopyControlSet

protected final ControlSet getCopyControlSet()

confirmDelete

protected final boolean confirmDelete()
Called before a delete is performed, if true is returned the delete action is performed otherwise it is canceled

Returns:
true if the delete action should be performed

getConfirmDeleteMessages

protected String[] getConfirmDeleteMessages()

getRefreshControl

protected final Control getRefreshControl()
Returns:
a Control for refreshing the underlying table data

getClearControl

protected final Control getClearControl()
Returns:
a Control for clearing the underlying table model, that is, removing all rows

initializeSummaryPanel

protected final EntityTableSummaryPanel initializeSummaryPanel()
Initializes the panel containing the table column summary panels

Returns:
the summary panel

getInputProvider

protected InputProvider getInputProvider(Property property,
                                         List<Entity> toUpdate)
Provides value input components for multiple entity update, override to supply specific InputValueProvider implementations for properties. Remember to return with a call to super.getInputProviderInputProvider().

Parameters:
property - the property for which to get the InputProvider
toUpdate - the entities that are about to be updated
Returns:
the InputProvider handling input for property
See Also:
updateSelectedEntities()

createEntityInputProvider

protected final InputProvider createEntityInputProvider(Property.ForeignKeyProperty foreignKeyProperty,
                                                        Entity currentValue,
                                                        EntityEditModel editModel)
Creates a InputProvider for the given foreign key property

Parameters:
foreignKeyProperty - the property
currentValue - the current value to initialize the InputProvider with
editModel - the edit model involved in the updating
Returns:
a Entity InputProvider

initializeTableCellRenderer

protected TableCellRenderer initializeTableCellRenderer()
Returns the TableCellRenderer used for this EntityTablePanel

Returns:
the TableCellRenderer

initializeTableMouseListener

protected final MouseListener initializeTableMouseListener()
Initialize the MouseListener for the table component. The default implementation simply invokes the action returned by getDoubleClickAction() on a double click with the JTable as the ActionEvent source.

Returns:
the MouseListener for the table
See Also:
getTableDoubleClickAction()

initializeToolbar

protected JToolBar initializeToolbar()
Initializes the south panel toolbar, by default based on getToolbarControls()

Returns:
the toolbar to add to the south panel