|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.pivot.TableModelPivotDataSource
public class TableModelPivotDataSource
Field Summary | |
---|---|
protected IFilterableTableModel |
_filterTableModel
|
protected TableModel |
_originalTableModel
|
protected IFilterableTableModel |
_tableModel
|
Constructor Summary | |
---|---|
TableModelPivotDataSource(TableModel originalTableModel)
|
Method Summary | |
---|---|
void |
addTableModelListener(TableModelListener listener)
Adds the table model listener. |
void |
applyFilters()
Tells the data source to apply the filters after all filters have been set using PivotDataSource.setFilter(Object[],int,boolean) method. |
void |
applyFilters(int[] rowFieldIndices,
int[] columnFieldIndices,
int[] dataFieldIndices,
int[] filterFieldIndices)
Tells the data source to apply the filters after all filters have been set using PivotDataSource.setFilter(Object[],int,boolean) method. |
void |
clearFilters()
Tells the data source to clear all existing filters so that we can start to use PivotDataSource.setFilter(Object[],int,boolean) method to set the filters. |
protected IFilterableTableModel |
createFilterableTableModel(TableModel model)
Create inner filterable table model to support filtering feature in PivotTablePane. |
int |
getActualRowIndex(int visualRowIndex)
Gets the actual row index in the original table model. |
int |
getFieldCount()
Gets number of fields in this data source. |
String |
getFieldName(int fieldIndex)
Gets the field name. |
String |
getFieldTitle(int fieldIndex)
Gets the field title. |
Class<?> |
getFieldType(int fieldIndex)
Gets the field type. |
int |
getFilteredRowIndex(int actualRowIndex)
Gets the row index after filtering so that we can use PivotDataSource.getValueAt(int,int) or PivotDataSource.setValueAt(Object,int,int) methods. |
Set<Object> |
getPossibleValues(int fieldIndex,
boolean filterField,
boolean isNullAllowed)
Gets the possible values. |
int |
getRowCount()
Gets the row count. |
TableModel |
getTableModel()
|
Object |
getValueAt(int rowIndex,
int fieldIndex)
Gets the value at the specified field index and the row index. |
boolean |
hasFilter()
Get if the data source has filter applying on it. |
void |
removeTableModelListener(TableModelListener listener)
Removes the table model listener that was added earlier. |
void |
setExcludeFilter(Object[] values,
int fieldIndex,
boolean filterField)
Sets the deselected possible values for the field. |
void |
setFilter(Filter filter,
int fieldIndex,
boolean filterField)
Sets the Filter for the field. |
void |
setFilter(Object[] values,
int fieldIndex,
boolean filterField)
Sets the possible values for the field. |
void |
setTableModel(TableModel tableModel)
|
void |
setValueAt(Object value,
int rowIndex,
int fieldIndex)
Gets the value at the specified field index and the row index. |
protected void |
updatePossibleValues(Set<Object> values,
int fieldIndex,
int row,
int viewRow,
boolean filterField,
boolean isNullAllowed)
Updates the possible value from the specified row index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TableModel _originalTableModel
protected IFilterableTableModel _filterTableModel
protected IFilterableTableModel _tableModel
Constructor Detail |
---|
public TableModelPivotDataSource(TableModel originalTableModel)
Method Detail |
---|
public void setTableModel(TableModel tableModel)
protected IFilterableTableModel createFilterableTableModel(TableModel model)
setTableModel
is invoked. The first time is to create a
FilterableTableModel for filter fields, the second time is to create a FilterablTableModel for row/column/data
fields.
The default implementation is just new FilterableTableModel(model)
.
model
- the original table model
public TableModel getTableModel()
public int getFieldCount()
PivotDataSource
getFieldCount
in interface PivotDataSource
public String getFieldName(int fieldIndex)
PivotDataSource
getFieldName
in interface PivotDataSource
fieldIndex
- the field index.
public String getFieldTitle(int fieldIndex)
PivotDataSource
getFieldTitle
in interface PivotDataSource
fieldIndex
- the field index.
public Class<?> getFieldType(int fieldIndex)
PivotDataSource
getFieldType
in interface PivotDataSource
fieldIndex
- the field index.
public int getRowCount()
PivotDataSource
getRowCount
in interface PivotDataSource
public Object getValueAt(int rowIndex, int fieldIndex)
PivotDataSource
getValueAt
in interface PivotDataSource
rowIndex
- the row index. It is the index after filtering.fieldIndex
- the field index.
public void setValueAt(Object value, int rowIndex, int fieldIndex)
PivotDataSource
setValueAt
in interface PivotDataSource
value
- the new value.rowIndex
- the row index. It is the index after filtering.fieldIndex
- the field index.protected void updatePossibleValues(Set<Object> values, int fieldIndex, int row, int viewRow, boolean filterField, boolean isNullAllowed)
values
- the set of possible values.fieldIndex
- the field indexrow
- the row index as in the original table modelviewRow
- the row index as in the filterable table model.filterField
- true if the field is a filter field. Otherwise false.isNullAllowed
- true if we will add null to the possible values set. Otherwise do not add.public Set<Object> getPossibleValues(int fieldIndex, boolean filterField, boolean isNullAllowed)
getPossibleValues
in interface PivotDataSource
fieldIndex
- the field indexfilterField
- If the field is a filter field. The difference is that a filter field will include values even
though they are filtered by other filter fields, and a non-filter field will not.* @returnisNullAllowed
- whether null value is allowed.
public boolean hasFilter()
PivotDataSource
hasFilter
in interface PivotDataSource
public void clearFilters()
PivotDataSource
PivotDataSource.setFilter(Object[],int,boolean)
method to set the filters.
clearFilters
in interface PivotDataSource
public void applyFilters()
PivotDataSource
PivotDataSource.setFilter(Object[],int,boolean)
method. If you need to know the field indices of each area, you can override
other applyFilters method with four int[] parameters.
applyFilters
in interface PivotDataSource
public void applyFilters(int[] rowFieldIndices, int[] columnFieldIndices, int[] dataFieldIndices, int[] filterFieldIndices)
PivotDataSource
PivotDataSource.setFilter(Object[],int,boolean)
method. This method tells you the field indices of each area. In
TableModelPivotDataSource implementation, we simply call PivotDataSource.applyFilters()
as that implementation doesn't
need to know the field indices.
applyFilters
in interface PivotDataSource
rowFieldIndices
- the field indices for row fields.columnFieldIndices
- the field indices for column fields.dataFieldIndices
- the field indices for data fields.filterFieldIndices
- the field indices for filter fields.public void setFilter(Object[] values, int fieldIndex, boolean filterField)
PivotDataSource
setFilter
in interface PivotDataSource
values
- the possible values.fieldIndex
- the field index.filterField
- whether the field is a filter field.public void setExcludeFilter(Object[] values, int fieldIndex, boolean filterField)
PivotDataSource
setExcludeFilter
in interface PivotDataSource
values
- the deselected possible values.fieldIndex
- the field index.filterField
- whether the field is a filter field.public void setFilter(Filter filter, int fieldIndex, boolean filterField)
PivotDataSource
setFilter
in interface PivotDataSource
filter
- the Filter.fieldIndex
- the field index.filterField
- whether the field is a filter field.public int getFilteredRowIndex(int actualRowIndex)
PivotDataSource
PivotDataSource.getValueAt(int,int)
or PivotDataSource.setValueAt(Object,int,int)
methods.
getFilteredRowIndex
in interface PivotDataSource
actualRowIndex
- the actual row index.
public int getActualRowIndex(int visualRowIndex)
PivotDataSource
PivotDataModel.getDataAt(int, int)
method.
getActualRowIndex
in interface PivotDataSource
visualRowIndex
- the visual row index.
public void addTableModelListener(TableModelListener listener)
PivotDataSource
addTableModelListener
in interface PivotDataSource
listener
- the table model listener to be added.public void removeTableModelListener(TableModelListener listener)
PivotDataSource
removeTableModelListener
in interface PivotDataSource
listener
- the table model listener to be removed.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |