KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > common > StatusView


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.common;
5
6 import org.dijon.ContainerResource;
7 import org.dijon.Label;
8
9 import com.tc.admin.AdminClient;
10 import com.tc.admin.AdminClientContext;
11
12 import java.awt.Color JavaDoc;
13
14 import javax.swing.border.LineBorder JavaDoc;
15
16 public class StatusView extends XContainer {
17   protected Label m_label;
18   protected Label m_indicator;
19     
20   public StatusView() {
21     super();
22       
23     AdminClientContext cntx = AdminClient.getContext();
24     load((ContainerResource)cntx.topRes.getComponent("StatusRenderer"));
25   }
26   
27   public void load(ContainerResource containerRes) {
28     super.load(containerRes);
29     
30     m_label = (Label)findComponent("StatusLabel");
31     m_indicator = (Label)findComponent("StatusIndicator");
32
33     m_indicator.setOpaque(true);
34     m_indicator.setBorder(LineBorder.createBlackLineBorder());
35   }
36   
37   public void setLabel(String JavaDoc label) {
38     m_label.setText(label);
39   }
40   
41   public void setIndicator(Color JavaDoc color) {
42     m_indicator.setBackground(color);
43   }
44   
45   public void tearDown() {
46     super.tearDown();
47     
48     m_label = null;
49     m_indicator = null;
50   }
51 }
52
Popular Tags