JIDE 3.5.15

com.jidesoft.grid
Class CellSpanTable

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by com.jidesoft.grid.JideTable
                      extended by com.jidesoft.grid.ContextSensitiveTable
                          extended by com.jidesoft.grid.NavigableTable
                              extended by com.jidesoft.grid.CellStyleTable
                                  extended by com.jidesoft.grid.CellSpanTable
All Implemented Interfaces:
IndexChangeListener, TableAdapter, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable
Direct Known Subclasses:
CategorizedTable

public class CellSpanTable
extends CellStyleTable

CellSpanTable introduces cell spans to table. As long as the table model implements SpanModel and its SpanModel.isCellSpanOn() returns true, CellSpanTable will use the CellSpan that is returned from SpanModel.getCellSpanAt(int, int) to span the cell. The span could be across several rows or several columns. If you know the table data and cell span beforehand, you can use DefaultSpanTableModel. If the table data is dynamic so is the cell span, you should use AbstractSpanTableModel.

Please note, If you want to use cell span that spans across several columns, you'd better disable column reordering using getTableHeader().setReorderingAllowed(false). Otherwise, user reordering column will mess up the cell span. However it is OK to hide some columns that is part of the cell span.

See Also:
Serialized Form

Nested Class Summary
protected static class CellSpanTable.DelegateAction
           
 
Nested classes/interfaces inherited from class com.jidesoft.grid.JideTable
JideTable.NonContiguousTransferHandler
 
Nested classes/interfaces inherited from class javax.swing.JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
 
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 int AUTO_CELL_MERGE_COLUMNS
           
static int AUTO_CELL_MERGE_COLUMNS_LIMITED
           
static int AUTO_CELL_MERGE_OFF
           
static int AUTO_CELL_MERGE_ROWS
           
static int AUTO_CELL_MERGE_ROWS_LIMITED
           
static String PROPERTY_AUTO_CONVERT_CELL_SPAN
           
static String PROPERTY_PAINT_CELL_SPAN_AS_SELECTED
           
 
Fields inherited from class com.jidesoft.grid.CellStyleTable
_cellStyleList, PROPERTY_FILLS_SELECTION, PROPERTY_FILLS_VIEWPORT_WITH_STRIPE
 
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
 
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
CellSpanTable()
           
CellSpanTable(int numRows, int numColumns)
           
CellSpanTable(Object[][] rowData, Object[] columnNames)
           
CellSpanTable(TableModel dm)
           
CellSpanTable(TableModel dm, TableColumnModel cm)
           
CellSpanTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm)
           
CellSpanTable(Vector<?> rowData, Vector<?> columnNames)
           
 
Method Summary
protected  CellSpan binarySearch(List<CellSpan> cache, int row, int column)
          Search the CellSpan from the cache based on the row and column.
protected  int calculateRowHeight(int row)
          The method calculates the height for the row based on the content in the row.
 void calculateRowHeight(int row, boolean doWholeSpan)
          Calculate the height of a rows based on the preferred size of contents in each of its cells.
 void calculateRowHeights()
          Calculate the height of all rows based on the preferred size of contents in each of a row's cells.
 void columnAdded(TableColumnModelEvent e)
           
 int columnAtPoint(Point point)
           
 void columnMoved(TableColumnModelEvent e)
           
 void columnRemoved(TableColumnModelEvent e)
           
 CellSpan convertModelCellSpanToView(CellSpan span)
          Converts the cell span from table model to the cell span from the view.
 CellSpan convertViewCellSpanToModel(CellSpan span)
          Converts the cell span from view to the cell span from the table model.
protected  List<CellSpan> createCellSpanCache()
          Create the CellSpan cache.
protected  Action createDelegateAction(Action action, KeyStroke keyStroke)
           
 boolean editCellAt(int row, int column, EventObject o)
           
 int getActualRowHeight(int row)
          Get actual row height of a row.
 String getActualUIClassID()
           
 int getAutoCellMerge()
          Gets the autoCellMerge mode.
protected  List<CellSpan> getCache()
           
protected  Set<com.jidesoft.grid.CellSpanTable.Cell> getCacheEmpty()
           
 TableCellEditor getCellEditor(int row, int column)
          Returns an appropriate cell editor for the cell specified by this row and column.
 Rectangle getCellRect(int row, int column, boolean includeSpacing)
           
 TableCellRenderer getCellRenderer(int row, int column)
          Returns an appropriate renderer for the cell specified by this row and column.
 CellSpan getCellSpanAt(int row, int column)
          Gets the cell span at the specified cell.
 CellSpan getCellSpanAt(SpanModel spanModel, int row, int column)
          Gets the cell span at the specified cells.
protected  CellSpan getCellSpanFromAutoCellMerge(int row, int column)
           
protected  CellSpan getCellSpanFromSpanModel(int row, int column)
           
protected  Rectangle getDirtyRegion(int firstRow, int firstColumn, int lastRow, int lastColumn)
          Gets the dirty region from the first row, first column and last row, last column considering CellSpan.
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
          Overrides the method in JTable in order provide a smooth vertical scrolling.
 TableModel getSpanModel()
          Gets span model.
 Object getValueAt(int row, int column)
          Returns the cell value at row and column.
 void invalidateCellSpanCache()
          Invalidates the cell span cache.
 boolean isAutoConvertCellSpan()
          Check the autoConvertCellSpan flag.
protected  boolean isCellFocused(int rowIndex, int columnIndex)
          Check if the cell is a focused cell inside the table.
 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.
 boolean isCellSpanCacheEnabled()
          Get the flag indicating if the cache for cell span is enabled.
 boolean isCellSpanOn()
          Checks if the cell span is on.
 boolean isKeepColumnAtPoint()
          Checks if columnAtPoint(java.awt.Point) method will return the actual column index without considering the cell spans.
 boolean isKeepRowAtPoint()
          Checks if rowAtPoint(java.awt.Point) method will return the actual row index without considering the cell spans.
 boolean isPaintCellSpanAsSelected()
          Check the paintCellSpanAsSelected flag.
protected  void muteDefaultKeyStroke()
           
 int originalColumnAtPoint(Point point)
          The columnAtPoint method without considering the cell spans.
 Rectangle originalGetCellRect(int row, int column, boolean includeSpacing)
          Gets the original cell rect of the cell at row and column without considering the cell spans.
 int originalRowAtPoint(Point point)
          The rowAtPoint method without considering the cell spans.
 Component prepareEditor(TableCellEditor editor, int row, int column)
          Override this method to get the style from CellStyle defined by StyleModel and set it to component return from super.prepareEditor().
protected  void replaceAction(KeyStroke keyStroke)
          Registers an action for the KeyStroke.
protected  void replaceAction(KeyStroke keyStroke, int condition)
          Registers an action for the KeyStroke.
protected  void restoreAction(KeyStroke keyStroke)
          Restores the action registered using replaceAction(javax.swing.KeyStroke).
protected  void restoreAction(KeyStroke keyStroke, int condition)
          Restores the action registered using replaceAction(javax.swing.KeyStroke, int).
 boolean rolloverCellAt(int row, int column)
          Makes the cell enters editing mode without forcing the other cell editor, if any, to stop editing.
 int rowAtPoint(Point point)
          Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].
 void setAutoCellMerge(int autoCellMerge)
          Sets the autoCellMerge mode.
 void setAutoConvertCellSpan(boolean autoConvertCellSpan)
          By default, we will automatically convert CellSpan from model to view and vice verse in order to consider the case of hidden columns.
 void setCellSpanCacheEnabled(boolean cellSpanCacheEnabled)
          Set the flag indicating if the cache for cell span is enabled.
 void setKeepColumnAtPoint(boolean keepColumnAtPoint)
          CellSpanTable overrides columnAtPoint(java.awt.Point) method to consider the cell span.
 void setKeepRowAtPoint(boolean keepRowAtPoint)
          CellSpanTable overrides rowAtPoint(java.awt.Point) method to consider the cell span.
 void setPaintCellSpanAsSelected(boolean paintCellSpanAsSelected)
          By default, we will paint the whole cell span as selected when the cell is indeed selected.
protected  boolean shouldCellBePaintedAsFocused(int row, int column)
          Subclass can override this method to determine if the cell should be painted as focused cell when it is a focused cell.
protected  boolean shouldCellBePaintedAsSelected(int row, int column)
          Subclass can override this method to determine if the cell should be painted as selected when selected.
 void tableChanged(TableModelEvent e)
          Invoked when this table's TableModel generates a TableModelEvent.
 void valueChanged(ListSelectionEvent e)
           
static boolean verifyCellSpan(CellSpanTable table)
          This is a method for debugging purpose.
static boolean verifyCellSpan(SpanModel spanModel)
          This is a method for debugging purpose.
 
Methods inherited from class com.jidesoft.grid.CellStyleTable
addCellStyleCustomizer, clearCellStyleCustomizers, collectCellStyles, 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
changeSelection, 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, updateUI
 
Methods inherited from class com.jidesoft.grid.JideTable
addCellEditorListener, addColumn, 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, getPreferredScrollableViewportSize, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jidesoft.grid.TableAdapter
getCellSelectionEnabled, getColumnClass, getColumnCount, getColumnName, getColumnSelectionAllowed, getRowCount, getRowSelectionAllowed, isCellEditable, setCellSelectionEnabled, setValueAt
 

Field Detail

AUTO_CELL_MERGE_OFF

public static final int AUTO_CELL_MERGE_OFF
See Also:
Constant Field Values

AUTO_CELL_MERGE_ROWS

public static final int AUTO_CELL_MERGE_ROWS
See Also:
Constant Field Values

AUTO_CELL_MERGE_COLUMNS

public static final int AUTO_CELL_MERGE_COLUMNS
See Also:
Constant Field Values

AUTO_CELL_MERGE_ROWS_LIMITED

public static final int AUTO_CELL_MERGE_ROWS_LIMITED
See Also:
Constant Field Values

AUTO_CELL_MERGE_COLUMNS_LIMITED

public static final int AUTO_CELL_MERGE_COLUMNS_LIMITED
See Also:
Constant Field Values

PROPERTY_AUTO_CONVERT_CELL_SPAN

public static final String PROPERTY_AUTO_CONVERT_CELL_SPAN
See Also:
Constant Field Values

PROPERTY_PAINT_CELL_SPAN_AS_SELECTED

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

CellSpanTable

public CellSpanTable()

CellSpanTable

public CellSpanTable(int numRows,
                     int numColumns)

CellSpanTable

public CellSpanTable(TableModel dm)

CellSpanTable

public CellSpanTable(Object[][] rowData,
                     Object[] columnNames)

CellSpanTable

public CellSpanTable(Vector<?> rowData,
                     Vector<?> columnNames)

CellSpanTable

public CellSpanTable(TableModel dm,
                     TableColumnModel cm)

CellSpanTable

public CellSpanTable(TableModel dm,
                     TableColumnModel cm,
                     ListSelectionModel sm)
Method Detail

columnAdded

public void columnAdded(TableColumnModelEvent e)
Specified by:
columnAdded in interface TableColumnModelListener
Overrides:
columnAdded in class JTable

columnRemoved

public void columnRemoved(TableColumnModelEvent e)
Specified by:
columnRemoved in interface TableColumnModelListener
Overrides:
columnRemoved in class JTable

columnMoved

public void columnMoved(TableColumnModelEvent e)
Specified by:
columnMoved in interface TableColumnModelListener
Overrides:
columnMoved in class JTable

getActualUIClassID

public String getActualUIClassID()
Overrides:
getActualUIClassID in class JideTable

getSpanModel

public TableModel getSpanModel()
Gets span model. By default it just returns the value of getModel(). However if getModel() is TableModelWrapper, it will use TableModelWrapperUtils.getActualTableModel(javax.swing.table.TableModel, Class) to find an instance of SpanModel. If it can finds one, it will return that one. Otherwise, getModel() is returned as fall back.

Returns:
the span model. The return value may or may not be an instance of SpanModel.

getCellSpanAt

public CellSpan getCellSpanAt(SpanModel spanModel,
                              int row,
                              int column)
Gets the cell span at the specified cells. Please note, the row and column value are view index. Inside this method, we will convert it to model index and call spanModel.getCellSpanAt() then we will convert the cell span returned to view index.

The difference of this method from tableModel.getCellSpanAt is the method will use convertModelCellSpanToView(CellSpan) to do auto conversion from model to view if isAutoConvertCellSpan() is true. If isAutoConvertCellSpan() is false, this method is the same as tableModel.getCellSpanAt(row, column).

Please note, you should use getCellSpanAt(int, int) method instead of using this method directly in most cases because this method will not look at isCellSpanOn() value when returning the cell span. In the other word, even if isCellSpanOn() returns false, this method could still return a valid cell span. In comparison, getCellSpanAt(int, int) will always return null if isCellSpanOn() returns false.

Parameters:
spanModel - the SpanModel
row - the row index
column - the column index
Returns:
the cell span

convertModelCellSpanToView

public CellSpan convertModelCellSpanToView(CellSpan span)
Converts the cell span from table model to the cell span from the view. Please note, the conversion is done based on the assumption that some columns could be hidden but the column orders are not changed.

Parameters:
span - the CellSpan
Returns:
the cell span from the view.

convertViewCellSpanToModel

public CellSpan convertViewCellSpanToModel(CellSpan span)
Converts the cell span from view to the cell span from the table model. Please note, the conversion is done based on the assumption that some columns could be hidden but the column orders are not changed.

Parameters:
span - the CellSpan
Returns:
the cell span from the model.

isAutoConvertCellSpan

public boolean isAutoConvertCellSpan()
Check the autoConvertCellSpan flag.

Returns:
the autoConvertCellSpan flag.
See Also:
setAutoConvertCellSpan(boolean)

setAutoConvertCellSpan

public void setAutoConvertCellSpan(boolean autoConvertCellSpan)
By default, we will automatically convert CellSpan from model to view and vice verse in order to consider the case of hidden columns. However this auto conversion is not perfect if the column orders are changed. So if you coded your getCellSpanAt method smartly, you might be able overcome this limitation without using the auto conversion feature. If so, you should set the flag to false. Default is true.

Parameters:
autoConvertCellSpan - true or false.

isPaintCellSpanAsSelected

public boolean isPaintCellSpanAsSelected()
Check the paintCellSpanAsSelected flag.

Returns:
the paintCellSpanAsSelected flag.
Since:
3.3.7
See Also:
setPaintCellSpanAsSelected(boolean)

setPaintCellSpanAsSelected

public void setPaintCellSpanAsSelected(boolean paintCellSpanAsSelected)
By default, we will paint the whole cell span as selected when the cell is indeed selected. However in certain cases, you may want to leave the cell span as not painted. For example, you have a row selection enabled and the first column has a row cell span that spans several rows. If the first cell span is selected when you navigate through the rows within that cell span, it doesn't look very good. In this cas, you can call this method to set it to false so that only the cells except the first column will shown as selected. This flag only works in row selection or column selection mode but not the cell selection nor the non-configuous cell selection mode.

Parameters:
paintCellSpanAsSelected - true or false.
Since:
3.3.7

isKeepColumnAtPoint

public boolean isKeepColumnAtPoint()
Checks if columnAtPoint(java.awt.Point) method will return the actual column index without considering the cell spans.

Returns:
true if columnAtPoint(java.awt.Point) method will return the actual column index without considering the cell spans. Otherwise, false.
See Also:
setKeepColumnAtPoint(boolean)

setKeepColumnAtPoint

public void setKeepColumnAtPoint(boolean keepColumnAtPoint)
CellSpanTable overrides columnAtPoint(java.awt.Point) method to consider the cell span. When the point passed to columnAtPoint() is in a cell span, it will return the anchor column index of that cell span instead of the column index the actual obscured cell. However sometimes it is still useful to know the actual column index. If you call this method and set it to true, columnAtPoint(java.awt.Point) will return the actual column index without considering the cell spans.

Parameters:
keepColumnAtPoint - true or false.

isKeepRowAtPoint

public boolean isKeepRowAtPoint()
Checks if rowAtPoint(java.awt.Point) method will return the actual row index without considering the cell spans.

Returns:
true if rowAtPoint(java.awt.Point) method will return the actual row index without considering the cell spans. Otherwise, false.

setKeepRowAtPoint

public void setKeepRowAtPoint(boolean keepRowAtPoint)
CellSpanTable overrides rowAtPoint(java.awt.Point) method to consider the cell span. When the point passed to rowAtPoint() is in a cell span, it will return the anchor row index of that cell span instead of the row index the actual obscured cell. However sometimes it is still useful to know the actual row index. IF you call this method and set it to true, rowAtPoint(java.awt.Point) will return the actual row index without considering the cell spans.

Parameters:
keepRowAtPoint - true or false.

originalGetCellRect

public Rectangle originalGetCellRect(int row,
                                     int column,
                                     boolean includeSpacing)
Gets the original cell rect of the cell at row and column without considering the cell spans.

Parameters:
row - the row index.
column - the column index.
includeSpacing - if false, return the true cell bounds - computed by subtracting the inter cell spacing from the height and widths of the column and row models
Returns:
the cell rectangle of at row and column without considering the cell spans.

getCellRect

public Rectangle getCellRect(int row,
                             int column,
                             boolean includeSpacing)
Overrides:
getCellRect in class JideTable

originalRowAtPoint

public int originalRowAtPoint(Point point)
The rowAtPoint method without considering the cell spans.

Parameters:
point - the location of the interest.
Returns:
the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1]

originalColumnAtPoint

public int originalColumnAtPoint(Point point)
The columnAtPoint method without considering the cell spans.

Parameters:
point - the location of the interest.
Returns:
the index of the column that point lies in, or -1 if the result is not in the range [0, getColumnCount()-1]

rowAtPoint

public int rowAtPoint(Point point)
Description copied from class: JideTable
Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].

Overrides:
rowAtPoint in class JideTable
Parameters:
point - the location of interest
Returns:
the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1]
See Also:
JTable.columnAtPoint(java.awt.Point)

columnAtPoint

public int columnAtPoint(Point point)
Overrides:
columnAtPoint in class JTable

rolloverCellAt

public boolean rolloverCellAt(int row,
                              int column)
Description copied from class: JideTable
Makes the cell enters editing mode without forcing the other cell editor, if any, to stop editing.

Overrides:
rolloverCellAt in class JideTable
Parameters:
row - the row index.
column - the column index.
Returns:
true if the action is successful.

editCellAt

public boolean editCellAt(int row,
                          int column,
                          EventObject o)
Overrides:
editCellAt in class JideTable

shouldCellBePaintedAsFocused

protected boolean shouldCellBePaintedAsFocused(int row,
                                               int column)
Description copied from class: JideTable
Subclass can override this method to determine if the cell should be painted as focused cell when it is a focused cell. It is just an effect on the view. The cell is the anchor cell in the selection model.

Overrides:
shouldCellBePaintedAsFocused in class JideTable
Parameters:
row - the row index.
column - the column index
Returns:
true to paint the cell as focused when it is the focused cell. False to not paint.

shouldCellBePaintedAsSelected

protected boolean shouldCellBePaintedAsSelected(int row,
                                                int column)
Description copied from class: JideTable
Subclass can override this method to determine if the cell should be painted as selected when selected. It is just an effect on the view. The cell is still selected in the selection model.

Overrides:
shouldCellBePaintedAsSelected in class JideTable
Parameters:
row - the row index.
column - the column index
Returns:
true to paint the cell as selected when it is selected. False to not paint.

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 JideTable
Parameters:
row - the row being queried
column - 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

getCellEditor

public TableCellEditor getCellEditor(int row,
                                     int column)
Description copied from class: ContextSensitiveTable
Returns an appropriate cell editor for the cell specified by this row and column. First, we will check is ContextSensitiveTable.isCellEditorManagerEnabled() is true. If true, it will look for the cell editor that assigned to the specific column. Only if the editor is still null, it will use the EditorContext information from ContextSensitiveTableModel and get the correct CellEditorfrom the CellRendererManager. In any case, if we can't determine a cell editor, we will call super.getCellEditor(row, column) just like regular JTable.

Overrides:
getCellEditor in class ContextSensitiveTable
Parameters:
row - the row of the cell to edit, where 0 is the first row
column - the column of the cell to edit, where 0 is the first column
Returns:
the TableCellEditor that does the editing
See Also:
JTable.cellEditor

getCellRenderer

public TableCellRenderer getCellRenderer(int row,
                                         int column)
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 ContextSensitiveTable
Parameters:
row - the row of the cell to render, where 0 is the first row
column - the column of the cell to render, where 0 is the first column
Returns:
the renderer for the column and row.

prepareEditor

public Component prepareEditor(TableCellEditor editor,
                               int row,
                               int column)
Description copied from class: CellStyleTable
Override this method to get the style from CellStyle defined by StyleModel and set it to component return from super.prepareEditor().

Overrides:
prepareEditor in class CellStyleTable
Parameters:
editor - the cell editor.
row - the row index.
column - the column index.
Returns:
the component used to edit the cell at the specified row and column.

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 JideTable
Parameters:
row - the row whose value is to be queried
column - the column whose value is to be queried
Returns:
the Object at the specified cell

isCellFocused

protected boolean isCellFocused(int rowIndex,
                                int columnIndex)
Description copied from class: JideTable
Check if the cell is a focused cell inside the table.

Overrides:
isCellFocused in class JideTable
Parameters:
rowIndex - the row index of the cell
columnIndex - the column index of the cell
Returns:
true if the cell is focused. Otherwise false.

getDirtyRegion

protected Rectangle getDirtyRegion(int firstRow,
                                   int firstColumn,
                                   int lastRow,
                                   int lastColumn)
Gets the dirty region from the first row, first column and last row, last column considering CellSpan.

Overrides:
getDirtyRegion in class JideTable
Parameters:
firstRow - the first row
firstColumn - the first column
lastRow - the last row
lastColumn - the last column
Returns:
the dirty region that covers the first cell and the last cell.
Since:
3.3.7

isCellSpanOn

public boolean isCellSpanOn()
Checks if the cell span is on.

There are now two possibilities to turn the cell span on. One is from getAutoCellMerge() while another is from SpanModel.

Returns:
true if cell span is on. Otherwise false.

getCellSpanAt

public CellSpan getCellSpanAt(int row,
                              int column)
Gets the cell span at the specified cell. Please note, the column index is on the view. Inside this method, we will convert it to the model index and call spanModel.getCellSpanAt() then we will convert the returned cell span back to the view.

Please note the difference of this method from tableModel.getCellSpanAt is the method will use convertModelCellSpanToView(CellSpan) to do auto conversion from model to view if isAutoConvertCellSpan() is true. If isAutoConvertCellSpan() is false, this method is the same as tableModel.getCellSpanAt(row, column). If isCellSpanOn() returns false, this method will always return null.

Parameters:
row - the row index
column - the column index
Returns:
the cell span

createCellSpanCache

protected List<CellSpan> createCellSpanCache()
Create the CellSpan cache.

Returns:
the CellSpan cache.
Since:
3.5.13

binarySearch

protected CellSpan binarySearch(List<CellSpan> cache,
                                int row,
                                int column)
Search the CellSpan from the cache based on the row and column.

Parameters:
cache - the CellSpan cache
row - the row index
column - the column index
Returns:
the CellSpan that contains that row and column. Otherwise null.
Since:
3.5.13

getCellSpanFromAutoCellMerge

protected CellSpan getCellSpanFromAutoCellMerge(int row,
                                                int column)

getCellSpanFromSpanModel

protected CellSpan getCellSpanFromSpanModel(int row,
                                            int column)

valueChanged

public void valueChanged(ListSelectionEvent e)
Specified by:
valueChanged in interface ListSelectionListener
Overrides:
valueChanged in class JideTable

tableChanged

public void tableChanged(TableModelEvent e)
Description copied from class: JideTable
Invoked when this table's TableModel generates a TableModelEvent. The TableModelEvent should be constructed in the coordinate system of the model; the appropriate mapping to the view coordinate system is performed by this JTable when it receives the event.

Application code will not use these methods explicitly, they are used internally by JTable.

Specified by:
tableChanged in interface TableModelListener
Overrides:
tableChanged in class JideTable

invalidateCellSpanCache

public void invalidateCellSpanCache()
Invalidates the cell span cache. Any table model event from the table model will trigger this method automatically. If there is no table model event, you should call this method when the CellSpan returned from getCellSpanAt changes.


muteDefaultKeyStroke

protected void muteDefaultKeyStroke()

createDelegateAction

protected Action createDelegateAction(Action action,
                                      KeyStroke keyStroke)

isCellSpanCacheEnabled

public boolean isCellSpanCacheEnabled()
Get the flag indicating if the cache for cell span is enabled.

The default value for the flag is true so that we can gain better performance at this case.

If you have any design which want to force every cell has to call getCellSpanAt() every time, you need set this flag to false.

Returns:
true if you need enable the cache. Otherwise false.

setCellSpanCacheEnabled

public void setCellSpanCacheEnabled(boolean cellSpanCacheEnabled)
Set the flag indicating if the cache for cell span is enabled.

Parameters:
cellSpanCacheEnabled - the flag
See Also:
isCellSpanCacheEnabled()

replaceAction

protected void replaceAction(KeyStroke keyStroke)
Registers an action for the KeyStroke. Different from registerKeyboardAction method available on JComponent, this method will find out if the KeyStroke is taken. If yes, it will use a DelegateAction defined in CellSpanTable and call user action first then user can write code to decide if it continues to call the previous registered action.

Parameters:
keyStroke - the KeyStroke.

replaceAction

protected void replaceAction(KeyStroke keyStroke,
                             int condition)
Registers an action for the KeyStroke. Different from registerKeyboardAction method available on JComponent, this method will find out if the KeyStroke is taken. If yes, it will use a DelegateAction defined in CellSpanTable and call user action first then user can write code to decide if it continues to call the previous registered action.

Parameters:
keyStroke - the KeyStroke.
condition - the condition. Valid values are JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, JComponent.WHEN_FOCUSED and JComponent.WHEN_IN_FOCUSED_WINDOW.

restoreAction

protected void restoreAction(KeyStroke keyStroke)
Restores the action registered using replaceAction(javax.swing.KeyStroke).

Parameters:
keyStroke - the KeyStroke.

restoreAction

protected void restoreAction(KeyStroke keyStroke,
                             int condition)
Restores the action registered using replaceAction(javax.swing.KeyStroke, int).

Parameters:
keyStroke - the KeyStroke.
condition - the condition. Valid values are JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, JComponent.WHEN_FOCUSED and JComponent.WHEN_IN_FOCUSED_WINDOW.

calculateRowHeights

public void calculateRowHeights()
Calculate the height of all rows based on the preferred size of contents in each of a row's cells.


calculateRowHeight

public void calculateRowHeight(int row,
                               boolean doWholeSpan)
Calculate the height of a rows based on the preferred size of contents in each of its cells.

Parameters:
row - int
doWholeSpan - boolean indicates whether to check all the rows in a span, if any, that the given row might belong to. If false, height of none of the rows that might belong to the same spans as the given row would be recalculated.

calculateRowHeight

protected int calculateRowHeight(int row)
Description copied from class: JideTable
The method calculates the height for the row based on the content in the row.

The method will not change the row height of the designated row.

Overrides:
calculateRowHeight in class JideTable
Parameters:
row - the row to be calculated
Returns:
new height appropriate for the row.

verifyCellSpan

public static boolean verifyCellSpan(SpanModel spanModel)
This is a method for debugging purpose. If you have a complex cell spanning, you can call this method to verify if your code is correct. If cell span definition is inconsistent among all the cells in the same cell span, this method will print out an error message.

Parameters:
spanModel - the SpanModel.
Returns:
true if valid. Otherwise false. Error messages will be printed.

verifyCellSpan

public static boolean verifyCellSpan(CellSpanTable table)
This is a method for debugging purpose. If you have a complex cell spanning, you can call this method to verify if your code is correct. If cell span definition is inconsistent among all the cells in the same cell span, this method will print out an error message.

Parameters:
table - the CellSpanTable.
Returns:
true if valid. Otherwise false. Error messages will be printed.

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Overrides the method in JTable in order provide a smooth vertical scrolling. If not overriding this method, pressing scroll down and scroll up button will scroll the whole row height including the height of cell span. This is not desired by most users. So we add code to scroll only the actual row height for vertical scrolling.

Specified by:
getScrollableUnitIncrement in interface Scrollable
Overrides:
getScrollableUnitIncrement in class JTable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "unit" increment for scrolling in the specified direction

getActualRowHeight

public int getActualRowHeight(int row)
Get actual row height of a row.

By default, it returns getRowHeight(int). However, for HierarchicalTable scenario, it could be different. If you have a CellSpanTable which has the similar behavior with HierarchicalTable, you would need override this method to return actual row height of a row.

Parameters:
row - the row index
Returns:
the actual row height.

getCache

protected List<CellSpan> getCache()

getCacheEmpty

protected Set<com.jidesoft.grid.CellSpanTable.Cell> getCacheEmpty()

getAutoCellMerge

public int getAutoCellMerge()
Gets the autoCellMerge mode. It could be AUTO_CELL_MERGE_OFF, AUTO_CELL_MERGE_ROWS or AUTO_CELL_MERGE_COLUMNS, AUTO_CELL_MERGE_ROWS_LIMITED and AUTO_CELL_MERGE_COLUMNS_LIMITED. If on, the cell spans will be created automatically for the adjacent cells that have the same value on the same row or on the same column.

Returns:
true or false.

setAutoCellMerge

public void setAutoCellMerge(int autoCellMerge)
Sets the autoCellMerge mode.

Parameters:
autoCellMerge - the new value for the autoCellMerge mode. Valid values are AUTO_CELL_MERGE_OFF, AUTO_CELL_MERGE_ROWS, AUTO_CELL_MERGE_COLUMNS, AUTO_CELL_MERGE_ROWS_LIMITED and AUTO_CELL_MERGE_COLUMNS_LIMITED

JIDE 3.5.15