package com.vci.client.workflow.commom;
|
|
import javax.swing.JTable;
|
|
import com.vci.client.ui.table.VCIBaseTableModel;
|
import com.vci.client.ui.table.VCIBaseTableNode;
|
|
/**
|
* <p>Title:RightDistributionTableModel</p>
|
* <p>Description:数据操作授权共同类,用于excel创建</p>
|
* <p>Copyright: Copyright (C) 2011 </p>
|
* <p>Company: VCI </p>
|
*
|
* @author wangxl
|
* @time 2011-6-21
|
* @version 1.0
|
*/
|
public class RightDistributionTableModel extends VCIBaseTableModel {
|
|
private static final long serialVersionUID = 1L;
|
private String[] columns= null;
|
private Class[] classes = null;
|
|
public RightDistributionTableModel(String[] columns , Class[] classes) {
|
super(columns, classes);
|
this.columns = columns;
|
this.classes = classes;
|
}
|
|
public boolean isCellEditable(int row, int col) {
|
// if(col != 0) return true;
|
// else return false;
|
return true;
|
}
|
|
public void setValueAt(Object value, int rowIndex, int colIndex) {
|
VCIBaseTableNode node = list.get(rowIndex);
|
if(!node.equals(null)&&value!=null){
|
node.setPropertyValueByName(columns[colIndex], value);
|
}
|
}
|
|
public String[] getColumns() {
|
return columns;
|
}
|
|
public void saveTableEditData(JTable table) {
|
if (table.isEditing()) {
|
table.getCellEditor(table.getEditingRow(), table.getEditingColumn()).stopCellEditing();
|
}
|
}
|
}
|