KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb > gui > DBMetaPropertySheet


1 package org.apache.ojb.tools.mapping.reversedb.gui;
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 /**
19  *
20  * @author <a HREF="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
21  * @version $Id: DBMetaPropertySheet.java,v 1.1.2.1 2005/12/21 22:32:02 tomdz Exp $
22  */

23 public class DBMetaPropertySheet extends javax.swing.JPanel JavaDoc
24   implements PropertySheetView
25 {
26     org.apache.ojb.tools.mapping.reversedb.DBMeta aMeta;
27   /** Creates new form DBCatalogPropertySheet */
28   public DBMetaPropertySheet ()
29   {
30     initComponents ();
31   }
32   
33   private void readValuesFromMeta()
34   {
35     this.cbEnabled.setSelected(aMeta.isEnabled());
36     this.tfCatalogTerm.setText(aMeta.getCatalogTerm());
37     this.tfSupportsCatalogInDML.setText("" + aMeta.getSupportsCatalogsInDataManipulation ());
38     this.tfSupportsCatalogInIndex.setText("" + aMeta.getSupportsCatalogsInIndexDefinitions());
39     this.tfSupportsCatalogInPrivilegeDefinitions.setText("" + aMeta.getSupportsCatalogsInPrivilegeDefinitions ());
40     this.tfSupportsCatalogInProcedureCalls.setText("" + aMeta.getSupportsCatalogsInProcedureCalls ());
41     this.tfSupportsCatalogInTableDefinitions.setText("" + aMeta.getSupportsCatalogsInTableDefinitions ());
42     this.tfSchemaTerm.setText(aMeta.getSchemaTerm());
43     this.tfProductName.setText(aMeta.getDatabaseProductName ());
44     this.tfProductVersion.setText(aMeta.getDatabaseProductVersion ());
45   }
46   
47   /** This method is called from within the constructor to
48    * initialize the form.
49    * WARNING: Do NOT modify this code. The content of this method is
50    * always regenerated by the Form Editor.
51    */

52     private void initComponents()//GEN-BEGIN:initComponents
53
{
54         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
55
56         jPanel1 = new javax.swing.JPanel JavaDoc();
57         lblEnabled = new javax.swing.JLabel JavaDoc();
58         cbEnabled = new javax.swing.JCheckBox JavaDoc();
59         jLabel1 = new javax.swing.JLabel JavaDoc();
60         jLabel2 = new javax.swing.JLabel JavaDoc();
61         lblProductName = new javax.swing.JLabel JavaDoc();
62         tfProductName = new javax.swing.JTextField JavaDoc();
63         lblProductVersion = new javax.swing.JLabel JavaDoc();
64         tfProductVersion = new javax.swing.JTextField JavaDoc();
65         jLabel8 = new javax.swing.JLabel JavaDoc();
66         jLabel7 = new javax.swing.JLabel JavaDoc();
67         lblCatalogTerm = new javax.swing.JLabel JavaDoc();
68         tfCatalogTerm = new javax.swing.JTextField JavaDoc();
69         lblCatalogSeparator = new javax.swing.JLabel JavaDoc();
70         tfCatalogSeparator = new javax.swing.JTextField JavaDoc();
71         lblSupportsCatalogInIndex = new javax.swing.JLabel JavaDoc();
72         tfSupportsCatalogInIndex = new javax.swing.JTextField JavaDoc();
73         lblSupportsCatalogInDML = new javax.swing.JLabel JavaDoc();
74         tfSupportsCatalogInDML = new javax.swing.JTextField JavaDoc();
75         lblSupportsCatalogInPrivilegeDefinitions = new javax.swing.JLabel JavaDoc();
76         tfSupportsCatalogInPrivilegeDefinitions = new javax.swing.JTextField JavaDoc();
77         lblSupportsCatalogInProcedureCalls = new javax.swing.JLabel JavaDoc();
78         tfSupportsCatalogInProcedureCalls = new javax.swing.JTextField JavaDoc();
79         lblSupportsCatalogInTableDefinitions = new javax.swing.JLabel JavaDoc();
80         tfSupportsCatalogInTableDefinitions = new javax.swing.JTextField JavaDoc();
81         jLabel4 = new javax.swing.JLabel JavaDoc();
82         jLabel3 = new javax.swing.JLabel JavaDoc();
83         lblSchemaTerm = new javax.swing.JLabel JavaDoc();
84         tfSchemaTerm = new javax.swing.JTextField JavaDoc();
85
86         setLayout(new java.awt.GridBagLayout JavaDoc());
87
88         addComponentListener(new java.awt.event.ComponentAdapter JavaDoc()
89         {
90             public void componentShown(java.awt.event.ComponentEvent JavaDoc evt)
91             {
92                 formComponentShown(evt);
93             }
94             public void componentHidden(java.awt.event.ComponentEvent JavaDoc evt)
95             {
96                 formComponentHidden(evt);
97             }
98         });
99
100         addHierarchyListener(new java.awt.event.HierarchyListener JavaDoc()
101         {
102             public void hierarchyChanged(java.awt.event.HierarchyEvent JavaDoc evt)
103             {
104                 formHierarchyChanged(evt);
105             }
106         });
107
108         jPanel1.setLayout(new java.awt.GridLayout JavaDoc(19, 2));
109
110         lblEnabled.setText("enabled");
111         lblEnabled.setDisplayedMnemonic('e');
112         jPanel1.add(lblEnabled);
113
114         cbEnabled.setMnemonic('e');
115         cbEnabled.addActionListener(new java.awt.event.ActionListener JavaDoc()
116         {
117             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt)
118             {
119                 cbEnabledActionPerformed(evt);
120             }
121         });
122
123         jPanel1.add(cbEnabled);
124
125         jPanel1.add(jLabel1);
126
127         jPanel1.add(jLabel2);
128
129         lblProductName.setText("Database Product Name:");
130         jPanel1.add(lblProductName);
131
132         tfProductName.setEditable(false);
133         tfProductName.setText("jTextField1");
134         tfProductName.setBorder(null);
135         jPanel1.add(tfProductName);
136
137         lblProductVersion.setText("Database Product Version:");
138         jPanel1.add(lblProductVersion);
139
140         tfProductVersion.setEditable(false);
141         tfProductVersion.setText("jTextField2");
142         tfProductVersion.setBorder(null);
143         jPanel1.add(tfProductVersion);
144
145         jPanel1.add(jLabel8);
146
147         jPanel1.add(jLabel7);
148
149         lblCatalogTerm.setText("Catalog Term:");
150         lblCatalogTerm.setLabelFor(tfCatalogTerm);
151         jPanel1.add(lblCatalogTerm);
152
153         tfCatalogTerm.setEditable(false);
154         tfCatalogTerm.setText("jTextField1");
155         tfCatalogTerm.setBorder(null);
156         jPanel1.add(tfCatalogTerm);
157
158         lblCatalogSeparator.setText("Catalog Separator:");
159         lblCatalogSeparator.setLabelFor(tfCatalogSeparator);
160         jPanel1.add(lblCatalogSeparator);
161
162         tfCatalogSeparator.setEditable(false);
163         tfCatalogSeparator.setText("jTextField1");
164         tfCatalogSeparator.setBorder(null);
165         jPanel1.add(tfCatalogSeparator);
166
167         lblSupportsCatalogInIndex.setText("supports Catalog in Index:");
168         lblSupportsCatalogInIndex.setLabelFor(tfSupportsCatalogInIndex);
169         jPanel1.add(lblSupportsCatalogInIndex);
170
171         tfSupportsCatalogInIndex.setEditable(false);
172         tfSupportsCatalogInIndex.setText("jTextField1");
173         tfSupportsCatalogInIndex.setBorder(null);
174         jPanel1.add(tfSupportsCatalogInIndex);
175
176         lblSupportsCatalogInDML.setText("supports Catalog in DML:");
177         lblSupportsCatalogInDML.setLabelFor(lblSupportsCatalogInDML);
178         jPanel1.add(lblSupportsCatalogInDML);
179
180         tfSupportsCatalogInDML.setEditable(false);
181         tfSupportsCatalogInDML.setText("jTextField1");
182         tfSupportsCatalogInDML.setBorder(null);
183         jPanel1.add(tfSupportsCatalogInDML);
184
185         lblSupportsCatalogInPrivilegeDefinitions.setText("supports Catalog in Privilege Definitions:");
186         lblSupportsCatalogInPrivilegeDefinitions.setLabelFor(tfSupportsCatalogInPrivilegeDefinitions);
187         jPanel1.add(lblSupportsCatalogInPrivilegeDefinitions);
188
189         tfSupportsCatalogInPrivilegeDefinitions.setEditable(false);
190         tfSupportsCatalogInPrivilegeDefinitions.setText("jTextField1");
191         tfSupportsCatalogInPrivilegeDefinitions.setBorder(null);
192         jPanel1.add(tfSupportsCatalogInPrivilegeDefinitions);
193
194         lblSupportsCatalogInProcedureCalls.setText("supports Catalog in Procedure Calls:");
195         lblSupportsCatalogInProcedureCalls.setLabelFor(tfSupportsCatalogInProcedureCalls);
196         jPanel1.add(lblSupportsCatalogInProcedureCalls);
197
198         tfSupportsCatalogInProcedureCalls.setEditable(false);
199         tfSupportsCatalogInProcedureCalls.setText("jTextField1");
200         tfSupportsCatalogInProcedureCalls.setBorder(null);
201         jPanel1.add(tfSupportsCatalogInProcedureCalls);
202
203         lblSupportsCatalogInTableDefinitions.setText("supports Catalog in Table Definitions:");
204         lblSupportsCatalogInTableDefinitions.setLabelFor(tfSupportsCatalogInTableDefinitions);
205         jPanel1.add(lblSupportsCatalogInTableDefinitions);
206
207         tfSupportsCatalogInTableDefinitions.setEditable(false);
208         tfSupportsCatalogInTableDefinitions.setText("jTextField1");
209         tfSupportsCatalogInTableDefinitions.setBorder(null);
210         jPanel1.add(tfSupportsCatalogInTableDefinitions);
211
212         jPanel1.add(jLabel4);
213
214         jPanel1.add(jLabel3);
215
216         lblSchemaTerm.setText("Schema Term:");
217         lblSchemaTerm.setLabelFor(tfSchemaTerm);
218         jPanel1.add(lblSchemaTerm);
219
220         tfSchemaTerm.setEditable(false);
221         tfSchemaTerm.setText("jTextField1");
222         tfSchemaTerm.setBorder(null);
223         jPanel1.add(tfSchemaTerm);
224
225         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
226         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
227         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
228         gridBagConstraints.weightx = 1.0;
229         gridBagConstraints.weighty = 1.0;
230         add(jPanel1, gridBagConstraints);
231
232     }//GEN-END:initComponents
233

234   private void cbEnabledActionPerformed (java.awt.event.ActionEvent JavaDoc evt)//GEN-FIRST:event_cbEnabledActionPerformed
235
{//GEN-HEADEREND:event_cbEnabledActionPerformed
236
// Add your handling code here:
237
aMeta.setEnabled(cbEnabled.isSelected());
238   }//GEN-LAST:event_cbEnabledActionPerformed
239

240   private void formHierarchyChanged (java.awt.event.HierarchyEvent JavaDoc evt)//GEN-FIRST:event_formHierarchyChanged
241
{//GEN-HEADEREND:event_formHierarchyChanged
242
// Add your handling code here:
243
readValuesFromMeta();
244   }//GEN-LAST:event_formHierarchyChanged
245

246   private void formComponentHidden (java.awt.event.ComponentEvent JavaDoc evt)//GEN-FIRST:event_formComponentHidden
247
{//GEN-HEADEREND:event_formComponentHidden
248
// Add your handling code here:
249
}//GEN-LAST:event_formComponentHidden
250

251   private void formComponentShown (java.awt.event.ComponentEvent JavaDoc evt)//GEN-FIRST:event_formComponentShown
252
{//GEN-HEADEREND:event_formComponentShown
253
// Add your handling code here:
254
}//GEN-LAST:event_formComponentShown
255

256   public void setModel (PropertySheetModel pm)
257   {
258     if (pm instanceof org.apache.ojb.tools.mapping.reversedb.DBMeta)
259     {
260       this.aMeta = (org.apache.ojb.tools.mapping.reversedb.DBMeta)pm;
261       this.readValuesFromMeta();
262     }
263     else
264       throw new IllegalArgumentException JavaDoc();
265   }
266   
267   
268     // Variables declaration - do not modify//GEN-BEGIN:variables
269
private javax.swing.JTextField JavaDoc tfSchemaTerm;
270     private javax.swing.JLabel JavaDoc lblSupportsCatalogInDML;
271     private javax.swing.JLabel JavaDoc lblProductVersion;
272     private javax.swing.JTextField JavaDoc tfSupportsCatalogInDML;
273     private javax.swing.JTextField JavaDoc tfProductVersion;
274     private javax.swing.JPanel JavaDoc jPanel1;
275     private javax.swing.JLabel JavaDoc lblEnabled;
276     private javax.swing.JLabel JavaDoc lblCatalogSeparator;
277     private javax.swing.JCheckBox JavaDoc cbEnabled;
278     private javax.swing.JTextField JavaDoc tfCatalogSeparator;
279     private javax.swing.JTextField JavaDoc tfSupportsCatalogInTableDefinitions;
280     private javax.swing.JTextField JavaDoc tfSupportsCatalogInPrivilegeDefinitions;
281     private javax.swing.JLabel JavaDoc lblSupportsCatalogInTableDefinitions;
282     private javax.swing.JLabel JavaDoc lblSupportsCatalogInPrivilegeDefinitions;
283     private javax.swing.JTextField JavaDoc tfCatalogTerm;
284     private javax.swing.JLabel JavaDoc lblCatalogTerm;
285     private javax.swing.JLabel JavaDoc lblSupportsCatalogInIndex;
286     private javax.swing.JLabel JavaDoc jLabel8;
287     private javax.swing.JLabel JavaDoc jLabel7;
288     private javax.swing.JLabel JavaDoc jLabel4;
289     private javax.swing.JTextField JavaDoc tfSupportsCatalogInProcedureCalls;
290     private javax.swing.JTextField JavaDoc tfSupportsCatalogInIndex;
291     private javax.swing.JLabel JavaDoc jLabel3;
292     private javax.swing.JTextField JavaDoc tfProductName;
293     private javax.swing.JLabel JavaDoc jLabel2;
294     private javax.swing.JLabel JavaDoc jLabel1;
295     private javax.swing.JLabel JavaDoc lblSupportsCatalogInProcedureCalls;
296     private javax.swing.JLabel JavaDoc lblProductName;
297     private javax.swing.JLabel JavaDoc lblSchemaTerm;
298     // End of variables declaration//GEN-END:variables
299

300 }
301
302 /***************************** Changelog *****************************
303 // $Log: DBMetaPropertySheet.java,v $
304 // Revision 1.1.2.1 2005/12/21 22:32:02 tomdz
305 // Updated license
306 //
307 // Revision 1.1 2004/05/05 16:38:49 arminw
308 // fix fault
309 // wrong package structure used:
310 // org.apache.ojb.tools.reversdb
311 // org.apache.ojb.tools.reversdb2
312 //
313 // instead of
314 // org.apache.ojb.tools.mapping.reversdb
315 // org.apache.ojb.tools.mapping.reversdb2
316 //
317 // Revision 1.1 2004/05/04 13:44:59 arminw
318 // move reverseDB stuff
319 //
320 // Revision 1.6 2004/04/05 12:16:23 tomdz
321 // Fixed/updated license in files leftover from automatic license transition
322 //
323 // Revision 1.5 2004/04/04 23:53:42 brianm
324 // Fixed initial copyright dates to match cvs repository
325 //
326 // Revision 1.4 2004/03/11 18:16:22 brianm
327 // ASL 2.0
328 //
329 // Revision 1.3 2002/06/18 12:26:41 florianbruckner
330 // changes in Netbeans Form definitions after move to jakarta.
331 //
332 // Revision 1.2 2002/06/17 19:34:34 jvanzyl
333 // Correcting all the package references.
334 // PR:
335 // Obtained from:
336 // Submitted by:
337 // Reviewed by:
338 //
339 // Revision 1.1.1.1 2002/06/17 18:16:53 jvanzyl
340 // Initial OJB import
341 //
342 // Revision 1.2 2002/05/16 11:47:09 florianbruckner
343 // fix CR/LF issue, change license to ASL
344 //
345 // Revision 1.1 2002/04/18 11:44:16 mpoeschl
346 //
347 // move files to new location
348 //
349 // Revision 1.3 2002/04/07 09:05:17 thma
350 // *** empty log message ***
351 //
352 // Revision 1.2 2002/03/11 17:36:26 florianbruckner
353 // fix line break issue for these files that were previously checked in with -kb
354 //
355 // Revision 1.1 2002/03/04 17:19:32 thma
356 // initial checking for Florians Reverse engineering tool
357 //
358 // Revision 1.1.1.1 2002/02/20 13:35:25 Administrator
359 // initial import
360 //
361 /***************************** Changelog *****************************/

362  
363
Popular Tags