001: /*
002: * The contents of this file are subject to the Mozilla Public License
003: * Version 1.1 (the "License"); you may not use this file except in
004: * compliance with the License. You may obtain a copy of the License at
005: * http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
009: * License for the specific language governing rights and limitations
010: * under the License.
011: *
012: * The Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
013: *
014: * The Initial Developer of the Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
015: * Portions created by Mark A. Kobold are Copyright (C) 2000-2007. All Rights Reserved.
016: *
017: * Contributor(s):
018: * Mark A. Kobold [mkobold <at> isqlviewer <dot> com].
019: *
020: * If you didn't download this code from the following link, you should check
021: * if you aren't using an obsolete version: http://www.isqlviewer.com
022: */
023: package org.isqlviewer.model;
024:
025: /**
026: * Types of nodes that can be found within the JDBC Schema Tree.
027: * <p>
028: * Actually expirementing a new code style/pattern with enumerations where the type of node can actually define a
029: * 'preferredIcon' so that the renderer is not required to be coded with icon information for rendering each node.
030: *
031: * @author Mark A. Kobold <mkobold at isqlviewer dot com>
032: * @version 1.0
033: */
034: public enum SchemaNodeType {
035:
036: /**
037: * Root node of the JDBC Schema tree this type here for completness and has no real value.
038: */
039: ROOT,
040: /**
041: * Non cached nodes are nodes that are likely to cause a lot of JDBC traffic nodes of these types serve to mark the
042: * parent node to load the information at the user's request.
043: */
044: NON_CACHED("information"),
045: /**
046: * Table Type node that is usually of the form INDEX, TABLE, VIEW, SYNONYM, and etc.
047: */
048: TABLE_TYPE("table_set"),
049: /**
050: * Table node that is a a child of TABLE_TYPE, and represents a database table or view usually.
051: */
052: TABLE("table"),
053: /**
054: * Index information for a given table, this node is usually a child of a TABLE node.
055: */
056: INDEX("table_info"),
057: /**
058: * Node that shows that the current table has primary keys defined.
059: */
060: PRIMARY_KEYS("table_keys"),
061: /**
062: * Node that shows that other tables that rely on the primary keys defined within the table.
063: */
064: EXPORTED_KEYS("table_keys"),
065: /**
066: * Node that shows foriegn keys from other tables that part of the table's definition.
067: */
068: IMPORTED_KEYS("table_keys"),
069: /**
070: * If tables is defined in a hierarchial fashion then this node shows the parent tables for the current one.
071: */
072: SUPER_TABLES("table_info"),
073: /**
074: * Node to indicate that this table defines columns that are automatically updated when any row is updated.
075: */
076: VERSION_COLUMNS("table_info"),
077: /**
078: * Node for indicating that the table has defined security constraints on the table.
079: */
080: TABLE_PRIVILIGES("table_info"),
081: /**
082: * Node that indicates that the current table has column specific priviliges defined.
083: */
084: COLUMN_PRIVILIGES("table_info"),
085: /**
086: * This node type is a place holder for representing the parent column node for the actual column type.
087: * <p>
088: * The children for this node are loaded on demand by the user.
089: */
090: COLUMN_SET("table_columns"),
091: /**
092: * Node that represents a column in a table, the parent node type is acutually a COLUMN_SET.
093: */
094: COLUMN("table_info"),
095: /**
096: * This node type is a place holder as the parent node for stored procedure for the actual procedure type.
097: */
098: PROCEDURE_SET("procedure_set"),
099: /**
100: * Node that represents a stored procedure definied in the current catalog and or schema.
101: * <p>
102: * The children for this node are loaded on demand by the user.
103: */
104: PROCEDURE("procedure"),
105: /**
106: * This node type is a place holder as the parent node for data types that are allowed by the current database.
107: * <p>
108: * The childeren for this node are loaded on demand by the user.
109: */
110: DATA_TYPE_SET("data_type_set"),
111: /**
112: * Node the represents a data type defined by the current database.
113: */
114: DATA_TYPE("data_type"),
115: /**
116: * This node type is a place holder as the parent node for user data types that are defined in the current
117: * catalog/schema.
118: * <p>
119: */
120: UDT_SET("folder"),
121: /**
122: * This node type is a place holder as the parent node for user data types are DISTINCT types.
123: * <p>
124: */
125: UDT_SET_DISTINCT("folder"),
126: /**
127: * This node type is a place holder as the parent node for user data types are JAVA_OBJECT types.
128: * <p>
129: */
130: UDT_SET_JAVA_OBJECT("folder"),
131: /**
132: * This node type is a place holder as the parent node for user data types are STRUCT types.
133: * <p>
134: */
135: UDT_SET_STRUCT("folder"),
136: /**
137: * A node that represents a user data type that is supported by the current schema/catalog.
138: */
139: UDT("data_type");
140:
141: private String preferredIcon = null;
142:
143: SchemaNodeType() {
144:
145: this (null);
146: }
147:
148: SchemaNodeType(String preferredIcon) {
149:
150: this .preferredIcon = preferredIcon;
151: }
152:
153: public String getPreferredIcon() {
154:
155: return preferredIcon;
156: }
157: }
|