|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jminor.common.ui.FilteredTablePanel<Entity,Property>
org.jminor.framework.client.ui.EntityTablePanel
public class EntityTablePanel
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
EntityTableModel
,
Serialized FormNested 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String PRINT_TABLE
public static final String DELETE_SELECTED
public static final String VIEW_DEPENDENCIES
public static final String UPDATE_SELECTED
public static final String CONFIGURE_QUERY
public static final String SELECT_COLUMNS
public static final String EXPORT_JSON
public static final String CLEAR
public static final String REFRESH
public static final String TOGGLE_SUMMARY_PANEL
public static final String TOGGLE_SEARCH_PANEL
public static final String SEARCH_PANEL_VISIBLE
public static final String CLEAR_SELECTION
public static final String MOVE_SELECTION_UP
public static final String MOVE_SELECTION_DOWN
public static final String COPY_TABLE_DATA
Constructor Detail |
---|
public EntityTablePanel(EntityTableModel tableModel)
tableModel
- the EntityTableModel instancepublic EntityTablePanel(EntityTableModel tableModel, EntityTableSearchPanel searchPanel)
tableModel
- the EntityTableModel instancesearchPanel
- the search panelpublic EntityTablePanel(EntityTableModel tableModel, EntityTableSummaryPanel summaryPanel)
tableModel
- the EntityTableModel instancesummaryPanel
- the summary panelpublic EntityTablePanel(EntityTableModel tableModel, EntityTableSearchPanel searchPanel, EntityTableSummaryPanel summaryPanel)
tableModel
- the EntityTableModel instancesearchPanel
- the search panelsummaryPanel
- the summary panelMethod Detail |
---|
public final void setTableDoubleClickAction(Action doubleClickAction)
doubleClickAction
- the action to perform when a double click is performed on the table
IllegalStateException
- in case the panel has already been initializedinitializePanel()
public final Action getTableDoubleClickAction()
public final void addPopupControls(ControlSet additionalPopupControls)
additionalPopupControls
- a set of controls to add to the table popup menu
IllegalStateException
- in case the panel has already been initializedinitializePanel()
public final void addToolbarControls(ControlSet additionalToolbarControls)
additionalToolbarControls
- a set of controls to add to the table toolbar menu
IllegalStateException
- in case the panel has already been initializedinitializePanel()
public final void setIncludeSouthPanel(boolean value)
value
- true if the south panel should be included
IllegalStateException
- in case the panel has already been initializedinitializeSouthPanel()
,
initializePanel()
public final void setIncludeSearchPanel(boolean value)
value
- true if the search panel should be included
IllegalStateException
- in case the panel has already been initializedinitializePanel()
public final EntityTableModel getEntityTableModel()
public final void configureQuery()
EntityTableModel.isQueryConfigurationAllowed()
public final void setSummaryPanelVisible(boolean visible)
visible
- if true then the summary panel is shown, if false it is hiddenpublic final boolean isSummaryPanelVisible()
public final void setSearchPanelVisible(boolean visible)
visible
- if true the search panel is shown, if false it is hiddenpublic final boolean isSearchPanelVisible()
public final EntityTableSearchPanel getSearchPanel()
public final void toggleSearchPanel()
public final String toString()
toString
in class Component
public final Control getControl(String controlCode)
controlCode
- the control code
controlCode
IllegalArgumentException
- in case no control is associated with the given control codepublic ControlSet getUpdateSelectedControlSet()
IllegalStateException
- in case the underlying model is read only or if updating is not allowedinitializePanel()
public final Control getConfigureQueryControl()
public final Control getViewDependenciesControl()
public final Control getDeleteSelectedControl()
IllegalStateException
- in case the underlying model is read only or if deleting is not allowedpublic final Control getExportControl()
public final Control getPrintTableControl()
public final void updateSelectedEntities()
updateSelectedEntities(property)
with that property
updateSelectedEntities(org.jminor.framework.domain.Property)
,
getInputProvider(org.jminor.framework.domain.Property, java.util.List)
public final void updateSelectedEntities(Property propertyToUpdate)
propertyToUpdate
- the property to updategetInputProvider(org.jminor.framework.domain.Property, java.util.List)
public final void viewSelectionDependencies() throws DatabaseException
DatabaseException
- in case of a database exceptionpublic final void delete() throws DatabaseException, CancelException
DatabaseException
- in case of a database exception
CancelException
- in the delete action is cancelledpublic final void exportSelected() throws CancelException, Serializer.SerializeException
CancelException
- in case the action is cancelled
Serializer.SerializeException
- in case of an exceptionpublic final void printTable()
public final void handleException(Exception exception)
exception
- the exception to handlepublic final Control getToggleSummaryPanelControl()
public final Control getToggleSearchPanelControl()
public final Control getClearSelectionControl()
public final Control getMoveSelectionDownControl()
public final Control getMoveSelectionUpControl()
public final void addSearchPanelVisibleListener(ActionListener listener)
listener
- a listener notified each time the search panel visibility changespublic final void removeSearchPanelVisibleListener(ActionListener listener)
listener
- the listener to removepublic final void addSummaryPanelVisibleListener(ActionListener listener)
listener
- a listener notified each time the summary panel visibility changespublic final void removeSummaryPanelVisibleListener(ActionListener listener)
listener
- the listener to removepublic final void addTableDoubleClickListener(ActionListener listener)
listener
- a listener notified each time the table is double clickedpublic final void removeTableDoubleClickListener(ActionListener listener)
listener
- the listener to removepublic static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities, EntityConnectionProvider connectionProvider)
entities
- the entities to show in the panelconnectionProvider
- the EntityConnectionProvider, in case the returned panel should require one
public static EntityTablePanel createStaticEntityTablePanel(Collection<Entity> entities, EntityConnectionProvider connectionProvider, String entityID)
entities
- the entities to show in the panelconnectionProvider
- the EntityConnectionProvider, in case the returned panel should require oneentityID
- the entityID
public final EntityTablePanel initializePanel()
protected JPanel initializeSouthPanel()
protected final void setTablePopupMenu(JTable table, ControlSet popupControls)
table
table
- the tablepopupControls
- a ControlSet specifying the controls in the popup menuprotected final void setControl(String controlCode, Control control)
control
with controlCode
controlCode
- the control codecontrol
- the control to associate with controlCode
protected ControlSet getToolbarControls(List<ControlSet> additionalToolbarControlSets)
protected ControlSet getPopupControls(List<ControlSet> additionalPopupControlSets)
protected ControlSet getPrintControls()
protected final ToggleBeanValueLink getSearchPanelControl()
protected final ControlSet getCopyControlSet()
protected final boolean confirmDelete()
protected String[] getConfirmDeleteMessages()
protected final Control getRefreshControl()
protected final Control getClearControl()
protected final EntityTableSummaryPanel initializeSummaryPanel()
protected InputProvider getInputProvider(Property property, List<Entity> toUpdate)
property
- the property for which to get the InputProvidertoUpdate
- the entities that are about to be updated
property
updateSelectedEntities()
protected final InputProvider createEntityInputProvider(Property.ForeignKeyProperty foreignKeyProperty, Entity currentValue, EntityEditModel editModel)
foreignKeyProperty
- the propertycurrentValue
- the current value to initialize the InputProvider witheditModel
- the edit model involved in the updating
protected TableCellRenderer initializeTableCellRenderer()
protected final MouseListener initializeTableMouseListener()
getDoubleClickAction()
on a double click with
the JTable as the ActionEvent source.
getTableDoubleClickAction()
protected JToolBar initializeToolbar()
getToolbarControls()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |