01: package org.dbbrowser.ui.panel.dbbrowserwindow;
02:
03: /**
04: * An instance of this type represents a node of a JTree
05: * @author amangat
06: *
07: */
08: public class TreeNode {
09: public static String ROOT_VIEW_TYPE = "ROOT_VIEW_TYPE";
10: public static String SCHEMAS_TYPE = "SCHEMAS_TYPE";
11: public static String SCHEMA_TYPE = "SCHEMA_TYPE";
12: public static String TABLE_TYPE = "TABLE_TYPE";
13:
14: public static String VIEWS_TYPE = "VIEWS_TYPE";
15: public static String VIEW_TYPE = "VIEW_TYPE";
16:
17: private String name = null;
18: private String type = null;
19: private Object userObject = null;
20:
21: /**
22: * Constrcuter
23: * @param name
24: * @param type
25: */
26: public TreeNode(String name, String type) {
27: this .name = name;
28: this .type = type;
29: }
30:
31: /**
32: * Constrcuter
33: * @param name
34: * @param type
35: * @param userObject
36: */
37: public TreeNode(String name, String type, Object userObject) {
38: this .name = name;
39: this .type = type;
40: this .userObject = userObject;
41: }
42:
43: /**
44: * Returns the name
45: * @return
46: */
47: public String getName() {
48: return this .name;
49: }
50:
51: /**
52: * Returns the type
53: * @return
54: */
55: public String getType() {
56: return this .type;
57: }
58:
59: /**
60: * Returns the user object
61: * @return
62: */
63: public Object getUserObject() {
64: return this .userObject;
65: }
66:
67: /**
68: * toString - used by JTree for displaying
69: * @return
70: */
71: public String toString() {
72: return this.name;
73: }
74: }
|