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.AdminClient;
07: import com.tc.admin.common.XObjectTable;
08: import com.tc.admin.common.XObjectTableModel;
09:
10: import com.tc.stats.DSOClassInfo;
11:
12: public class ClassesTable extends XObjectTable {
13: public ClassesTable() {
14: super (new ClassTableModel());
15:
16: setSortColumn(1 /*instanceCount*/);
17: setSortDirection(UP);
18: }
19:
20: public void setClassInfo(DSOClassInfo classInfo[]) {
21: ((ClassTableModel) getModel()).setClassInfo(classInfo);
22: sort();
23: }
24: }
25:
26: class ClassTableModel extends XObjectTableModel {
27: private static final String[] FIELDS = { "ClassName",
28: "InstanceCount" };
29:
30: private static final String[] HEADERS = AdminClient.getContext()
31: .getMessages(
32: new String[] { "dso.classes.className",
33: "dso.classes.instanceCount" });
34:
35: public ClassTableModel() {
36: super (DSOClassInfo.class, FIELDS, HEADERS);
37: }
38:
39: public void setClassInfo(DSOClassInfo classInfo[]) {
40: set(classInfo);
41: }
42: }
|