KickJava   Java API By Example, From Geeks To Geeks.

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


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.Component;
7
8 public class ComponentNode extends XTreeNode {
9   private String JavaDoc m_label;
10   private Component m_component;
11
12   public ComponentNode() {
13     super();
14   }
15
16   public ComponentNode(String JavaDoc label) {
17     this(label, null);
18   }
19
20   public ComponentNode(String JavaDoc label, Component component) {
21     this();
22       
23     setLabel(label);
24     setComponent(component);
25   }
26
27   public void setLabel(String JavaDoc label) {
28     setUserObject(m_label = label);
29   }
30
31   public String JavaDoc getLabel() {
32     return m_label;
33   }
34
35   public void setComponent(Component comp) {
36     m_component = comp;
37   }
38     
39   public Component getComponent() {
40     return m_component;
41   }
42
43   public void tearDown() {
44     super.tearDown();
45
46     setLabel(null);
47     
48     if(m_component instanceof XContainer) {
49       ((XContainer)m_component).tearDown();
50     }
51     setComponent(null);
52   }
53 }
54   
55
Popular Tags