R
- the type representing the rows in the table modelC
- type type used to identify columns in the table modelpublic class FilteredTablePanel<R,C>
extends javax.swing.JPanel
BorderLayout
and contains a base panel getBasePanel()
, itself with
a BorderLayout
, containing the actual table at location BorderLayout.CENTER
FilteredTableModel
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
FilteredTablePanel.ColumnConditionPanelProvider<C>
Responsible for creating
ColumnConditionPanel s |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static char |
FILTER_INDICATOR |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
FilteredTablePanel(AbstractFilteredTableModel<R,C> tableModel)
Instantiates a new FilteredTablePanel.
|
FilteredTablePanel(AbstractFilteredTableModel<R,C> tableModel,
FilteredTablePanel.ColumnConditionPanelProvider<C> conditionPanelProvider)
Instantiates a new FilteredTablePanel.
|
FilteredTablePanel(javax.swing.JTable table,
FilteredTablePanel.ColumnConditionPanelProvider<C> conditionPanelProvider)
Instantiates a new FilteredTablePanel.
|
Modifier and Type | Method and Description |
---|---|
void |
addSummaryPanelVisibleListener(EventListener listener) |
javax.swing.JPanel |
getBasePanel()
Returns the base panel containing the table scroll pane (BorderLayout.CENTER).
|
javax.swing.JTable |
getJTable() |
javax.swing.JTextField |
getSearchField() |
Control |
getSelectColumnsControl() |
AbstractFilteredTableModel<R,C> |
getTableModel() |
javax.swing.JScrollPane |
getTableScrollPane() |
Control |
getToggleSummaryPanelControl()
Initializes the button used to toggle the summary panel state (hidden and visible)
|
boolean |
isCellVisible(int row,
int column)
Returns true if the given cell is visible.
|
boolean |
isScrollToSelectedItem() |
boolean |
isSortingEnabled() |
boolean |
isSummaryPanelVisible() |
void |
removeSummaryPanelVisibleListener(EventListener listener) |
void |
scrollToColumn(java.lang.Object columnIdentifier)
Scrolls horizontally so that the column identified by columnIdentifier becomes visible, centered if possible
|
void |
scrollToCoordinate(int row,
int column,
boolean centerXPos,
boolean centerYPos)
Scrolls to the given coordinate.
|
void |
selectTableColumns()
Shows a dialog for selecting which columns to show/hide
|
void |
setFilterPanelsVisible(boolean value)
Hides or shows the active filter panels for this table panel
|
void |
setScrollToSelectedItem(boolean scrollToSelectedItem) |
void |
setSortingEnabled(boolean sortingEnabled) |
void |
setSummaryPanelVisible(boolean visible)
Hides or shows the column summary panel for this EntityTablePanel
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, update
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, validateTree
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, 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, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final char FILTER_INDICATOR
public FilteredTablePanel(AbstractFilteredTableModel<R,C> tableModel)
tableModel
- the table modelpublic FilteredTablePanel(AbstractFilteredTableModel<R,C> tableModel, FilteredTablePanel.ColumnConditionPanelProvider<C> conditionPanelProvider)
tableModel
- the table modelconditionPanelProvider
- the column condition panel provider the column filter models found in the table modelpublic FilteredTablePanel(javax.swing.JTable table, FilteredTablePanel.ColumnConditionPanelProvider<C> conditionPanelProvider)
AbstractFilteredTableModel
.
AbstractFilteredTableModel tableModel = ...; JTable table = new JTable(tableModel, tableModel.getColumnModel(), (ListSelectionModel) tableModel.getSelectionModel());
table
- the table to useconditionPanelProvider
- the column condition panel provider the column filter models found in the table modelFilteredTableModel.getColumnModel()
,
FilteredTableModel.getSelectionModel()
public final void setFilterPanelsVisible(boolean value)
value
- true if the active filter panels should be shown, false if they should be hiddenpublic final AbstractFilteredTableModel<R,C> getTableModel()
public final javax.swing.JTable getJTable()
public final javax.swing.JTextField getSearchField()
initializeSearchField()
public final javax.swing.JScrollPane getTableScrollPane()
public javax.swing.JPanel getBasePanel()
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 boolean isCellVisible(int row, int column)
row
- the rowcolumn
- the columnpublic final void scrollToColumn(java.lang.Object columnIdentifier)
columnIdentifier
- the column identifierpublic final void scrollToCoordinate(int row, int column, boolean centerXPos, boolean centerYPos)
row
- the rowcolumn
- the columncenterXPos
- if true then the selected column is positioned in the center of the table, if possiblecenterYPos
- if true then the selected row is positioned in the center of the table, if possiblepublic final Control getSelectColumnsControl()
public final Control getToggleSummaryPanelControl()
public final boolean isSortingEnabled()
public final void setSortingEnabled(boolean sortingEnabled)
sortingEnabled
- true if sorting via the table header should be enabledpublic final boolean isScrollToSelectedItem()
public final void setScrollToSelectedItem(boolean scrollToSelectedItem)
scrollToSelectedItem
- true if the JTable instance should scroll automatically
to the coordinate of the record selected in the underlying table modelpublic final void selectTableColumns()
public final void addSummaryPanelVisibleListener(EventListener listener)
listener
- a listener notified each time the summary panel visibility changespublic final void removeSummaryPanelVisibleListener(EventListener listener)
listener
- the listener to remove