1 4 package com.tc.admin.dso; 5 6 import com.tc.admin.common.XObjectTable; 7 8 public class ClientsTable extends XObjectTable { 9 private ClientTableModel m_model; 10 11 public ClientsTable() { 12 super(); 13 setModel(m_model = new ClientTableModel()); 14 } 15 16 public ClientsTable(DSOClient[] clients) { 17 this(); 18 setClients(clients); 19 } 20 21 public void setClients(DSOClient[] clients) { 22 m_model.set(clients); 23 } 24 25 public void addClient(DSOClient client) { 26 m_model.add(client); 27 28 int row = m_model.getRowCount()-1; 29 m_model.fireTableRowsInserted(row, row); 30 } 31 32 public void removeClient(DSOClient client) { 33 int row = m_model.getObjectIndex(client); 34 35 if(row != -1) { 36 m_model.remove(client); 37 m_model.fireTableRowsDeleted(row, row); 38 } 39 } 40 } 41 | Popular Tags |