KickJava   Java API By Example, From Geeks To Geeks.

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


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: DBCatalogPropertySheet.java,v 1.1.2.1 2005/12/21 22:32:02 tomdz Exp $
22  */

23 public class DBCatalogPropertySheet extends javax.swing.JPanel JavaDoc
24   implements PropertySheetView
25 {
26     org.apache.ojb.tools.mapping.reversedb.DBCatalog aCatalog;
27   /** Creates new form DBCatalogPropertySheet */
28   public DBCatalogPropertySheet ()
29   {
30     initComponents ();
31   }
32   
33   private void readValuesFromCatalog()
34   {
35     this.tfCatalogName.setText(aCatalog.getCatalogName());
36     this.cbEnabled.setSelected(aCatalog.isEnabled());
37     this.cbDisabledByParent.setSelected(!aCatalog.getDBMeta().isEnabled ());
38   }
39   
40   /** This method is called from within the constructor to
41    * initialize the form.
42    * WARNING: Do NOT modify this code. The content of this method is
43    * always regenerated by the Form Editor.
44    */

45     private void initComponents()//GEN-BEGIN:initComponents
46
{
47         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
48
49         jPanel1 = new javax.swing.JPanel JavaDoc();
50         lblEnabled = new javax.swing.JLabel JavaDoc();
51         cbEnabled = new javax.swing.JCheckBox JavaDoc();
52         lblDisabledByParent = new javax.swing.JLabel JavaDoc();
53         cbDisabledByParent = new javax.swing.JCheckBox JavaDoc();
54         jLabel2 = new javax.swing.JLabel JavaDoc();
55         jLabel1 = new javax.swing.JLabel JavaDoc();
56         lblCatalogName = new javax.swing.JLabel JavaDoc();
57         tfCatalogName = new javax.swing.JTextField JavaDoc();
58
59         setLayout(new java.awt.GridBagLayout JavaDoc());
60
61         addComponentListener(new java.awt.event.ComponentAdapter JavaDoc()
62         {
63             public void componentShown(java.awt.event.ComponentEvent JavaDoc evt)
64             {
65                 formComponentShown(evt);
66             }
67             public void componentHidden(java.awt.event.ComponentEvent JavaDoc evt)
68             {
69                 formComponentHidden(evt);
70             }
71         });
72
73         addHierarchyListener(new java.awt.event.HierarchyListener JavaDoc()
74         {
75             public void hierarchyChanged(java.awt.event.HierarchyEvent JavaDoc evt)
76             {
77                 formHierarchyChanged(evt);
78             }
79         });
80
81         jPanel1.setLayout(new java.awt.GridLayout JavaDoc(5, 2));
82
83         lblEnabled.setText("enabled");
84         lblEnabled.setDisplayedMnemonic('e');
85         jPanel1.add(lblEnabled);
86
87         cbEnabled.setMnemonic('e');
88         cbEnabled.addActionListener(new java.awt.event.ActionListener JavaDoc()
89         {
90             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt)
91             {
92                 cbEnabledActionPerformed(evt);
93             }
94         });
95
96         jPanel1.add(cbEnabled);
97
98         lblDisabledByParent.setText("disabled by Parent:");
99         lblDisabledByParent.setDisplayedMnemonic('e');
100         jPanel1.add(lblDisabledByParent);
101
102         cbDisabledByParent.setMnemonic('e');
103         cbDisabledByParent.setEnabled(false);
104         jPanel1.add(cbDisabledByParent);
105
106         jPanel1.add(jLabel2);
107
108         jPanel1.add(jLabel1);
109
110         lblCatalogName.setText("Catalog Name:");
111         lblCatalogName.setLabelFor(tfCatalogName);
112         jPanel1.add(lblCatalogName);
113
114         tfCatalogName.setEditable(false);
115         tfCatalogName.setText("jTextField1");
116         tfCatalogName.setBorder(null);
117         jPanel1.add(tfCatalogName);
118
119         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
120         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
121         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
122         gridBagConstraints.weightx = 1.0;
123         gridBagConstraints.weighty = 1.0;
124         add(jPanel1, gridBagConstraints);
125
126     }//GEN-END:initComponents
127

128   private void cbEnabledActionPerformed (java.awt.event.ActionEvent JavaDoc evt)//GEN-FIRST:event_cbEnabledActionPerformed
129
{//GEN-HEADEREND:event_cbEnabledActionPerformed
130
// Add your handling code here:
131
this.aCatalog.setEnabled(cbEnabled.isSelected());
132   }//GEN-LAST:event_cbEnabledActionPerformed
133

134   private void formHierarchyChanged (java.awt.event.HierarchyEvent JavaDoc evt)//GEN-FIRST:event_formHierarchyChanged
135
{//GEN-HEADEREND:event_formHierarchyChanged
136
// Add your handling code here:
137
readValuesFromCatalog();
138   }//GEN-LAST:event_formHierarchyChanged
139

140   private void formComponentHidden (java.awt.event.ComponentEvent JavaDoc evt)//GEN-FIRST:event_formComponentHidden
141
{//GEN-HEADEREND:event_formComponentHidden
142
// Add your handling code here:
143
}//GEN-LAST:event_formComponentHidden
144

145   private void formComponentShown (java.awt.event.ComponentEvent JavaDoc evt)//GEN-FIRST:event_formComponentShown
146
{//GEN-HEADEREND:event_formComponentShown
147
// Add your handling code here:
148
}//GEN-LAST:event_formComponentShown
149

150   public void setModel (PropertySheetModel pm)
151   {
152     if (pm instanceof org.apache.ojb.tools.mapping.reversedb.DBCatalog)
153     {
154       this.aCatalog = (org.apache.ojb.tools.mapping.reversedb.DBCatalog)pm;
155       this.readValuesFromCatalog();
156     }
157     else
158       throw new IllegalArgumentException JavaDoc();
159   }
160   
161   
162     // Variables declaration - do not modify//GEN-BEGIN:variables
163
private javax.swing.JCheckBox JavaDoc cbDisabledByParent;
164     private javax.swing.JPanel JavaDoc jPanel1;
165     private javax.swing.JTextField JavaDoc tfCatalogName;
166     private javax.swing.JLabel JavaDoc lblCatalogName;
167     private javax.swing.JLabel JavaDoc lblEnabled;
168     private javax.swing.JCheckBox JavaDoc cbEnabled;
169     private javax.swing.JLabel JavaDoc lblDisabledByParent;
170     private javax.swing.JLabel JavaDoc jLabel2;
171     private javax.swing.JLabel JavaDoc jLabel1;
172     // End of variables declaration//GEN-END:variables
173

174 }
175
176 /***************************** Changelog *****************************
177 // $Log: DBCatalogPropertySheet.java,v $
178 // Revision 1.1.2.1 2005/12/21 22:32:02 tomdz
179 // Updated license
180 //
181 // Revision 1.1 2004/05/05 16:38:49 arminw
182 // fix fault
183 // wrong package structure used:
184 // org.apache.ojb.tools.reversdb
185 // org.apache.ojb.tools.reversdb2
186 //
187 // instead of
188 // org.apache.ojb.tools.mapping.reversdb
189 // org.apache.ojb.tools.mapping.reversdb2
190 //
191 // Revision 1.1 2004/05/04 13:44:59 arminw
192 // move reverseDB stuff
193 //
194 // Revision 1.6 2004/04/05 12:16:23 tomdz
195 // Fixed/updated license in files leftover from automatic license transition
196 //
197 // Revision 1.5 2004/04/04 23:53:42 brianm
198 // Fixed initial copyright dates to match cvs repository
199 //
200 // Revision 1.4 2004/03/11 18:16:22 brianm
201 // ASL 2.0
202 //
203 // Revision 1.3 2002/06/18 12:26:41 florianbruckner
204 // changes in Netbeans Form definitions after move to jakarta.
205 //
206 // Revision 1.2 2002/06/17 19:34:34 jvanzyl
207 // Correcting all the package references.
208 // PR:
209 // Obtained from:
210 // Submitted by:
211 // Reviewed by:
212 //
213 // Revision 1.1.1.1 2002/06/17 18:16:52 jvanzyl
214 // Initial OJB import
215 //
216 // Revision 1.2 2002/05/16 11:47:09 florianbruckner
217 // fix CR/LF issue, change license to ASL
218 //
219 // Revision 1.1 2002/04/18 11:44:16 mpoeschl
220 //
221 // move files to new location
222 //
223 // Revision 1.3 2002/04/07 09:05:17 thma
224 // *** empty log message ***
225 //
226 // Revision 1.2 2002/03/11 17:36:26 florianbruckner
227 // fix line break issue for these files that were previously checked in with -kb
228 //
229 // Revision 1.1 2002/03/04 17:19:32 thma
230 // initial checking for Florians Reverse engineering tool
231 //
232 // Revision 1.1.1.1 2002/02/20 13:35:25 Administrator
233 // initial import
234 //
235 /***************************** Changelog *****************************/

236  
237
Popular Tags