KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > dso > ClientsTable


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

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