KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > console > wizard > WizardConstants


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s): ______________________.
23  */

24
25 package org.objectweb.cjdbc.console.wizard;
26
27 import java.util.ArrayList JavaDoc;
28
29 import javax.swing.JComboBox JavaDoc;
30
31 /**
32  * The constants used throughout the <code>XmlWizard</code>
33  *
34  * @author <a HREF="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
35  * @version 1.0
36  */

37 public final class WizardConstants
38 {
39   /** Frame width */
40   public static final int FRAME_WIDTH = 750;
41   /** Frame height */
42   public static final int FRAME_HEIGHT = 500;
43   /** Validator height */
44   public static final int VALIDATOR_HEIGHT = 300;
45   /** Validator width */
46   public static final int VALIDATOR_WIDTH = 400;
47   /** Backend Frame width */
48   public static final int BACKEND_FRAME_WIDTH = 300;
49   /** Backend Frame height */
50   public static final int BACKEND_FRAME_HEIGHT = 250;
51   /** Connection Frame width */
52   public static final int CONNECTION_FRAME_WIDTH = 400;
53   /** Connection Frame height */
54   public static final int CONNECTION_FRAME_HEIGHT = 200;
55
56   /** Quit command */
57   public static final String JavaDoc COMMAND_QUIT = "command.quit";
58   /** Add user command */
59   public static final String JavaDoc COMMAND_ADD_USER = "command.add.user";
60   /** Remove user command */
61   public static final String JavaDoc COMMAND_REMOVE_USER = "command.remove.user";
62   /** Add backend command */
63   public static final String JavaDoc COMMAND_ADD_BACKEND = "command.add.backend";
64   /** Remove backend command */
65   public static final String JavaDoc COMMAND_REMOVE_BACKEND = "command.remove.backend";
66   /** Export XML command */
67   public static final String JavaDoc COMMAND_EXPORT_XML = "command.export.xml";
68   /** Import XML command */
69   public static final String JavaDoc COMMAND_IMPORT_XML = "command.import.xml";
70   /** Edit connection parameteres command */
71   public static final String JavaDoc COMMAND_EDIT_CONNECTION_PARAM = "command.edit.connection.parameters";
72   /** Check wizard command */
73   public static final String JavaDoc COMMAND_CHECK_WIZARD = "command.check.wizard";
74   /** Validate XML command */
75   public static final String JavaDoc COMMAND_VALIDATE_XML = "command.validate.xml";
76
77   /** Blob filters */
78   public static final String JavaDoc[] BLOB = {"none", "hexa",
79       "escaped" };
80   /** Macro clock option */
81   public static final String JavaDoc[] MACRO_CLOCK = {"none", "local"};
82   /** Schema gathering precision */
83   public static final String JavaDoc[] DYNAMIC_PRECISION = {"static",
84       "table", "column", "procedures", "all" };
85   /** Result cache granularity */
86   public static final String JavaDoc[] RESULT_CACHE_GRANULARITY = {"database",
87       "table", "column", "columnUnique" };
88   /** Connection managers */
89   public static final String JavaDoc[] CONNECTION_MANAGERS = {
90       "SimpleConnectionManager", "FailFastPoolConnectionManager",
91       "RandomWaitPoolConnectionManager", "VariablePoolConnectionManager"};
92   /** Load balancer wait policies */
93   public static final String JavaDoc[] WAIT_POLICIES = {"first",
94       "majority", "all" };
95   /** Schedulers */
96   public static final String JavaDoc[] SCHEDULERS_STANDARD = {
97       "SingleDBScheduler", "RAIDb-0Scheduler", "RAIDb-1Scheduler",
98       "RAIDb-2Scheduler" };
99   /** Distributed Schedulers */
100   public static final String JavaDoc[] SCHEDULERS_DISTRIBUTED = {
101       "RAIDb-1Scheduler", "RAIDb-2Scheduler" };
102   /** Single DB schedulers */
103   public static final String JavaDoc[] SCHEDULER_SINGLEDB_LEVELS = {"query",
104       "optimisticTransaction", "pessimisticTransaction" };
105   /** RAIDb-0 schedulers */
106   public static final String JavaDoc[] SCHEDULER_RAIDB0_LEVELS = {"query",
107       "pessimisticTransaction" };
108   /** RAIDb-1 schedulers */
109   public static final String JavaDoc[] SCHEDULER_RAIDB1_LEVELS = {"query",
110       "optimisticQuery", "optimisticTransaction", "pessimisticTransaction"};
111   /** RAIDb-2 schedulers */
112   public static final String JavaDoc[] SCHEDULER_RAIDB2_LEVELS = {"query",
113       "pessimisticTransaction" };
114
115   /** Single DB load balancers */
116   public static final String JavaDoc[] LOAD_BALANCER_SINGLEDB = new String JavaDoc[]{"SingleDB"};
117   /** RAIDb-0 load balancers */
118   public static final String JavaDoc[] LOAD_BALANCER_RAIDB0 = new String JavaDoc[]{"RAIDb-0"};
119   /** RAIDb-1 load balancers */
120   public static final String JavaDoc[] LOAD_BALANCER_RAIDB1 = new String JavaDoc[]{
121       "RAIDb-1-RoundRobin", "RAIDb-1-LeastPendingRequestsFirst",
122       "ParallelDB-RoundRobin", "ParallelDB-LeastPendingRequestsFirst"};
123   /** RAIDb-2 load balancers */
124   public static final String JavaDoc[] LOAD_BALANCER_RAIDB2 = new String JavaDoc[]{
125       "RAIDb-2-RoundRobin", "RAIDb-2-LeastPendingRequestsFirst",
126       "ParallelDB-RoundRobin", "ParallelDB-LeastPendingRequestsFirst"};
127
128   /** Default schema gathering precision */
129   public static final String JavaDoc DEFAULT_DYNAMIC_PRECISION = DYNAMIC_PRECISION[4];
130
131   /** Virtual database tab */
132   public static final String JavaDoc TAB_VIRTUAL_DATABASE = "tab.virtualdatabase";
133   /** Distribution tab */
134   public static final String JavaDoc TAB_DISTRIBUTION = "tab.distribution";
135
136   /** Authentication tab */
137   public static final String JavaDoc TAB_AUTHENTICATION = "tab.authentication";
138   /** Backends tab */
139   public static final String JavaDoc TAB_BACKENDS = "tab.backends";
140   /** Request manager tab */
141   public static final String JavaDoc TAB_REQUEST_MANAGER = "tab.requestmanager";
142   /** Caching tab */
143   public static final String JavaDoc TAB_CACHING = "tab.caching";
144   /** Recovery tab */
145   public static final String JavaDoc TAB_RECOVERY = "tab.recovery";
146
147   /**
148    * Get items from combo box.
149    *
150    * @param usersBox the combo box
151    * @return the list of items
152    */

153   public static ArrayList JavaDoc getItemsFromCombo(JComboBox JavaDoc usersBox)
154   {
155     if (usersBox == null)
156       return new ArrayList JavaDoc(0);
157     int count = usersBox.getItemCount();
158     ArrayList JavaDoc list = new ArrayList JavaDoc(count);
159     for (int i = 0; i < count; i++)
160       list.add(usersBox.getItemAt(i));
161     return list;
162   }
163
164 }
Popular Tags