KickJava   Java API By Example, From Geeks To Geeks.

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


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.AbstractTableCellRenderer;
7 import org.dijon.Container;
8 import org.dijon.Label;
9
10 import com.tc.admin.AdminClient;
11 import com.tc.admin.AdminClientContext;
12
13 import javax.swing.JComponent JavaDoc;
14 import javax.swing.border.LineBorder JavaDoc;
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.resolve("StatusRenderer");
32     m_label = (Label)m_statusRenderer.findComponent("StatusLabel");
33     m_indicator = (Label)m_statusRenderer.findComponent("StatusIndicator");
34
35     m_label.setForeground(null);
36     m_indicator.setOpaque(true);
37     m_indicator.setBorder(LineBorder.createBlackLineBorder());
38   }
39     
40   public JComponent JavaDoc getComponent() {
41     return m_statusRenderer;
42   }
43 }
44
Popular Tags