KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > propertyEditors > JPnlPropertyEditorOJBMetaJdbcConnectionDescriptor


1 package org.apache.ojb.tools.mapping.reversedb2.propertyEditors;
2
3 /* Copyright 2002-2005 The Apache Software Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */

17
18 import org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.*;
19
20 /**
21  * This is an implementation of a PropertyEditor for the Ojb MetaJdbcConnectionDescriptorNode class.
22  *
23  * @author <a HREF="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
24  * @version $Id: JPnlPropertyEditorOJBMetaJdbcConnectionDescriptor.java,v 1.1.2.1 2005/12/21 22:33:27 tomdz Exp $
25  */

26 public class JPnlPropertyEditorOJBMetaJdbcConnectionDescriptor extends PropertyEditor
27 {
28
29     /** Creates new form JPnlPropertyEditorOJBMetaJdbcConnectionDescriptor */
30     public JPnlPropertyEditorOJBMetaJdbcConnectionDescriptor()
31     {
32         initComponents();
33     }
34
35     /** This method is called from within the constructor to
36      * initialize the form.
37      * WARNING: Do NOT modify this code. The content of this method is
38      * always regenerated by the Form Editor.
39      */

40
41     private void initComponents()//GEN-BEGIN:initComponents
42
{
43         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
44
45         lblDatabaseAlias = new javax.swing.JLabel JavaDoc();
46         tfDatabaseAlias = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
47         lblDBMS = new javax.swing.JLabel JavaDoc();
48         tfDBMS = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
49         lblDatasourceName = new javax.swing.JLabel JavaDoc();
50         tfDatasourceName = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
51         lblDriver = new javax.swing.JLabel JavaDoc();
52         tfDriver = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
53         lblDescriptorKey = new javax.swing.JLabel JavaDoc();
54         tfDescriptorKey = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
55         lblJDBCLevel = new javax.swing.JLabel JavaDoc();
56         tfJDBCLevel = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
57         tfPassword = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
58         lblPassword = new javax.swing.JLabel JavaDoc();
59         lblProtocol = new javax.swing.JLabel JavaDoc();
60         tfProtocol = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
61         lblSubProtocol = new javax.swing.JLabel JavaDoc();
62         tfSubProtocol = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
63         tfUsername = new org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField();
64         lblUsername = new javax.swing.JLabel JavaDoc();
65
66         setLayout(new java.awt.GridBagLayout JavaDoc());
67
68         lblDatabaseAlias.setDisplayedMnemonic('a');
69         lblDatabaseAlias.setLabelFor(tfDatabaseAlias);
70         lblDatabaseAlias.setText("Database Alias:");
71         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
72         gridBagConstraints.gridx = 1;
73         gridBagConstraints.gridy = 1;
74         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
75         add(lblDatabaseAlias, gridBagConstraints);
76
77         tfDatabaseAlias.setText("jTextField1");
78         tfDatabaseAlias.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_DBALIAS);
79         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
80         gridBagConstraints.gridx = 2;
81         gridBagConstraints.gridy = 1;
82         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
83         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
84         gridBagConstraints.weightx = 1.0;
85         add(tfDatabaseAlias, gridBagConstraints);
86
87         lblDBMS.setDisplayedMnemonic('d');
88         lblDBMS.setLabelFor(tfDBMS);
89         lblDBMS.setText("DBMS:");
90         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
91         gridBagConstraints.gridx = 1;
92         gridBagConstraints.gridy = 2;
93         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
94         add(lblDBMS, gridBagConstraints);
95
96         tfDBMS.setText("jTextField1");
97         tfDBMS.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_DBMS);
98         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
99         gridBagConstraints.gridx = 2;
100         gridBagConstraints.gridy = 2;
101         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
102         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
103         gridBagConstraints.weightx = 1.0;
104         add(tfDBMS, gridBagConstraints);
105
106         lblDatasourceName.setDisplayedMnemonic('n');
107         lblDatasourceName.setLabelFor(tfDatasourceName);
108         lblDatasourceName.setText("Datasource Name:");
109         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
110         gridBagConstraints.gridx = 1;
111         gridBagConstraints.gridy = 3;
112         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
113         add(lblDatasourceName, gridBagConstraints);
114
115         tfDatasourceName.setText("jTextField1");
116         tfDatasourceName.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_DATASOURCE_NAME);
117         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
118         gridBagConstraints.gridx = 2;
119         gridBagConstraints.gridy = 3;
120         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
121         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
122         gridBagConstraints.weightx = 1.0;
123         add(tfDatasourceName, gridBagConstraints);
124
125         lblDriver.setDisplayedMnemonic('r');
126         lblDriver.setLabelFor(tfDriver);
127         lblDriver.setText("Driver:");
128         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
129         gridBagConstraints.gridx = 1;
130         gridBagConstraints.gridy = 4;
131         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
132         add(lblDriver, gridBagConstraints);
133
134         tfDriver.setText("jTextField1");
135         tfDriver.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_DRIVER);
136         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
137         gridBagConstraints.gridx = 2;
138         gridBagConstraints.gridy = 4;
139         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
140         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
141         gridBagConstraints.weightx = 1.0;
142         add(tfDriver, gridBagConstraints);
143
144         lblDescriptorKey.setDisplayedMnemonic('k');
145         lblDescriptorKey.setLabelFor(tfDescriptorKey);
146         lblDescriptorKey.setText("Descriptor Key:");
147         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
148         gridBagConstraints.gridx = 1;
149         gridBagConstraints.gridy = 5;
150         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
151         add(lblDescriptorKey, gridBagConstraints);
152
153         tfDescriptorKey.setText("jTextField1");
154         tfDescriptorKey.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_DESCRIPTOR_PBKEY);
155         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
156         gridBagConstraints.gridx = 2;
157         gridBagConstraints.gridy = 5;
158         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
159         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
160         gridBagConstraints.weightx = 1.0;
161         add(tfDescriptorKey, gridBagConstraints);
162
163         lblJDBCLevel.setDisplayedMnemonic('J');
164         lblJDBCLevel.setLabelFor(tfJDBCLevel);
165         lblJDBCLevel.setText("JDBC Level:");
166         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
167         gridBagConstraints.gridx = 1;
168         gridBagConstraints.gridy = 6;
169         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
170         add(lblJDBCLevel, gridBagConstraints);
171
172         tfJDBCLevel.setText("jTextField1");
173         tfJDBCLevel.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_JDBC_LEVEL);
174         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
175         gridBagConstraints.gridx = 2;
176         gridBagConstraints.gridy = 6;
177         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
178         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
179         gridBagConstraints.weightx = 1.0;
180         add(tfJDBCLevel, gridBagConstraints);
181
182         tfPassword.setText("jTextField1");
183         tfPassword.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_PASSWORD);
184         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
185         gridBagConstraints.gridx = 2;
186         gridBagConstraints.gridy = 7;
187         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
188         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
189         gridBagConstraints.weightx = 1.0;
190         add(tfPassword, gridBagConstraints);
191
192         lblPassword.setDisplayedMnemonic('p');
193         lblPassword.setLabelFor(tfPassword);
194         lblPassword.setText("Password:");
195         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
196         gridBagConstraints.gridx = 1;
197         gridBagConstraints.gridy = 7;
198         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
199         add(lblPassword, gridBagConstraints);
200
201         lblProtocol.setDisplayedMnemonic('o');
202         lblProtocol.setLabelFor(tfProtocol);
203         lblProtocol.setText("Protocol:");
204         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
205         gridBagConstraints.gridx = 1;
206         gridBagConstraints.gridy = 8;
207         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
208         add(lblProtocol, gridBagConstraints);
209
210         tfProtocol.setText("jTextField1");
211         tfProtocol.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_PROTOCOL);
212         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
213         gridBagConstraints.gridx = 2;
214         gridBagConstraints.gridy = 8;
215         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
216         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
217         gridBagConstraints.weightx = 1.0;
218         add(tfProtocol, gridBagConstraints);
219
220         lblSubProtocol.setDisplayedMnemonic('s');
221         lblSubProtocol.setLabelFor(tfSubProtocol);
222         lblSubProtocol.setText("Sub Protocol:");
223         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
224         gridBagConstraints.gridx = 1;
225         gridBagConstraints.gridy = 9;
226         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
227         add(lblSubProtocol, gridBagConstraints);
228
229         tfSubProtocol.setText("jTextField1");
230         tfSubProtocol.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_SUBPROTOCOL);
231         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
232         gridBagConstraints.gridx = 2;
233         gridBagConstraints.gridy = 9;
234         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
235         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
236         gridBagConstraints.weightx = 1.0;
237         add(tfSubProtocol, gridBagConstraints);
238
239         tfUsername.setText("jTextField1");
240         tfUsername.setEditorKey(org.apache.ojb.tools.mapping.reversedb2.ojbmetatreemodel.OjbMetaJdbcConnectionDescriptorNode.ATT_USERNAME);
241         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
242         gridBagConstraints.gridx = 2;
243         gridBagConstraints.gridy = 10;
244         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
245         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
246         gridBagConstraints.weightx = 1.0;
247         gridBagConstraints.weighty = 1.0;
248         add(tfUsername, gridBagConstraints);
249
250         lblUsername.setDisplayedMnemonic('m');
251         lblUsername.setLabelFor(tfUsername);
252         lblUsername.setText("Username:");
253         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
254         gridBagConstraints.gridx = 1;
255         gridBagConstraints.gridy = 10;
256         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
257         gridBagConstraints.weighty = 1.0;
258         add(lblUsername, gridBagConstraints);
259
260     }//GEN-END:initComponents
261

262     public void setEditorTarget (PropertyEditorTarget target)
263     {
264         if (target instanceof OjbMetaJdbcConnectionDescriptorNode)
265         {
266             super.setEditorTarget(target);
267         }
268         else
269         {
270             throw new UnsupportedOperationException JavaDoc("This editor can only edit OjbMetaJdbcConnectionDescriptorNode objects");
271         }
272     }
273
274     // Variables declaration - do not modify//GEN-BEGIN:variables
275
private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfProtocol;
276     private javax.swing.JLabel JavaDoc lblDriver;
277     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfJDBCLevel;
278     private javax.swing.JLabel JavaDoc lblDBMS;
279     private javax.swing.JLabel JavaDoc lblDatabaseAlias;
280     private javax.swing.JLabel JavaDoc lblProtocol;
281     private javax.swing.JLabel JavaDoc lblUsername;
282     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfDBMS;
283     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfDatasourceName;
284     private javax.swing.JLabel JavaDoc lblDatasourceName;
285     private javax.swing.JLabel JavaDoc lblJDBCLevel;
286     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfUsername;
287     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfDescriptorKey;
288     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfSubProtocol;
289     private javax.swing.JLabel JavaDoc lblSubProtocol;
290     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfPassword;
291     private javax.swing.JLabel JavaDoc lblPassword;
292     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfDatabaseAlias;
293     private javax.swing.JLabel JavaDoc lblDescriptorKey;
294     private org.apache.ojb.tools.mapping.reversedb2.propertyEditors.PropertyEditorJTextField tfDriver;
295     // End of variables declaration//GEN-END:variables
296

297 }
298
Popular Tags