📄 datagridmodel.java
字号:
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Created on 2005/1/12
*
* $Author$
* $Date$
* $Revision$
*
*/
package eti.bi.alphaminer.operation.result.datamodel;
import javax.swing.table.DefaultTableModel;
/**
* @author achiu
*
*/
public class DataGridModel extends DefaultTableModel {
/**
*
*/
private static final long serialVersionUID = 4505207177421102755L;
Class[] types;
boolean[] canEdit;
Object[][] m_TableContent;
/**
* Constructs a TableMode.
* @param a_TableContent an Object array storing table content.
* @param a_TableHeader an Object array storing header names.
*/
public DataGridModel(Object[][] a_TableContent, Object[] a_TableHeader, Class[] a_Types) {
super(a_TableContent, a_TableHeader);
types = a_Types;
canEdit = new boolean[a_TableHeader.length];
for (int i=0; i<a_TableHeader.length; i++)
{
canEdit[i] = false;
}
m_TableContent = a_TableContent;
}
/**
* @see javax.swing.table.TableModel#getColumnClass(int)
*/
@SuppressWarnings("unchecked")
public Class getColumnClass(int columnIndex) {
return types[columnIndex];
//return Object.class;
}
/**
* @see javax.swing.table.TableModel#isCellEditable(int, int)
*/
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit[columnIndex];
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -