JIDE 3.5.15

com.jidesoft.grid
Class TableSplitPane

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 com.jidesoft.swing.JideSplitPane
                      extended by com.jidesoft.grid.TableSplitPane
All Implemented Interfaces:
ComponentListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class TableSplitPane
extends JideSplitPane

TableSplitPane displays a MultiTableModel in several separate tables in a JideSplitPane. However those tables are synchronized. You can use tab or left key to navigate to all tables just like they are in the same table.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jidesoft.swing.JideSplitPane
JideSplitPane.AccessibleJideSplitPane
 
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
protected  MultiTableModel _originalFooterTableModel
           
protected  MultiTableModel _originalHeaderTableModel
           
protected  MultiTableModel _originalTableModel
           
protected  TableScrollPane[] _tableScrollPanes
           
static String TABLE_INDEX
           
static String TABLESPLITPANE_KEY
           
 
Fields inherited from class com.jidesoft.swing.JideSplitPane
_windowDeactivatedListener, CONTINUOUS_LAYOUT_PROPERTY, DIVIDER_SIZE_PROPERTY, GRIPPER_PROPERTY, HORIZONTAL_SPLIT, NON_CONTINUOUS_DIVIDER, ONE_TOUCH_EXPANDABLE_PROPERTY, ORIENTATION_PROPERTY, PROPERTY_DIVIDER_LOCATION, PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED, PROPORTIONAL_LAYOUT_PROPERTY, PROPORTIONS_PROPERTY, VERTICAL_SPLIT
 
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
TableSplitPane()
           
TableSplitPane(MultiTableModel tableModel)
          Creates a TableSplitPane.
TableSplitPane(MultiTableModel tableModel, MultiTableModel footerTableModel)
          Creates a TableSplitPane with footer table.
TableSplitPane(MultiTableModel tableModel, MultiTableModel footerTableModel, boolean sortable)
          Creates a TableSplitPane with footer table.
TableSplitPane(MultiTableModel tableModel, MultiTableModel headerTableModel, MultiTableModel footerTableModel, boolean sortable)
          Creates a TableSplitPane with footer table.
 
Method Summary
 int convertColumnIndexToModel(int viewIndex)
          Convert the view column index in the entire TableScrollPane to model index.
 int convertColumnIndexToView(int modelIndex)
          Convert the view column index in the entire TableScrollPane to model index.
protected  MultiTableModel createSortableTableModel(MultiTableModel tableModel, boolean sortable)
          Creates a SortableTableModel or SortableTreeTableModel for the MultiTableModel if isSortable() is true.
protected  TableScrollPane createTableScrollPane(MultiTableModel tableModel, MultiTableModel headerTableModel, MultiTableModel footerTableModel, int tableIndex, boolean sortable)
          Creates the TableScrollPane used in each pane of the TableSplitPane.
 int getColumnCount()
          Gets the total column count of TableScrollPane.
 MultiTableModel getOriginalFooterTableModel()
          Gets the original footer table model.
 MultiTableModel getOriginalTableModel()
          Gets the original table model.
 int getSelectedColumn()
          Returns the index of the first selected column, -1 if no column is selected.
 int getSelectedColumnCount()
          Returns the number of selected columns.
 int[] getSelectedColumns()
          Returns the indices of all selected columns.
 int getSelectedRow()
          Returns the index of the first selected row, -1 if no row is selected.
 int getSelectedRowCount()
          Returns the number of selected rows.
 int[] getSelectedRows()
          Returns the indices of all selected rows.
 TableCustomizer getTableCustomizer()
          Gets the table customizer.
 TableCustomizer getTableCustomizer(int tableIndex)
          Gets the table customizer for the designated table.
 TableScrollPane[] getTableScrollPanes()
          Gets the array of TableScrollPane.
 void setTableCustomizer(TableCustomizer tableCustomizer)
          Sets the table customizer.
 void setTableModels(MultiTableModel tableModel, MultiTableModel footerTableModel, boolean sortable)
          Sets the original table models.
 void setTableModels(MultiTableModel tableModel, MultiTableModel headerTableModel, MultiTableModel footerTableModel, boolean sortable)
          Sets the original table models.
 
Methods inherited from class com.jidesoft.swing.JideSplitPane
addExtraDividers, addPane, addProportion, componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, createSplitPaneDivider, doLayout, dragDividerTo, finishDraggingTo, getAccessibleContext, getDividerAt, getDividerLocation, getDividerLocations, getDividerSize, getDividerStepSize, getLeftOneTouchButtonImageIcon, getNextDividerLocation, getOrientation, getPaneAt, getPaneCount, getPreviousDividerLocation, getProportions, getRightOneTouchButtonImageIcon, indexOf, indexOfDivider, indexOfPane, insertPane, insertPane, isContinuousLayout, isDragResizable, isHeavyweightComponentEnabled, isInitiallyEven, isOneTouchExpandable, isProportionalLayout, isShowGripper, isValidateRoot, removeExtraDividers, removePane, removePane, removeProportion, resetToPreferredSizes, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerLocations, setDividerSize, setDividerStepSize, setDividersVisible, setDragResizable, setHeavyweightComponentEnabled, setInitiallyEven, setLeftOneTouchButtonImageIcon, setOneTouchExpandable, setOrientation, setPaneAt, setPaneAt, setProportionalLayout, setProportions, setRightOneTouchButtonImageIcon, setShowGripper, setVisible, startDragging, updateUI
 
Methods inherited from class javax.swing.JPanel
getUI, getUIClassID, paramString, setUI
 
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, 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_originalTableModel

protected MultiTableModel _originalTableModel

_originalFooterTableModel

protected MultiTableModel _originalFooterTableModel

_originalHeaderTableModel

protected MultiTableModel _originalHeaderTableModel

_tableScrollPanes

protected TableScrollPane[] _tableScrollPanes

TABLE_INDEX

public static final String TABLE_INDEX
See Also:
Constant Field Values

TABLESPLITPANE_KEY

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

TableSplitPane

public TableSplitPane()

TableSplitPane

public TableSplitPane(MultiTableModel tableModel)
Creates a TableSplitPane. The tables will not be sortable.

Parameters:
tableModel - the MultiTableModel. This is the main table model that will be used to create upto three tables in TableSplitPane.

TableSplitPane

public TableSplitPane(MultiTableModel tableModel,
                      MultiTableModel footerTableModel)
Creates a TableSplitPane with footer table. The tables will not be sortable.

Parameters:
tableModel - the MultiTableModel. This is the main table model that will be used to create upto three tables in TableSplitPane.
footerTableModel - the footer table model. It will be used to create a footer table below the main table. It must have the same column count as the MultiTableModel's non-header and non-footer column count.

TableSplitPane

public TableSplitPane(MultiTableModel tableModel,
                      MultiTableModel footerTableModel,
                      boolean sortable)
Creates a TableSplitPane with footer table. You can specify if the tables are sortable.

Parameters:
tableModel - the MultiTableModel. This is the main table model that will be used to create upto three tables in TableSplitPane.
footerTableModel - the footer table model. It will be used to create a footer table below the main table. It must have the same column count as the MultiTableModel's non-header and non-footer column count.
sortable - if the tables will be sortable.

TableSplitPane

public TableSplitPane(MultiTableModel tableModel,
                      MultiTableModel headerTableModel,
                      MultiTableModel footerTableModel,
                      boolean sortable)
Creates a TableSplitPane with footer table. You can specify if the tables are sortable.

Parameters:
tableModel - the MultiTableModel. This is the main table model that will be used to create upto three tables in TableSplitPane.
headerTableModel - the header table model. It will be used to create a header table above the main table. It must have the same column count as the MultiTableModel's non-header and non-footer column count.
footerTableModel - the footer table model. It will be used to create a footer table below the main table. It must have the same column count as the MultiTableModel's non-header and non-footer column count.
sortable - if the tables will be sortable.
Method Detail

createSortableTableModel

protected MultiTableModel createSortableTableModel(MultiTableModel tableModel,
                                                   boolean sortable)
Creates a SortableTableModel or SortableTreeTableModel for the MultiTableModel if isSortable() is true. Otherwise, tableModel itself will be returned.

See below for the default code.

 TableModel actualTableModel;
 if (tableModel instanceof TreeTableModel && sortable) {
     actualTableModel = new SortableTreeTableModel(tableModel);
 }
 else if (!(tableModel instanceof ISortableTableModel) && sortable) {
     actualTableModel = new SortableTableModel(tableModel);
 }
 else {
     actualTableModel = tableModel;
 }
 return actualTableModel;
 

Parameters:
tableModel - the MultiTableModel
sortable - true or false. If true, the tableModel should be wrapped into a SortableTableModel or SortableTreeTableModel.
Returns:
a SortableTableModel or SortableTreeTableModel for the MultiTableModel if isSortable() is true.

setTableModels

public void setTableModels(MultiTableModel tableModel,
                           MultiTableModel footerTableModel,
                           boolean sortable)
Sets the original table models.

Parameters:
tableModel - the main table model
footerTableModel - the footer table model. If you don't have any footer, you can pass null.
sortable - if the table need to be sorted

setTableModels

public void setTableModels(MultiTableModel tableModel,
                           MultiTableModel headerTableModel,
                           MultiTableModel footerTableModel,
                           boolean sortable)
Sets the original table models.

Parameters:
tableModel - the main table model
headerTableModel - the header table model. If you don't have any header, you can pass null.
footerTableModel - the footer table model. If you don't have any footer, you can pass null.
sortable - if the table need to be sorted

getOriginalTableModel

public MultiTableModel getOriginalTableModel()
Gets the original table model.

Returns:
the original table model.

getOriginalFooterTableModel

public MultiTableModel getOriginalFooterTableModel()
Gets the original footer table model.

Returns:
the original footer table model.

createTableScrollPane

protected TableScrollPane createTableScrollPane(MultiTableModel tableModel,
                                                MultiTableModel headerTableModel,
                                                MultiTableModel footerTableModel,
                                                int tableIndex,
                                                boolean sortable)
Creates the TableScrollPane used in each pane of the TableSplitPane.

Parameters:
tableModel - the main table model
headerTableModel - the header table model
footerTableModel - the footer table model
tableIndex - the table index
sortable - if the tables need to be sorted
Returns:
the TableScrollPane.

getTableScrollPanes

public TableScrollPane[] getTableScrollPanes()
Gets the array of TableScrollPane.

Returns:
the array of TableScrollPane.

getTableCustomizer

public TableCustomizer getTableCustomizer()
Gets the table customizer. It will use when create the tables used by this TableSplitPane.

Returns:
the table customizer.

setTableCustomizer

public void setTableCustomizer(TableCustomizer tableCustomizer)
Sets the table customizer. It will use when create the tables used by this TableSplitPane.

Parameters:
tableCustomizer - the new table customizer.

getTableCustomizer

public TableCustomizer getTableCustomizer(int tableIndex)
Gets the table customizer for the designated table. It will use when create the tables with the same table index.

Parameters:
tableIndex - the table index
Returns:
the table customizer.

getSelectedRow

public int getSelectedRow()
Returns the index of the first selected row, -1 if no row is selected.

Returns:
the index of the first selected row
Since:
3.1.1

getSelectedColumn

public int getSelectedColumn()
Returns the index of the first selected column, -1 if no column is selected.

Returns:
the index of the first selected column
Since:
3.1.1

getSelectedRows

public int[] getSelectedRows()
Returns the indices of all selected rows.

Returns:
an array of integers containing the indices of all selected rows, or an empty array if no row is selected
Since:
3.1.1
See Also:
getSelectedRow()

getSelectedColumns

public int[] getSelectedColumns()
Returns the indices of all selected columns.

Returns:
an array of integers containing the indices of all selected columns, or an empty array if no column is selected
Since:
3.1.1
See Also:
getSelectedColumn()

convertColumnIndexToView

public int convertColumnIndexToView(int modelIndex)
Convert the view column index in the entire TableScrollPane to model index.

Parameters:
modelIndex - the model column index
Returns:
the view index
Since:
3.1.1

getColumnCount

public int getColumnCount()
Gets the total column count of TableScrollPane.

Returns:
the total column count of TableScrollPane.
Since:
3.1.1

convertColumnIndexToModel

public int convertColumnIndexToModel(int viewIndex)
Convert the view column index in the entire TableScrollPane to model index.

Parameters:
viewIndex - the view column index counting from 0 including row header table, main table and row footer table
Returns:
the model index.
Since:
3.1.1

getSelectedRowCount

public int getSelectedRowCount()
Returns the number of selected rows.

Returns:
the number of selected rows, 0 if no rows are selected
Since:
3.1.1

getSelectedColumnCount

public int getSelectedColumnCount()
Returns the number of selected columns.

Returns:
the number of selected columns, 0 if no columns are selected
Since:
3.1.1

JIDE 3.5.15