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.common;
05:
06: import org.dijon.ContainerResource;
07: import org.dijon.Label;
08:
09: import com.tc.admin.AdminClient;
10: import com.tc.admin.AdminClientContext;
11:
12: import java.awt.Color;
13:
14: import javax.swing.border.LineBorder;
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
25: .getComponent("StatusRenderer"));
26: }
27:
28: public void load(ContainerResource containerRes) {
29: super .load(containerRes);
30:
31: m_label = (Label) findComponent("StatusLabel");
32: m_indicator = (Label) findComponent("StatusIndicator");
33:
34: m_indicator.setOpaque(true);
35: m_indicator.setBorder(LineBorder.createBlackLineBorder());
36: }
37:
38: public void setLabel(String label) {
39: m_label.setText(label);
40: }
41:
42: public void setIndicator(Color color) {
43: m_indicator.setBackground(color);
44: }
45:
46: public void tearDown() {
47: super.tearDown();
48:
49: m_label = null;
50: m_indicator = null;
51: }
52: }
|