package com.vci.client.framework.systemConfig.stafforgmanage; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.vci.client.ui.table.VCIBaseTableModel; /** *

Title: VCIBaseTableExtend

*

Description: table页model

*

Copyright: Copyright (c) 2012

*

Company: VCI

* @author wangxl * @time 2012-5-9 * @version 1.0 */ public class VCIBaseTableExtend extends VCIBaseTableModel { /** * */ private static final long serialVersionUID = 1L; protected Map secTypes = new HashMap(); protected List editableColumns = new ArrayList(); public VCIBaseTableExtend(String[] columns, Class[] classes){ super(columns, classes); } public boolean isCellEditable(int rowIndex, int columnIndex){ boolean edit = false; Object obj = getValueAt(rowIndex, columnIndex); String text = obj == null ? "" : obj.toString(); if(columnIndex == 0 && (text.equals("true") || text.equals("false"))) { edit = true; } String col = String.valueOf(columnIndex); if(editableColumns.contains(col)){ edit = true; } return edit; } /** * 添加可编辑的列索引 * @param columns */ public void setEditableColumn(int... columns){ for(int col : columns){ editableColumns.add(String.valueOf(col)); } } }