package com.vci.client.ui.swing.components.table;
|
|
/**
|
*
|
* <p>Title: </p>
|
* <p>Description: </p>
|
* <p>Copyright: Copyright (c) 2012</p>
|
* <p>Company: VCI</p>
|
* @author xchao
|
* @time 2012-5-10
|
* @version 1.0
|
*/
|
public abstract class AbstractVCIJTableDataProvider<T> implements VCIJTableDataProvider<T> {
|
protected String[] columns = null;
|
protected Class<?>[] classes = null;
|
protected int total = 0;
|
protected String fixedColumn = "ChcekBox,序号";
|
protected int dataColumnStartIndex = fixedColumn.split(",").length;
|
|
public String[] getColumns() {
|
if(this.columns != null) return this.columns;
|
String[] fixColumns = fixedColumn.split(",");
|
String[] specColumns = getSpecialColumns();
|
int len = fixColumns.length + specColumns.length;
|
this.columns = new String[len];
|
for(int i = 0; i < len; i++){
|
if(i < fixColumns.length){
|
this.columns[i] = fixColumns[i];
|
} else{
|
this.columns[i] = specColumns[i - fixColumns.length];
|
}
|
}
|
return this.columns;
|
}
|
|
public Class<?>[] getClasses() {
|
this.classes = new Class<?>[this.getColumns().length];
|
classes[0] = Boolean.class;
|
for (int i = 1; i < classes.length; i++) {
|
classes[i] = this.getColumns()[i].getClass();
|
}
|
return this.classes;
|
}
|
|
public int getDataColumnStartIndex() {
|
return dataColumnStartIndex;
|
}
|
|
}
|