1 20 21 package org.jacorb.naming.namemanager; 22 23 import java.util.*; 24 25 public class NSTableModel 26 extends javax.swing.table.DefaultTableModel 27 { 28 31 public NSTableModel() 32 { 33 super(); 34 String [] colNames = {"Name", "Kind", "Type", "Host"}; 35 super.setColumnIdentifiers(convertToVector(colNames)); 36 } 37 38 41 public int getColumnCount() 42 { 43 return 4; 44 } 45 46 52 public boolean isCellEditable(int r, int c) 53 { 54 return false; 55 } 56 57 61 public void setDataVector(Vector newData) 62 { 63 if (newData == null) 64 throw new IllegalArgumentException ("setDataVector() - Null parameter"); 65 66 dataVector = newData; 68 69 newRowsAdded(new javax.swing.event.TableModelEvent (this, 0, getRowCount()-1, 71 javax.swing.event.TableModelEvent.ALL_COLUMNS, 72 javax.swing.event.TableModelEvent.INSERT)); 73 } 74 } 75 76 77 78 79 | Popular Tags |