KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > sunresources > wizards > CPPropertiesPanelVisualPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * CPPropertiesPanelVisualPanel.java
21  *
22  * Created on October 8, 2003
23  */

24
25 package org.netbeans.modules.j2ee.sun.ide.sunresources.wizards;
26
27 import org.openide.util.NbBundle;
28 import javax.swing.table.TableColumn JavaDoc;
29 import javax.swing.event.ChangeEvent JavaDoc;
30 import javax.swing.event.TableModelListener JavaDoc;
31 import javax.swing.ListSelectionModel JavaDoc;
32 import java.util.ResourceBundle JavaDoc;
33
34 import org.netbeans.modules.j2ee.sun.ide.editors.NameValuePair;
35 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldGroup;
36 import org.netbeans.modules.j2ee.sun.sunresources.beans.Field;
37 import org.netbeans.modules.j2ee.sun.sunresources.beans.Wizard;
38 import org.netbeans.modules.j2ee.sun.sunresources.beans.WizardConstants;
39 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldGroupHelper;
40 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldHelper;
41
42 /** A single panel for a wizard - the GUI portion.
43  *
44  * @author nityad
45  */

46 public class CPPropertiesPanelVisualPanel extends javax.swing.JPanel JavaDoc implements WizardConstants, TableModelListener JavaDoc{
47     
48     /** The wizard panel descriptor associated with this GUI panel.
49      * If you need to fire state changes or something similar, you can
50      * use this handle to do so.
51      */

52     private final CPPropertiesPanelPanel panel;
53     private ResourceConfigHelper helper;
54     private FieldGroup generalGroup, propertiesGroup;
55     private Field dsField, typeField;
56         
57     /** Create the wizard panel and set up some basic properties. */
58     public CPPropertiesPanelVisualPanel(CPPropertiesPanelPanel panel, ResourceConfigHelper helper, Wizard wizardInfo) {
59         this.panel = panel;
60         this.helper = helper;
61         this.tableModel = new PropertiesTableModel(this.helper.getData());
62         
63         initComponents();
64         // Provide a name in the title bar.
65
setName(NbBundle.getMessage(CPPropertiesPanelVisualPanel.class, "TITLE_ConnPoolWizardPanel_properties")); //NOI18N
66

67         this.generalGroup = FieldGroupHelper.getFieldGroup(wizardInfo, __General);
68         this.propertiesGroup = FieldGroupHelper.getFieldGroup(wizardInfo, __Properties);
69         this.dsField = FieldHelper.getField(generalGroup, __DatasourceClassname);
70       
71         setPropTableCellEditor();
72         this.tableModel.addTableModelListener(this);
73         this.jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
74         
75         String JavaDoc dsClassName = this.helper.getData().getString(__DatasourceClassname);
76         if (dsClassName.length() == 0)
77             dsClassName = FieldHelper.getDefaultValue(dsField);
78         classNameField.setText(dsClassName);
79         
80         this.typeField = FieldHelper.getField(generalGroup, __ResType);
81         String JavaDoc resType = this.helper.getData().getString(__ResType);
82         if (resType.length() == 0)
83             resType = FieldHelper.getDefaultValue(typeField);
84         resTypeField.setText(resType);
85     }
86     
87     /** This method is called from within the constructor to
88      * initialize the form.
89      * WARNING: Do NOT modify this code. The content of this method is
90      * always regenerated by the Form Editor.
91      */

92     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
93
private void initComponents() {
94         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
95
96         jPanel1 = new javax.swing.JPanel JavaDoc();
97         classNameField = new javax.swing.JTextField JavaDoc();
98         classNameLabel = new javax.swing.JLabel JavaDoc();
99         resTypeLabel = new javax.swing.JLabel JavaDoc();
100         resTypeField = new javax.swing.JTextField JavaDoc();
101         descField = new javax.swing.JTextField JavaDoc();
102         descLabel = new javax.swing.JLabel JavaDoc();
103         jScrollPane1 = new javax.swing.JScrollPane JavaDoc();
104         jTable1 = new javax.swing.JTable JavaDoc();
105         tableButtonsPane = new javax.swing.JPanel JavaDoc();
106         addButton = new javax.swing.JButton JavaDoc();
107         removeButton = new javax.swing.JButton JavaDoc();
108         descriptionTextArea = new javax.swing.JTextArea JavaDoc();
109         jLabel1 = new javax.swing.JLabel JavaDoc();
110
111         setLayout(new java.awt.GridBagLayout JavaDoc());
112
113         getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("TITLE_ConnPoolWizardPanel_properties"));
114         getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("CPPropertyPanel_Description"));
115         jPanel1.setLayout(new java.awt.GridBagLayout JavaDoc());
116
117         classNameField.setText(this.helper.getData().getString(__DatasourceClassname));
118         classNameField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
119             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
120                 classNameFieldActionPerformed(evt);
121             }
122         });
123         classNameField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
124             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
125                 classNameFieldKeyReleased(evt);
126             }
127         });
128
129         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
130         gridBagConstraints.gridx = 1;
131         gridBagConstraints.gridy = 0;
132         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
133         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
134         jPanel1.add(classNameField, gridBagConstraints);
135         classNameField.getAccessibleContext().setAccessibleName(this.helper.getData().getString(__DatasourceClassname));
136         classNameField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_datasource-classnamefieldA11yDesc"));
137
138         classNameLabel.setDisplayedMnemonic(bundle.getString("LBL_datasource-classname_Mnemonic").charAt(0));
139         classNameLabel.setLabelFor(classNameField);
140         classNameLabel.setText(bundle.getString("LBL_datasource-classname"));
141         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
142         gridBagConstraints.gridx = 0;
143         gridBagConstraints.gridy = 0;
144         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
145         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
146         jPanel1.add(classNameLabel, gridBagConstraints);
147         classNameLabel.getAccessibleContext().setAccessibleDescription(bundle.getString("ToolTip_datasource-classname"));
148
149         resTypeLabel.setDisplayedMnemonic(bundle.getString("LBL_res-type_Mnemonic").charAt(0));
150         resTypeLabel.setLabelFor(resTypeField);
151         resTypeLabel.setText(bundle.getString("LBL_res-type"));
152         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
153         gridBagConstraints.gridx = 0;
154         gridBagConstraints.gridy = 1;
155         gridBagConstraints.ipadx = 43;
156         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
157         jPanel1.add(resTypeLabel, gridBagConstraints);
158         resTypeLabel.getAccessibleContext().setAccessibleName(bundle.getString("LBL_res-type"));
159         resTypeLabel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_res-typefieldA11yDesc"));
160
161         resTypeField.setEditable(false);
162         resTypeField.setText("jTextField2");
163         resTypeField.setFocusable(false);
164         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
165         gridBagConstraints.gridx = 1;
166         gridBagConstraints.gridy = 1;
167         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
168         gridBagConstraints.weightx = 1.0;
169         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
170         jPanel1.add(resTypeField, gridBagConstraints);
171         resTypeField.getAccessibleContext().setAccessibleName(bundle.getString("LBL_res-type"));
172         resTypeField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_res-typefieldA11yDesc"));
173
174         descField.addActionListener(new java.awt.event.ActionListener JavaDoc() {
175             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
176                 descFieldActionPerformed(evt);
177             }
178         });
179         descField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
180             public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
181                 descFieldKeyReleased(evt);
182             }
183         });
184
185         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
186         gridBagConstraints.gridx = 1;
187         gridBagConstraints.gridy = 2;
188         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
189         gridBagConstraints.weightx = 1.0;
190         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
191         jPanel1.add(descField, gridBagConstraints);
192
193         descLabel.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_description_Mnemonic").charAt(0));
194         descLabel.setLabelFor(descField);
195         descLabel.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_description"));
196         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
197         gridBagConstraints.gridx = 0;
198         gridBagConstraints.gridy = 2;
199         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
200         gridBagConstraints.ipadx = 49;
201         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 0, 0, 0);
202         jPanel1.add(descLabel, gridBagConstraints);
203         descLabel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_description"));
204         descLabel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("ToolTip_description"));
205
206         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
207         gridBagConstraints.gridx = 0;
208         gridBagConstraints.gridy = 1;
209         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
210         gridBagConstraints.weightx = 1.0;
211         gridBagConstraints.weighty = 1.0;
212         add(jPanel1, gridBagConstraints);
213         jPanel1.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("TITLE_ConnPoolWizardPanel_properties"));
214         jPanel1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("CPPropertyPanel_Description"));
215
216         jScrollPane1.setPreferredSize(new java.awt.Dimension JavaDoc(453, 17));
217         jTable1.setModel(tableModel);
218         jScrollPane1.setViewportView(jTable1);
219         jTable1.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_properties"));
220         jTable1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("ACS_propTableCommon_A11yDesc"));
221
222         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
223         gridBagConstraints.gridx = 0;
224         gridBagConstraints.gridy = 3;
225         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
226         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 12, 10, 11);
227         add(jScrollPane1, gridBagConstraints);
228         jScrollPane1.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_properties"));
229         jScrollPane1.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("ACS_propTableCommon_A11yDesc"));
230
231         tableButtonsPane.setLayout(new java.awt.GridBagLayout JavaDoc());
232
233         addButton.setMnemonic(bundle.getString("LBL_Add_Mnemonic").charAt(0));
234         addButton.setText(bundle.getString("LBL_Add"));
235         addButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
236             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
237                 addButtonActionPerformed(evt);
238             }
239         });
240
241         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
242         gridBagConstraints.gridx = 0;
243         gridBagConstraints.gridy = 0;
244         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
245         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 0, 12);
246         tableButtonsPane.add(addButton, gridBagConstraints);
247         addButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_AddButtonA11yDesc"));
248
249         removeButton.setMnemonic(bundle.getString("LBL_Remove_Mnemonic").charAt(0));
250         removeButton.setText(bundle.getString("LBL_Remove"));
251         removeButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
252             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
253                 removeButtonActionPerformed(evt);
254             }
255         });
256
257         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
258         gridBagConstraints.gridx = 0;
259         gridBagConstraints.gridy = 1;
260         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
261         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 12);
262         tableButtonsPane.add(removeButton, gridBagConstraints);
263         removeButton.getAccessibleContext().setAccessibleName(bundle.getString("LBL_Remove"));
264         removeButton.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RemoveButtonA11yDesc"));
265
266         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
267         gridBagConstraints.gridx = 1;
268         gridBagConstraints.gridy = 2;
269         gridBagConstraints.gridheight = 2;
270         gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
271         gridBagConstraints.ipady = 100;
272         add(tableButtonsPane, gridBagConstraints);
273         tableButtonsPane.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_properties"));
274         tableButtonsPane.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("ACS_propTableCommon_A11yDesc"));
275
276         descriptionTextArea.setEditable(false);
277         descriptionTextArea.setText(bundle.getString("CPPropertyPanel_Description"));
278         descriptionTextArea.setOpaque(false);
279         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
280         gridBagConstraints.gridx = 0;
281         gridBagConstraints.gridy = 0;
282         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
283         gridBagConstraints.weightx = 1.0;
284         gridBagConstraints.weighty = 1.0;
285         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 1, 0);
286         add(descriptionTextArea, gridBagConstraints);
287         descriptionTextArea.getAccessibleContext().setAccessibleName(bundle.getString("CPPropertyPanel_Description"));
288         descriptionTextArea.getAccessibleContext().setAccessibleDescription(bundle.getString("CPPropertyPanel_Description"));
289
290         jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_properties_Mnemonic").charAt(0));
291         jLabel1.setLabelFor(jTable1);
292         jLabel1.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle").getString("LBL_properties"));
293         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
294         gridBagConstraints.gridx = 0;
295         gridBagConstraints.gridy = 2;
296         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
297         add(jLabel1, gridBagConstraints);
298
299     }
300     // </editor-fold>//GEN-END:initComponents
301

302     private void classNameFieldKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_classNameFieldKeyReleased
303
// Add your handling code here:
304
ResourceConfigData data = this.helper.getData();
305         String JavaDoc value = data.getString(__DatasourceClassname);
306         String JavaDoc newValue = classNameField.getText();
307         if (!value.equals(newValue)) {
308             this.helper.getData().setString(__DatasourceClassname, newValue);
309             //fireChange(this);
310
}
311         this.panel.fireChangeEvent(this);
312     }//GEN-LAST:event_classNameFieldKeyReleased
313

314     private void descFieldKeyReleased(java.awt.event.KeyEvent JavaDoc evt) {//GEN-FIRST:event_descFieldKeyReleased
315
// Add your handling code here:
316
ResourceConfigData data = this.helper.getData();
317         String JavaDoc value = data.getString(__Description);
318         String JavaDoc newValue = descField.getText();
319         if (!value.equals(newValue)) {
320             this.helper.getData().setString(__Description, newValue);
321             //fireChange(this);
322
}
323         this.panel.fireChangeEvent(this);
324     }//GEN-LAST:event_descFieldKeyReleased
325

326     private void descFieldActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_descFieldActionPerformed
327
// Add your handling code here:
328
ResourceConfigData data = this.helper.getData();
329         String JavaDoc item = descField.getText();
330         Object JavaDoc value = data.get(__Description);
331         if (!item.equals((String JavaDoc)value)){
332             data.setString(__Description, item);
333         }
334         
335         this.panel.fireChangeEvent(this);
336         if((this.getRootPane().getDefaultButton() != null) && (this.getRootPane().getDefaultButton().isEnabled())){
337             this.getRootPane().getDefaultButton().doClick();
338         }
339     }//GEN-LAST:event_descFieldActionPerformed
340

341     private void classNameFieldActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_classNameFieldActionPerformed
342
// Add your handling code here:
343
ResourceConfigData data = this.helper.getData();
344         String JavaDoc item = classNameField.getText();
345         Object JavaDoc value = data.get(__DatasourceClassname);
346         if (value == null)
347             value = FieldHelper.getDefaultValue(dsField);
348         if (!item.equals((String JavaDoc)value))
349             data.setString(__DatasourceClassname, item);
350         
351         this.panel.fireChangeEvent(this);
352         if((this.getRootPane().getDefaultButton() != null) && (this.getRootPane().getDefaultButton().isEnabled())){
353             this.getRootPane().getDefaultButton().doClick();
354         }
355     }//GEN-LAST:event_classNameFieldActionPerformed
356

357     private void removeButtonActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_removeButtonActionPerformed
358
// Add your handling code here:
359
int selectedRow = jTable1.getSelectedRow();
360         if (selectedRow != -1) {
361             //Fix for bug#4958730 - value overwrites into next row
362
jTable1.editingStopped(new ChangeEvent JavaDoc (this));
363             this.helper.getData().removeProperty(selectedRow);
364             tableModel.fireTableDataChanged();
365         }
366     }//GEN-LAST:event_removeButtonActionPerformed
367

368     private void addButtonActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_addButtonActionPerformed
369
// Add your handling code here:
370
//Fix for bug#4958730 - value overwrites into next row
371
jTable1.editingStopped(new ChangeEvent JavaDoc (this));
372         ResourceConfigData data = this.helper.getData();
373         data.addProperty(new NameValuePair());
374         tableModel.fireTableDataChanged();
375     }//GEN-LAST:event_addButtonActionPerformed
376

377     public void tableChanged(javax.swing.event.TableModelEvent JavaDoc e) {
378          setPropTableCellEditor();
379          this.panel.fireChangeEvent(this);
380     }
381     
382     public void setPropTableCellEditor() {
383         javax.swing.JComboBox JavaDoc propNameComboBox = new javax.swing.JComboBox JavaDoc();
384         String JavaDoc[] remainingProperties = FieldHelper.getRemainingFieldNames(propertiesGroup, this.helper.getData().getPropertyNames());
385         for (int i = 0; i < remainingProperties.length; i++)
386             propNameComboBox.addItem(remainingProperties[i]);
387         
388         this.nameColumn = jTable1.getColumnModel().getColumn(0);
389         propNameComboBox.setEditable(true);
390         this.nameColumn.setCellEditor(new javax.swing.DefaultCellEditor JavaDoc(propNameComboBox));
391         this.valueColumn = jTable1.getColumnModel().getColumn(1);
392                 
393         javax.swing.DefaultCellEditor JavaDoc editor = new javax.swing.DefaultCellEditor JavaDoc(new javax.swing.JTextField JavaDoc());
394         editor.setClickCountToStart(1);
395         this.valueColumn.setCellEditor(editor);
396     }
397     
398      public void refreshFields() {
399         ResourceConfigData data = this.helper.getData();
400         String JavaDoc item = classNameField.getText();
401         String JavaDoc val = data.getString(__DatasourceClassname);
402         if (!item.equals(val))
403             classNameField.setText(val);
404         
405         item = resTypeField.getText();
406         val = data.getString(__ResType);
407         if (!item.equals(val))
408             resTypeField.setText(val);
409         ((PropertiesTableModel)jTable1.getModel()).setData(this.helper.getData());
410     }
411      
412     public void setInitialFocus(){
413         new setFocus(classNameField);
414     }
415     // Variables declaration - do not modify//GEN-BEGIN:variables
416
private javax.swing.JButton JavaDoc addButton;
417     private javax.swing.JTextField JavaDoc classNameField;
418     private javax.swing.JLabel JavaDoc classNameLabel;
419     private javax.swing.JTextField JavaDoc descField;
420     private javax.swing.JLabel JavaDoc descLabel;
421     private javax.swing.JTextArea JavaDoc descriptionTextArea;
422     private javax.swing.JLabel JavaDoc jLabel1;
423     private javax.swing.JPanel JavaDoc jPanel1;
424     private javax.swing.JScrollPane JavaDoc jScrollPane1;
425     private javax.swing.JTable JavaDoc jTable1;
426     private javax.swing.JButton JavaDoc removeButton;
427     private javax.swing.JTextField JavaDoc resTypeField;
428     private javax.swing.JLabel JavaDoc resTypeLabel;
429     private javax.swing.JPanel JavaDoc tableButtonsPane;
430     // End of variables declaration//GEN-END:variables
431
private ResourceBundle JavaDoc bundle = NbBundle.getBundle("org.netbeans.modules.j2ee.sun.ide.sunresources.wizards.Bundle"); //NOI18N
432
private PropertiesTableModel tableModel;
433     private TableColumn JavaDoc nameColumn;
434     private TableColumn JavaDoc valueColumn;
435     
436 }
437
438
Popular Tags