ntftablemodel.java

来自「UCS (Ultra Corba Simulator) is one more 」· Java 代码 · 共 64 行

JAVA
64
字号
package com.corba.mnq.ntf;
/*
 *        Notification Service Manager
 *
 *   		Copyright (C) 2005-2006 .
 *			This is free software.
 */
import java.util.*;

public class NtfTableModel extends javax.swing.table.DefaultTableModel 
{
    /**
     * NSTableModel constructor.
     */
    public NtfTableModel() 
    {
		super();
		String [] colNames = {"Name", "Type", "Value"};
		super.setColumnIdentifiers(convertToVector(colNames));
    }

    /**
     * getColumnCount method comment.
     */
    public int getColumnCount() 
    {
    	return 3;
    }

    /**
     * always returns false to make this table non-editable
     * @return boolean
     * @param r int
     * @param c int
     */
    public boolean isCellEditable(int r, int c) 
    {
    	return false;
    }

    /**
     * 
     * @param data Vector
     */
    public void setDataVector(Vector newData) 
    {
        if (newData == null)
            throw new IllegalArgumentException("setDataVector() - Null parameter");
                
        // Add the new rows.
        dataVector = newData;
        
        // Make all the new rows the right length and generate a notification.
        newRowsAdded(new javax.swing.event.TableModelEvent(this, 0, getRowCount()-1,
                                                           javax.swing.event.TableModelEvent.ALL_COLUMNS, 
                                                           javax.swing.event.TableModelEvent.INSERT));
        //this.removeRow(getRowCount()-1);
    }
}




⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?