com.jidesoft.pivot
Class HeaderTable
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
com.jidesoft.grid.JideTable
com.jidesoft.grid.ContextSensitiveTable
com.jidesoft.grid.NavigableTable
com.jidesoft.grid.CellStyleTable
com.jidesoft.grid.CellSpanTable
com.jidesoft.grid.CategorizedTable
com.jidesoft.pivot.HeaderTable
- All Implemented Interfaces:
- ExpandableProvider, IndexChangeListener, TableAdapter, TableSelectionListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable
public class HeaderTable
- extends CategorizedTable
- implements PropertyChangeListener, ExpandableProvider, TableSelectionListener
The table used by the PivotTablePane in the row header area or column header area.
To set tool tip text for the cells in the header table, please get its actual renderer component and invoke setToolTipText for that component.
- See Also:
- Serialized Form
Fields inherited from class com.jidesoft.grid.JideTable |
_batchProcessing, _cellChangeEvent, _clickCountToStart, _columnAutoResizer, _columnResizer, _headerDraggingMouseMotionListener, _rolloverCellEditor, _rolloverCellEditorListener, _rolloverColumn, _rolloverEditorComp, _rolloverEditorRemover, _rolloverRow, _rowHeights, _rowResizer, ACTION_NAME_CANCEL_EDITING, AUTO_RESIZE_ALL_COLUMNS_FILL, AUTO_RESIZE_FILL, AUTO_RESIZE_LAST_COLUMN_FILL, AUTO_RESIZE_NEXT_COLUMN_FILL, AUTO_RESIZE_SUBSEQUENT_COLUMNS_FILL, CLIENT_PROPERTY_LAZY_CALCULATE_ROW_HEIGHT, EDITOR_AUTO_COMPLETION_MODE_COLUMN, EDITOR_AUTO_COMPLETION_MODE_NONE, EDITOR_AUTO_COMPLETION_MODE_ROW, EDITOR_AUTO_COMPLETION_MODE_TABLE, PROPERTY_CLEAR_SELECTION_ON_TABLE_DATA_CHANGES, PROPERTY_EDITOR_AUTO_COMPLETION_MODE, PROPERTY_FILLS_BOTTOM, PROPERTY_FILLS_GRIDS, PROPERTY_FILLS_RIGHT, PROPERTY_LOAD_SELECTION_ON_TABLE_DATA_CHANGES, PROPERTY_NON_CONTIGUOUS_CELL_SELECTION, PROPERTY_ROW_AUTO_RESIZES, PROPERTY_SCROLL_ROW_WHEN_ROW_HEIGHT_CHANGES, PROPERTY_TABLE_SELECTION_MODEL, ROW_AUTO_RESIZES_PROPERTY |
Fields inherited from class javax.swing.JTable |
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader |
Method Summary |
void |
addColumn(TableColumn column)
Overrides this method to skip the column that is being added when the column was hidden earlier by TableColumnChooser.hideColumn(javax.swing.JTable, int) method. |
void |
changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
Override the default implementation to adjust the selection avoiding the non-navigable cells. |
void |
collapseAll()
|
protected void |
collectCellStyles(int row,
int column)
Collects the cell style of the cell and put into a sorted ArrayList which is a field called _cellStyleList. |
protected String |
convertValuesToString(Values values,
boolean isRowHeader)
Converts the Values to string to show in the context menu. |
protected TableCellRenderer |
createCellRenderer()
Creates the special cell renderer for the first column which paints +/- icon and tree line. |
protected JPopupMenu |
createContextMenu(int rowIndex,
int columnIndex)
Creates context menu for specific row/column in the header table. |
protected MouseInputListener |
createExpandMouseInputListener(MouseInputListener listener)
Creates the mouse listener used to handle mouse click on +/- icon. |
protected HeaderTable.ExpandMouseListener |
createExpandMouseListener()
Creates the mouse listener used to handle mouse click on +/- icon. |
boolean |
editCellAt(int row,
int column,
EventObject o)
|
void |
expandAll()
|
TableCellRenderer |
getCellRenderer(int rowIndex,
int columnIndex)
Returns an appropriate renderer for the cell specified by this row and column. |
Expandable |
getExpandableAt(int rowIndex,
int columnIndex)
|
HeaderTableModel |
getHeaderTableModel()
|
PivotTablePane |
getPivotTablePane()
|
Dimension |
getPreferredScrollableViewportSize()
|
protected String |
getRunningSummaryTitle(RunningSummaryValue value,
String stringValue)
Gets the title for the running summary type |
Object |
getValueAt(int row,
int column)
Returns the cell value at row and column . |
String |
getValueAtInString(int rowIndex,
int columnIndex,
HssfTableUtils.CellValueConverter converter)
Gets the string value with summary name or the total/grand total. |
protected void |
handleMouseDraggedEvent(MouseEvent e,
Point startPoint)
Handles the mouse drag event. |
protected void |
handleMousePressedEvent(MouseEvent e)
Handles the mouse press event. |
boolean |
isCellSelected(int row,
int column)
Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified
position is selected. |
protected boolean |
isClickOnIcon(Point p)
Checks if the click iis on an expand / collapse icon. |
boolean |
isExpandIconVisible(Node node)
Checks if the +/- icon should visible for the node. |
boolean |
isShowContextMenu()
Gets the flag indicating if context menu should be displayed on right click. |
boolean |
isUseNativeRenderer()
Gets the flag indicating if the AggregateTable should use native renderer to paint its aggregated cells. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
setShowContextMenu(boolean showContextMenu)
Sets the flag indicating if context menu should be displayed on right click. |
void |
setUseNativeRenderer(boolean useNativeRenderer)
Sets the flag indicating if the AggregateTable should use native renderer to paint its aggregated cells. |
void |
updateUI()
|
void |
valueChanged(TableSelectionEvent e)
Called whenever the value of the selection changes. |
Methods inherited from class com.jidesoft.grid.CategorizedTable |
getAscendingIcon, getCategoryCollapsedIcon, getCategoryExpandedIcon, getCollapsedIcon, getCollapsedIcon, getDescendingIcon, getDisabledBackground, getDisabledForeground, getExpandedIcon, getExpandedIcon, getMarginBackground, isExpandIconVisible, isPaintMarginBackground, isUseLnfDefaultSortIcon, isUseTableRendererForCategoryRow, setAscendingIcon, setCategoryCollapsedIcon, setCategoryExpandedIcon, setCollapsedIcon, setDescendingIcon, setDisabledBackground, setDisabledForeground, setExpandedIcon, setExpandIconVisible, setMarginBackground, setPaintMarginBackground, setUseLnfDefaultSortIcon, setUseTableRendererForCategoryRow |
Methods inherited from class com.jidesoft.grid.CellSpanTable |
binarySearch, calculateRowHeight, calculateRowHeight, calculateRowHeights, columnAdded, columnAtPoint, columnMoved, columnRemoved, convertModelCellSpanToView, convertViewCellSpanToModel, createCellSpanCache, createDelegateAction, getActualRowHeight, getActualUIClassID, getAutoCellMerge, getCache, getCacheEmpty, getCellEditor, getCellRect, getCellSpanAt, getCellSpanAt, getCellSpanFromAutoCellMerge, getCellSpanFromSpanModel, getDirtyRegion, getScrollableUnitIncrement, getSpanModel, invalidateCellSpanCache, isAutoConvertCellSpan, isCellFocused, isCellSpanCacheEnabled, isCellSpanOn, isKeepColumnAtPoint, isKeepRowAtPoint, isPaintCellSpanAsSelected, muteDefaultKeyStroke, originalColumnAtPoint, originalGetCellRect, originalRowAtPoint, prepareEditor, replaceAction, replaceAction, restoreAction, restoreAction, rolloverCellAt, rowAtPoint, setAutoCellMerge, setAutoConvertCellSpan, setCellSpanCacheEnabled, setKeepColumnAtPoint, setKeepRowAtPoint, setPaintCellSpanAsSelected, shouldCellBePaintedAsFocused, shouldCellBePaintedAsSelected, tableChanged, valueChanged, verifyCellSpan, verifyCellSpan |
Methods inherited from class com.jidesoft.grid.CellStyleTable |
addCellStyleCustomizer, clearCellStyleCustomizers, configureEditorComponent, configureRendererComponent, customizeEditorComponent, customizeRendererComponent, getCellStyleAt, getCellStyleCustomizers, getCellStyleProvider, getCellStyles, getFocusCellStyle, getNextStyleModel, getStyleModel, getTableStyleProvider, isFillsSelection, isFillsViewportWithStripe, mergeCellStyle, mergeCellStyles, needPaintStripedBackground, paintCellOverlay, paintCellUnderlay, paintComponent, prepareRenderer, releaseRendererComponent, removeCellStyleCustomizer, setCellStyleProvider, setFillsSelection, setFillsViewportWithStripe, setFocusCellStyle, setTableStyleProvider |
Methods inherited from class com.jidesoft.grid.NavigableTable |
findNearestNavigableCellInColumn, findNearestNavigableCellInRow, findNextNavigableCell, findNextNavigableCellInColumn, findNextNavigableCellInRow, findNextNavigableCellVertically, findPreviousNavigableCell, findPreviousNavigableCellInColumn, findPreviousNavigableCellInRow, findPreviousNavigableCellVertically, getNavigableModel, getNextNavigableModel, isCellNavigable, isNavigationKey, processKeyBinding |
Methods inherited from class com.jidesoft.grid.ContextSensitiveTable |
convertElementToString, createDefaultTransferHandler, getCellClassAt, getCellEditorFromManager, getCellRendererFromManager, getConverterContextAt, getDefaultCellRenderer, getEditorContextAt, invalidateCellRendererCache, isCellEditorManagerEnabled, isCellRendererManagerEnabled, setCellEditorManagerEnabled, setCellRendererManagerEnabled, setDefaultCellRenderer |
Methods inherited from class com.jidesoft.grid.JideTable |
addCellEditorListener, addColumnSelectionInterval, addNotify, addRowSelectionInterval, addRowValidator, addUndo, addUndoableEditListener, addValidator, adjustSelectionWhenColumnMoved, alwaysCalculateCellRect, calculateAutoResizedRowHeights, calculateAutoResizedRowHeights, clearSelection, clearSelectionPermanently, columnSelectionChanged, configureEnclosingScrollPaneExplicitly, convertRowIndexToModel, convertRowIndexToView, createCellAutoCompletion, createDefaultColumnsFromModel, createDefaultSelectionModel, createDefaultTableHeader, createDefaultTableSelectionModel, createRowAutoScrollingListener, createRowHeights, createSortHeaderRenderer, editingCanceled, editingStopped, fireEditingCanceled, fireEditingStarted, fireEditingStarting, fireEditingStopped, fireEditingStopping, getCellEditorListeners, getClickCountToStart, getDefaultRenderer, getEditorAutoCompletionMode, getEditorAutoCompletionMode, getEditorCellRect, getGridColor, getGridColorProvider, getRolloverCellEditor, getRolloverColumn, getRolloverRow, getRowHeight, getRowHeights, getRowValidator, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getTableColumnWidthKeeper, getTableHeaderToolTipText, getTableHeaderToolTipText, getTableSelectionModel, getTextComponentForEditorComponent, getToolTipText, getUndoManager, getValidator, getVerticalGridColor, indexChanged, initTable, isAdjustEditorLocationOnModelChanged, isAlwaysRequestFocusForEditor, isAutoResizeFillMode, isAutoSelectTextWhenStartsEditing, isAutoStartCellEditing, isAutoStartCellEditingKey, isBatchProcessing, isCalculateRowHeightsOnWidthChange, isCellContentVisible, isClearPropertyAtStructureChange, isClearSelectionOnTableDataChanges, isColumnAutoResizable, isColumnResizable, isColumnSelected, isEnableIgnored, isFillBottom, isFillGrids, isFillRight, isFillsBottom, isFillsGrids, isFillsGridsBottom, isFillsGridsRight, isFillsRight, isKeepRowHeights, isLoadSelectionOnTableDataChanged, isNestedTableHeader, isNonContiguousCellSelection, isRollover, isRowAutoResizes, isRowHeightChanged, isRowResizable, isRowSelected, isScrollRowWhenRowHeightChanges, isSelectInsertedRows, isTablePrinting, isValidCellEditingKey, isVariousRowHeights, loadTableRowSettings, paintFillHeader, removeCellEditorListener, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRolloverEditor, removeRowSelectionInterval, removeRowValidator, removeUndoableEditListener, removeValidator, resetTransferHandler, saveTableRowSettings, scrollRowToVisible, selectAll, setAdjustEditorLocationOnModelChanged, setAlwaysRequestFocusForEditor, setAutoResizeMode, setAutoSelectTextWhenStartsEditing, setAutoStartCellEditing, setBatchProcessing, setCalculateRowHeightsOnWidthChange, setCellContentVisible, setClearPropertyAtStructureChange, setClearSelectionOnTableDataChanges, setClickCountToStart, setColumnAutoResizable, setColumnResizable, setColumnSelectionAllowed, setColumnSelectionInterval, setEditorAutoCompletionMode, setEnabled, setEnableIgnored, setFillBottom, setFillGrids, setFillRight, setFillsBottom, setFillsGrids, setFillsRight, setGridColorProvider, setKeepRowHeights, setLoadSelectionOnTableDataChanged, setModel, setNestedTableHeader, setNonContiguousCellSelection, setPreferredSize, setRowAutoResizes, setRowHeight, setRowHeight, setRowHeights, setRowResizable, setRowSelectionAllowed, setRowSelectionInterval, setScrollRowWhenRowHeightChanges, setSelectInsertedRows, setSortTableHeaderRenderer, setTableColumnWidthKeeper, setTableHeader, setTablePrinting, setTableSelectionModel, setVariousRowHeights, startCellEditing, validate, validateRow |
Methods inherited from class javax.swing.JTable |
columnMarginChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createScrollPaneForTable, doLayout, editCellAt, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPrintable, getRowCount, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, initializeLocalVars, isCellEditable, isEditing, moveColumn, paramString, print, print, print, print, print, resizeAndRepaint, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setCellEditor, setCellSelectionEnabled, setColumnModel, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowMargin, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, unconfigureEnclosingScrollPane |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, 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, 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, toString, transferFocus, transferFocusUpCycle |
PROPERTY_DOUBLE_CLICK_ENABLED
public static final String PROPERTY_DOUBLE_CLICK_ENABLED
- See Also:
- Constant Field Values
HeaderTable
public HeaderTable(PivotTablePane pivotTablePane)
HeaderTable
public HeaderTable(PivotTablePane pivotTablePane,
TableModel dm)
addColumn
public void addColumn(TableColumn column)
- Description copied from class:
JideTable
- Overrides this method to skip the column that is being added when the column was hidden earlier by
TableColumnChooser.hideColumn(javax.swing.JTable, int)
method.
- Overrides:
addColumn
in class JideTable
- Parameters:
column
- the TableColumn to be added.
getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize()
- Specified by:
getPreferredScrollableViewportSize
in interface Scrollable
- Overrides:
getPreferredScrollableViewportSize
in class JTable
valueChanged
public void valueChanged(TableSelectionEvent e)
- Description copied from interface:
TableSelectionListener
- Called whenever the value of the selection changes.
- Specified by:
valueChanged
in interface TableSelectionListener
- Parameters:
e
- the event that characterizes the change.
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChange
in interface PropertyChangeListener
createCellRenderer
protected TableCellRenderer createCellRenderer()
- Creates the special cell renderer for the first column which paints +/- icon and tree line.
- Returns:
- an instance of TreeTableCellRenderer. The same instance will be used to paint the cell of all rows in TreeTable.
createExpandMouseListener
protected HeaderTable.ExpandMouseListener createExpandMouseListener()
- Creates the mouse listener used to handle mouse click on +/- icon.
- Returns:
- a mouse listener.
createExpandMouseInputListener
protected MouseInputListener createExpandMouseInputListener(MouseInputListener listener)
- Creates the mouse listener used to handle mouse click on +/- icon.
- Parameters:
listener
- old listener
- Returns:
- a mouse listener.
isExpandIconVisible
public boolean isExpandIconVisible(Node node)
- Checks if the +/- icon should visible for the node.
- Parameters:
node
- the node.
- Returns:
- true or false.
handleMousePressedEvent
protected void handleMousePressedEvent(MouseEvent e)
- Handles the mouse press event. It does three things. If single mouse clicks on the +/- icon will expand/collapse the row. Otherwise, it will select the related rows or columns.
- Parameters:
e
- the MouseEvent.
isClickOnIcon
protected boolean isClickOnIcon(Point p)
- Checks if the click iis on an expand / collapse icon.
- Parameters:
p
- the mouse point
- Returns:
- true if the click is on an expand / collapse icon. Otherwise false.
- Since:
- 3.2.4
handleMouseDraggedEvent
protected void handleMouseDraggedEvent(MouseEvent e,
Point startPoint)
- Handles the mouse drag event. it will select the related rows or columns.
- Parameters:
e
- the MouseEvent.startPoint
- the start point when the mouse was pressed.
convertValuesToString
protected String convertValuesToString(Values values,
boolean isRowHeader)
- Converts the Values to string to show in the context menu.
- Parameters:
values
- the Values instanceisRowHeader
- the flag indicating that the values is row values or column values
- Returns:
- the converted string. Empty string if its not a valid value.
- Since:
- 3.3.3
createContextMenu
protected JPopupMenu createContextMenu(int rowIndex,
int columnIndex)
- Creates context menu for specific row/column in the header table.
- Parameters:
rowIndex
- the row indexcolumnIndex
- the column index
- Returns:
- the context menu to be displayed for the cell.
expandAll
public void expandAll()
collapseAll
public void collapseAll()
getCellRenderer
public TableCellRenderer getCellRenderer(int rowIndex,
int columnIndex)
- Description copied from class:
ContextSensitiveTable
- Returns an appropriate renderer for the cell specified by this row and column. First, it will check if
defaultCellRenderer is set using
ContextSensitiveTable.getDefaultCellRenderer()
method. If null, it will check is ContextSensitiveTable.isCellRendererManagerEnabled()
is true. If true, it will look for the cell renderer that assigned to the
specific column. Only if the renderer is still null, it will use the EditorContext information from
ContextSensitiveTableModel and get the correct CellRedenerer from the CellRendererManager. In any case, if we
can't determine a cell renderer, we will call super.getCellRenderer(row, column) just like regular JTable.
- Overrides:
getCellRenderer
in class CellSpanTable
- Parameters:
rowIndex
- the row of the cell to render, where 0 is the first rowcolumnIndex
- the column of the cell to render, where 0 is the first column
- Returns:
- the renderer for the column and row.
collectCellStyles
protected void collectCellStyles(int row,
int column)
- Description copied from class:
CellStyleTable
- Collects the cell style of the cell and put into a sorted ArrayList which is a field called _cellStyleList.
- Overrides:
collectCellStyles
in class CellStyleTable
- Parameters:
row
- the row index.column
- the column index.
isCellSelected
public boolean isCellSelected(int row,
int column)
- Description copied from interface:
TableAdapter
- Returns true if the specified indices are in the valid range of rows and columns and the cell at the specified
position is selected.
- Specified by:
isCellSelected
in interface TableAdapter
- Overrides:
isCellSelected
in class CellSpanTable
- Parameters:
row
- the row being queriedcolumn
- the column being queried
- Returns:
- true if
row
and column
are valid indices and the cell at index (row,
column)
is selected, where the first row and first column are at index 0
changeSelection
public void changeSelection(int rowIndex,
int columnIndex,
boolean toggle,
boolean extend)
- Description copied from class:
NavigableTable
- Override the default implementation to adjust the selection avoiding the non-navigable cells. This implementation
works for keyboard events only, assuming the direction from the previous anchor selection. Mouse events on
non-navigable cells are blocked in the mouse input listener.
This implementation uses the following conventions:
-
toggle
: false,
extend
: false. Clear the previous selection and ensure the new cell is selected. -
toggle
: false, extend
: true. Extend the previous selection to include
the specified cell. -
toggle
: true, extend
: false. If the
specified cell is selected, deselect it. If it is not selected, select it. -
toggle
:
true, extend
: true. Leave the selection state as it is, but move the anchor index
to the specified location.
- Specified by:
changeSelection
in interface TableAdapter
- Overrides:
changeSelection
in class NavigableTable
- Parameters:
rowIndex
- Affects the selection at row
columnIndex
- Affects the selection at column
toggle
- See description aboveextend
- If true, extend the current selection
updateUI
public void updateUI()
- Overrides:
updateUI
in class CategorizedTable
getPivotTablePane
public PivotTablePane getPivotTablePane()
getExpandableAt
public Expandable getExpandableAt(int rowIndex,
int columnIndex)
- Specified by:
getExpandableAt
in interface ExpandableProvider
getHeaderTableModel
public HeaderTableModel getHeaderTableModel()
editCellAt
public boolean editCellAt(int row,
int column,
EventObject o)
- Overrides:
editCellAt
in class CellSpanTable
getValueAt
public Object getValueAt(int row,
int column)
- Description copied from interface:
TableAdapter
- Returns the cell value at
row
and column
.
Note: The column is specified in the table view's display order, and not in the TableModel
's
column order. This is an important distinction because as the user rearranges the columns in the table, the
column at a given index in the view will change. Meanwhile the user's actions never affect the model's column
ordering.
- Specified by:
getValueAt
in interface TableAdapter
- Overrides:
getValueAt
in class CellSpanTable
- Parameters:
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried
- Returns:
- the Object at the specified cell
getValueAtInString
public String getValueAtInString(int rowIndex,
int columnIndex,
HssfTableUtils.CellValueConverter converter)
- Gets the string value with summary name or the total/grand total. For example, if the stringValue parameter is "Aug", this method will return "Aug Sum" if the cell is a subtotal row/column of "Sum". If the cell is a grand total row or column, this method will return "Grand Total" which is defined in pivot.properties.
- Parameters:
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cellconverter
- the cell value converter if applicable. null if you are not invoking this method for exporting to excel purpose.
- Returns:
- the string including the summary, total or grand total.
getRunningSummaryTitle
protected String getRunningSummaryTitle(RunningSummaryValue value,
String stringValue)
- Gets the title for the running summary type
- Parameters:
value
- the RunningSummaryValuestringValue
- the original title
- Returns:
- the formatted string to show running summary.
- Since:
- 3.3.2
isShowContextMenu
public boolean isShowContextMenu()
- Gets the flag indicating if context menu should be displayed on right click.
- Returns:
- true if the context menu should be displayed. Otherwise false.
- Since:
- 3.2.1
- See Also:
setShowContextMenu(boolean)
setShowContextMenu
public void setShowContextMenu(boolean showContextMenu)
- Sets the flag indicating if context menu should be displayed on right click.
By default, the flag is true. However, if you want to add an additional mouse listener to do something else, you
might have to set this flag to false to make your listener get mouse event correctly.
- Parameters:
showContextMenu
- the flag- Since:
- 3.2.1
isUseNativeRenderer
public boolean isUseNativeRenderer()
- Gets the flag indicating if the AggregateTable should use native renderer to paint its aggregated cells.
- Returns:
- true if native renderer should be used. Otherwise false.
- Since:
- 3.5.12
setUseNativeRenderer
public void setUseNativeRenderer(boolean useNativeRenderer)
- Sets the flag indicating if the AggregateTable should use native renderer to paint its aggregated cells.
- Parameters:
useNativeRenderer
- the flag- Since:
- 3.5.12