1 package org.apache.ojb.tools.mapping.reversedb.gui; 2 3 17 18 23 public class DBMetaPropertySheet extends javax.swing.JPanel 24 implements PropertySheetView 25 { 26 org.apache.ojb.tools.mapping.reversedb.DBMeta aMeta; 27 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 52 private void initComponents() { 54 java.awt.GridBagConstraints gridBagConstraints; 55 56 jPanel1 = new javax.swing.JPanel (); 57 lblEnabled = new javax.swing.JLabel (); 58 cbEnabled = new javax.swing.JCheckBox (); 59 jLabel1 = new javax.swing.JLabel (); 60 jLabel2 = new javax.swing.JLabel (); 61 lblProductName = new javax.swing.JLabel (); 62 tfProductName = new javax.swing.JTextField (); 63 lblProductVersion = new javax.swing.JLabel (); 64 tfProductVersion = new javax.swing.JTextField (); 65 jLabel8 = new javax.swing.JLabel (); 66 jLabel7 = new javax.swing.JLabel (); 67 lblCatalogTerm = new javax.swing.JLabel (); 68 tfCatalogTerm = new javax.swing.JTextField (); 69 lblCatalogSeparator = new javax.swing.JLabel (); 70 tfCatalogSeparator = new javax.swing.JTextField (); 71 lblSupportsCatalogInIndex = new javax.swing.JLabel (); 72 tfSupportsCatalogInIndex = new javax.swing.JTextField (); 73 lblSupportsCatalogInDML = new javax.swing.JLabel (); 74 tfSupportsCatalogInDML = new javax.swing.JTextField (); 75 lblSupportsCatalogInPrivilegeDefinitions = new javax.swing.JLabel (); 76 tfSupportsCatalogInPrivilegeDefinitions = new javax.swing.JTextField (); 77 lblSupportsCatalogInProcedureCalls = new javax.swing.JLabel (); 78 tfSupportsCatalogInProcedureCalls = new javax.swing.JTextField (); 79 lblSupportsCatalogInTableDefinitions = new javax.swing.JLabel (); 80 tfSupportsCatalogInTableDefinitions = new javax.swing.JTextField (); 81 jLabel4 = new javax.swing.JLabel (); 82 jLabel3 = new javax.swing.JLabel (); 83 lblSchemaTerm = new javax.swing.JLabel (); 84 tfSchemaTerm = new javax.swing.JTextField (); 85 86 setLayout(new java.awt.GridBagLayout ()); 87 88 addComponentListener(new java.awt.event.ComponentAdapter () 89 { 90 public void componentShown(java.awt.event.ComponentEvent evt) 91 { 92 formComponentShown(evt); 93 } 94 public void componentHidden(java.awt.event.ComponentEvent evt) 95 { 96 formComponentHidden(evt); 97 } 98 }); 99 100 addHierarchyListener(new java.awt.event.HierarchyListener () 101 { 102 public void hierarchyChanged(java.awt.event.HierarchyEvent evt) 103 { 104 formHierarchyChanged(evt); 105 } 106 }); 107 108 jPanel1.setLayout(new java.awt.GridLayout (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 () 116 { 117 public void actionPerformed(java.awt.event.ActionEvent 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 (); 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 } 234 private void cbEnabledActionPerformed (java.awt.event.ActionEvent evt) { aMeta.setEnabled(cbEnabled.isSelected()); 238 } 240 private void formHierarchyChanged (java.awt.event.HierarchyEvent evt) { readValuesFromMeta(); 244 } 246 private void formComponentHidden (java.awt.event.ComponentEvent evt) { } 251 private void formComponentShown (java.awt.event.ComponentEvent evt) { } 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 (); 265 } 266 267 268 private javax.swing.JTextField tfSchemaTerm; 270 private javax.swing.JLabel lblSupportsCatalogInDML; 271 private javax.swing.JLabel lblProductVersion; 272 private javax.swing.JTextField tfSupportsCatalogInDML; 273 private javax.swing.JTextField tfProductVersion; 274 private javax.swing.JPanel jPanel1; 275 private javax.swing.JLabel lblEnabled; 276 private javax.swing.JLabel lblCatalogSeparator; 277 private javax.swing.JCheckBox cbEnabled; 278 private javax.swing.JTextField tfCatalogSeparator; 279 private javax.swing.JTextField tfSupportsCatalogInTableDefinitions; 280 private javax.swing.JTextField tfSupportsCatalogInPrivilegeDefinitions; 281 private javax.swing.JLabel lblSupportsCatalogInTableDefinitions; 282 private javax.swing.JLabel lblSupportsCatalogInPrivilegeDefinitions; 283 private javax.swing.JTextField tfCatalogTerm; 284 private javax.swing.JLabel lblCatalogTerm; 285 private javax.swing.JLabel lblSupportsCatalogInIndex; 286 private javax.swing.JLabel jLabel8; 287 private javax.swing.JLabel jLabel7; 288 private javax.swing.JLabel jLabel4; 289 private javax.swing.JTextField tfSupportsCatalogInProcedureCalls; 290 private javax.swing.JTextField tfSupportsCatalogInIndex; 291 private javax.swing.JLabel jLabel3; 292 private javax.swing.JTextField tfProductName; 293 private javax.swing.JLabel jLabel2; 294 private javax.swing.JLabel jLabel1; 295 private javax.swing.JLabel lblSupportsCatalogInProcedureCalls; 296 private javax.swing.JLabel lblProductName; 297 private javax.swing.JLabel lblSchemaTerm; 298 300 } 301 302 362 363 | Popular Tags |