KickJava   Java API By Example, From Geeks To Geeks.

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


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.AdminClient;
7 import com.tc.admin.common.XObjectTable;
8 import com.tc.admin.common.XObjectTableModel;
9
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 JavaDoc[] FIELDS = {
28     "ClassName",
29     "InstanceCount"
30   };
31
32   private static final String JavaDoc[] HEADERS =
33     AdminClient.getContext().getMessages(
34       new String JavaDoc[] {
35         "dso.classes.className",
36         "dso.classes.instanceCount"
37       });
38   
39   public ClassTableModel() {
40     super(DSOClassInfo.class, FIELDS, HEADERS);
41   }
42
43   public void setClassInfo(DSOClassInfo classInfo[]) {
44     set(classInfo);
45   }
46 }
47
Popular Tags