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.AbstractTableCellRenderer;
07: import org.dijon.Container;
08: import org.dijon.Label;
09:
10: import com.tc.admin.AdminClient;
11: import com.tc.admin.AdminClientContext;
12:
13: import javax.swing.JComponent;
14: import javax.swing.border.LineBorder;
15:
16: /**
17: * TODO: Extract a StatusView from this so it can be used elsewhere,
18: * such as the ServerPanel, to indicate the server status.
19: */
20:
21: public abstract class StatusRenderer extends AbstractTableCellRenderer {
22: protected Container m_statusRenderer;
23: protected Label m_label;
24: protected Label m_indicator;
25:
26: public StatusRenderer() {
27: super ();
28:
29: AdminClientContext cntx = AdminClient.getContext();
30:
31: m_statusRenderer = (Container) cntx.topRes
32: .resolve("StatusRenderer");
33: m_label = (Label) m_statusRenderer.findComponent("StatusLabel");
34: m_indicator = (Label) m_statusRenderer
35: .findComponent("StatusIndicator");
36:
37: m_label.setForeground(null);
38: m_indicator.setOpaque(true);
39: m_indicator.setBorder(LineBorder.createBlackLineBorder());
40: }
41:
42: public JComponent getComponent() {
43: return m_statusRenderer;
44: }
45: }
|