01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.dso;
05:
06: import com.tc.admin.common.XObjectTable;
07:
08: public class ClientsTable extends XObjectTable {
09: 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: }
|