JIDE 3.5.15

com.jidesoft.grid
Interface SpanModel

All Known Subinterfaces:
SpanTableModel
All Known Implementing Classes:
AbstractPropertyTableModel, AbstractSpanTableModel, AggregateTableModel, BatchedCrudTableModelWrapper, CachedTableModel, CalculatedHeaderTableModel, CalculatedTableModel, CornerTableModel, CrudTableModelAdapter, DefaultColumnTableModelWrapper, DefaultGroupTableModel, DefaultSpanTableModel, DefaultTableModelWrapper, FilterableAggregateTableModel, FilterableTableModel, FilterableTreeTableModel, HeaderTableModel, JoinTableModel, LuceneFilterableTableModel, PropertyTableModel, SortableAggregateTableModel, SortableTableModel, SortableTreeTableModel, TableModelWrapperImpl, TransposeTableModel

public interface SpanModel

The SpanModel interface specifies the methods the JTable will use to implement cell span.


Method Summary
 CellSpan getCellSpanAt(int rowIndex, int columnIndex)
          Gets the cell span at the specified row and column.
 boolean isCellSpanOn()
          Checks if the span is on.
 

Method Detail

getCellSpanAt

CellSpan getCellSpanAt(int rowIndex,
                       int columnIndex)
Gets the cell span at the specified row and column. To avoid creating many instances of CellSpan, you can return the same instance by changing its values only. For example, the code below is a good example.

 private final CellSpan span = new CellSpan(0,0,1,1);
 public CellSpan getCellSpanAt(int row, int col) {
     span.setRow(...);
     span.setColumn(...);
     span.setRowSpan(...);
     span.setColumnSpan(...);
     return span;
 }
 
For performance consideration, if the cell span has 1 row span and 1 column span, it is better to return null instead of new CellSpan(row, column, 1, 1).

Parameters:
rowIndex - the row index.
columnIndex - the column index.
Returns:
CellSpan object.

isCellSpanOn

boolean isCellSpanOn()
Checks if the span is on. The CellSpanTable will ignore all the CellSpans defined in this model if this method returns false.

Since 3.5.12, please fire table data changed event if the returned value of this method is changed. Otherwise the CellSpanTable might still use the cached value to improve performance.

Returns:
true if span is on. Otherwise false.

JIDE 3.5.15