KickJava   Java API By Example, From Geeks To Geeks.

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


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  * CommonAttributeVisualPanel.java
21  *
22  * Created on October 10, 2002
23  */

24
25 package org.netbeans.modules.j2ee.sun.ide.sunresources.wizards;
26
27 import org.openide.util.NbBundle;
28
29 import java.util.List JavaDoc;
30 import java.util.ResourceBundle JavaDoc;
31 import javax.swing.*;
32 import javax.swing.event.ChangeListener JavaDoc;
33
34 //import org.netbeans.modules.j2ee.sun.ide.j2ee.ui.Util;
35
import org.netbeans.modules.j2ee.sun.ide.sunresources.beans.ResourceUtils;
36
37 import org.netbeans.modules.j2ee.sun.sunresources.beans.Field;
38 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldGroup;
39 import org.netbeans.modules.j2ee.sun.sunresources.beans.WizardConstants;
40 import org.netbeans.modules.j2ee.sun.sunresources.beans.FieldHelper;
41
42 /** A single panel for a wizard - the GUI portion.
43  *
44  * @author shirleyc
45  */

46 public class CommonAttributeVisualPanel extends javax.swing.JPanel JavaDoc implements ChangeListener JavaDoc, WizardConstants {
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     public static final String JavaDoc TYPE_JDBC_RESOURCE = "_DS"; //NOI18N
53
public static final String JavaDoc TYPE_PERSISTENCE_MANAGER = "_PM"; //NOI18N
54
public static final String JavaDoc TYPE_CP_POOL_SETTING = "_CP_SETTING"; //NOI18N
55

56     protected ResourceBundle JavaDoc bundle = NbBundle.getBundle("org.netbeans.modules.j2ee.sun.ide.sunresources.wizards.Bundle"); //NOI18N
57

58     protected final CommonAttributePanel panel;
59     protected FieldGroup[] groups;
60     protected int fieldSize;
61     protected ResourceConfigHelper helper;
62     protected String JavaDoc panelType = TYPE_JDBC_RESOURCE;
63     protected boolean createNewResource = false;
64     
65     // Variables declaration - general attributes
66
protected javax.swing.JTextArea JavaDoc descriptionTextArea = null;
67     protected javax.swing.JPanel JavaDoc jPanel1[] = null;
68     protected javax.swing.JLabel JavaDoc jLabels[] = null;
69     protected javax.swing.JComponent JavaDoc jFields[] = null;
70     protected Field fields[] = null;
71     protected String JavaDoc resourceName;
72     protected boolean showGroupTitle = false;
73     
74     // Variable declaration - choice
75
private javax.swing.JRadioButton JavaDoc existingResourceRadioButton;
76     private javax.swing.JRadioButton JavaDoc newResourceRadioButton;
77     private javax.swing.JPanel JavaDoc jPanel0;
78     private javax.swing.JComboBox JavaDoc existingResourceComboBox;
79     private boolean firstTime = true;
80     private int y = 0;
81     
82     /** Create the wizard panel and set up some basic properties. */
83     public CommonAttributeVisualPanel(CommonAttributePanel panel, FieldGroup[] groups, String JavaDoc panelType, ResourceConfigHelper helper) {
84         this.firstTime = true;
85         this.panel = panel;
86         this.helper = helper;
87         this.resourceName = panel.getResourceName();
88         setFieldGroups(groups);
89         
90         // Provide a name in the title bar.
91
setName(NbBundle.getMessage(CommonAttributeVisualPanel.class, "TITLE_" + groups[0].getName())); //NOI18N
92

93         if (groups.length > 1)
94             this.showGroupTitle = true;
95         
96         setLayout(new java.awt.GridBagLayout JavaDoc());
97         if (!showGroupTitle) {
98             initDescriptionComponent();
99         }
100             
101         setPanelType(panelType);
102         if (getPanelType().equals(TYPE_JDBC_RESOURCE) || getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {
103             initChoiceComponents();
104             initComponents();
105         } else {
106             initComponents();
107         }
108         getAccessibleContext().setAccessibleName(bundle.getString("TITLE_ConnPoolWizardPanel_optionalProps"));
109         getAccessibleContext().setAccessibleDescription(bundle.getString("TITLE_ConnPoolWizardPanel_optionalProps"));
110         refreshFields();
111         this.firstTime = false;
112     }
113     
114     public void setFieldGroups(FieldGroup[] groups) {
115         this.groups = groups;
116         fieldSize = 0;
117         for (int i = 0; i < groups.length; i++) {
118             fieldSize += groups[i].sizeField();
119         }
120     }
121     
122     /** This method is called from within the constructor to
123      * initialize the form.
124      * WARNING: Do NOT modify this code. The content of this method is
125      * always regenerated by the Form Editor.
126      */

127     private void initComponents() {
128         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
129       
130         int gap = 0;
131         int itemHeight = 28;
132         if (fieldSize < 6) {
133             itemHeight = 42;
134             gap = 7;
135         }
136         int i = 0;
137         jPanel1 = new JPanel[groups.length];
138         fields = new Field[fieldSize];
139         jLabels = new JLabel[fieldSize];
140         jFields = new JComponent[fieldSize];
141       
142       for (int j = 0; j < groups.length; j++) {
143         if (showGroupTitle) {
144             JLabel label = new JLabel();
145             label.setText(bundle.getString("LBL_GROUP_" + groups[j].getName())); //NOI18N
146
label.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_LBL_GROUP_" + groups[j].getName() + "A11yDesc")); //NOI18N
147
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
148             gridBagConstraints.gridx = 0;
149             gridBagConstraints.gridy = this.y; this.y++;
150             gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
151             gridBagConstraints.ipadx = 0;
152             gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 0, 0, 11);
153             add(label, gridBagConstraints);
154         }
155         
156         Field[] flds = groups[j].getField();
157         int size = flds.length;
158         jPanel1[j] = new javax.swing.JPanel JavaDoc();
159         jPanel1[j].setLayout(new java.awt.GridBagLayout JavaDoc());
160         
161         jPanel1[j].setMaximumSize(new java.awt.Dimension JavaDoc(480, itemHeight * size));
162         jPanel1[j].setMinimumSize(new java.awt.Dimension JavaDoc(480, itemHeight * size));
163         jPanel1[j].setPreferredSize(new java.awt.Dimension JavaDoc(480, itemHeight * size));
164         
165         for (int k = 0; k < size; k++) {
166             fields[i] = flds[k];
167             JLabel jLabel = new JLabel();
168             jLabel.setText(bundle.getString("LBL_" + fields[i].getName())); //NOI18N
169
jLabel.setDisplayedMnemonic(bundle.getString("LBL_" + fields[i].getName() + "_Mnemonic").charAt(0)); //NOI18N
170
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
171             gridBagConstraints.gridx = 0;
172             gridBagConstraints.gridy = k;
173             gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
174             gridBagConstraints.ipadx = 0;
175             gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 12, gap, 0);
176             jLabels[i] = jLabel;
177             jPanel1[j].add(jLabels[i], gridBagConstraints);
178             
179             if (FieldHelper.isList(fields[i])) {
180                 JComboBox jComboBox = new JComboBox();
181                 jLabel.setLabelFor(jComboBox);
182                 jComboBox.getAccessibleContext().setAccessibleDescription(bundle.getString("ToolTip_" + fields[i].getName())); //NOI18N
183
String JavaDoc tags[] = FieldHelper.getTags(fields[i]);
184                 for (int h = 0; h < tags.length; h++) {
185                     jComboBox.addItem(tags[h]);
186                 }
187                 final int index = i;
188                 jComboBox.addActionListener(new java.awt.event.ActionListener JavaDoc() {
189                     public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
190                         jComboBoxActionPerformed(evt, index);
191                     }
192                 });
193                 gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
194                 gridBagConstraints.gridx = 1;
195                 gridBagConstraints.gridy = k;
196                 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
197                 gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 20, gap, 0);
198                 gridBagConstraints.weightx = 1.0;
199                 jFields[i] = jComboBox;
200                 jPanel1[j].add(jComboBox, gridBagConstraints);
201             } else {
202                 JTextField jTextField;
203                 if(FieldHelper.isInt(fields[i]))
204                     jTextField = new javax.swing.JTextField JavaDoc(Util.getNumericDocument(), null, 0);
205                 else{
206                     jTextField = new JTextField();
207                     jTextField.setText("jTextField1"); //NOI18N
208
}
209                 jLabel.setLabelFor(jTextField);
210                 jTextField.getAccessibleContext().setAccessibleDescription(bundle.getString("ToolTip_" + fields[i].getName())); //NOI18N
211
jTextField.setToolTipText(bundle.getString("ToolTip_" + fields[i].getName())); //NOI18N
212
jTextField.setMinimumSize(new java.awt.Dimension JavaDoc(340, 21));
213                 jTextField.setPreferredSize(new java.awt.Dimension JavaDoc(340, 21));
214                 final int index = i;
215                 jTextField.addKeyListener(new java.awt.event.KeyAdapter JavaDoc() {
216                     public void keyReleased(java.awt.event.KeyEvent JavaDoc evt) {
217                         jTextField1KeyReleased(evt, index);
218                     }
219                 });
220                 gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
221                 gridBagConstraints.gridx = 1;
222                 gridBagConstraints.gridy = k;
223                 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
224                 gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 20, gap, 0);
225                 jFields[i] = jTextField;
226                 jPanel1[j].add(jTextField, gridBagConstraints);
227             }
228             i++;
229         }
230         
231         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
232         gridBagConstraints.gridx = 0;
233         gridBagConstraints.gridy = this.y; this.y++;
234         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
235         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 0, 10, 11);
236         jPanel1[j].setBorder(new javax.swing.border.EtchedBorder JavaDoc());
237         add(jPanel1[j], gridBagConstraints);
238       }
239     }
240     
241     private void initDescriptionComponent() {
242         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
243         descriptionTextArea = new javax.swing.JTextArea JavaDoc();
244         descriptionTextArea.setEditable(false);
245         descriptionTextArea.setFont(javax.swing.UIManager.getFont("Label.font")); //NOI18N
246
descriptionTextArea.setText(bundle.getString(this.resourceName + "_Description")); //NOI18N
247
descriptionTextArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground")); //NOI18N
248
descriptionTextArea.setRequestFocusEnabled(false);
249         descriptionTextArea.setEnabled(false);
250         descriptionTextArea.setOpaque(false);
251         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
252         gridBagConstraints.gridx = 0;
253         gridBagConstraints.gridy = this.y; this.y++;
254         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
255         gridBagConstraints.weightx = 1.0;
256         gridBagConstraints.weighty = 0.0;
257         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 20, 11);
258         add(descriptionTextArea, gridBagConstraints);
259     }
260     
261     private void jComboBoxActionPerformed(java.awt.event.ActionEvent JavaDoc evt, int index) {
262         ResourceConfigData data = this.helper.getData();
263         String JavaDoc item = (String JavaDoc)((JComboBox)jFields[index]).getSelectedItem();
264         String JavaDoc fieldName = fields[index].getName();
265         String JavaDoc val = data.getString(fieldName);
266         if (!item.equals(val))
267             data.setString(fieldName, item);
268     }
269     
270     private void jTextField1KeyReleased(java.awt.event.KeyEvent JavaDoc evt, int index) {
271         ResourceConfigData data = this.helper.getData();
272         String JavaDoc item = (String JavaDoc)((JTextField)jFields[index]).getText();
273         String JavaDoc fieldName = fields[index].getName();
274         String JavaDoc val = data.getString(fieldName);
275         /*if (FieldHelper.isInt(fields[index])) {
276             try {
277                 Integer.parseInt(item);
278             } catch (NumberFormatException ex) {
279                 JOptionPane.showMessageDialog(this, bundle.getString("MSG_NotNumber")); //NOI18N
280                 if (val == null || val.length() == 0)
281                 val = FieldHelper.getDefaultValue(fields[index]);
282                 ((JTextField)jFields[index]).setText(val);
283                 return;
284             }
285         }*/

286         
287         String JavaDoc jLabel = (String JavaDoc)this.jLabels[index].getText();
288         if (!item.equals(val)) {
289             data.setString(fieldName, item);
290             //panel.fireChangeEvent();
291
}
292         panel.fireChange(this);
293     }
294     
295     // initialize button group for choosing JDBC Connection Pool or JDBC Resource
296
private void initChoiceComponents() {
297         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
298
299         jPanel0 = new javax.swing.JPanel JavaDoc();
300         ButtonGroup bg = new ButtonGroup();
301         existingResourceRadioButton = new javax.swing.JRadioButton JavaDoc();
302         existingResourceComboBox = new javax.swing.JComboBox JavaDoc();
303         newResourceRadioButton = new javax.swing.JRadioButton JavaDoc();
304
305         jPanel0.setMaximumSize(new java.awt.Dimension JavaDoc(480, 150));
306         jPanel0.setMinimumSize(new java.awt.Dimension JavaDoc(480, 150));
307         jPanel0.setPreferredSize(new java.awt.Dimension JavaDoc(480, 150));
308         jPanel0.setLayout(new java.awt.GridBagLayout JavaDoc());
309
310         jPanel0.setBorder(new javax.swing.border.EtchedBorder JavaDoc());
311         existingResourceRadioButton.setSelected(true);
312         existingResourceRadioButton.setText(bundle.getString("ExistingResource" + getPanelType())); //NOI18N
313
existingResourceRadioButton.setToolTipText(bundle.getString("ACS_ExistingResourceA11yDesc" + getPanelType())); //NOI18N
314
existingResourceRadioButton.setMnemonic(bundle.getString("ExistingResource_Default_Mnemonic").charAt(0)); //NOI18N
315
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
316         gridBagConstraints.gridx = 0;
317         gridBagConstraints.gridy = 1;
318         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
319         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 11);
320         jPanel0.add(existingResourceRadioButton, gridBagConstraints);
321
322         existingResourceComboBox.setToolTipText(bundle.getString("ACS_ExistingResourceComboBoxA11yDesc" + getPanelType()));
323         existingResourceComboBox.getAccessibleContext().setAccessibleName(bundle.getString("ExistingResource" + getPanelType())); //NOI18N
324
existingResourceComboBox.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_ExistingResourceComboBoxA11yDesc" + getPanelType()));
325         existingResourceComboBox.addActionListener(new java.awt.event.ActionListener JavaDoc() {
326             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
327                 existingResourceComboBoxActionPerformed(evt);
328             }
329         });
330
331         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
332         gridBagConstraints.gridx = 0;
333         gridBagConstraints.gridy = 2;
334         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
335         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 24, 5, 11);
336         jPanel0.add(existingResourceComboBox, gridBagConstraints);
337
338         newResourceRadioButton.setText(bundle.getString("NewResource" + getPanelType())); //NOI18N
339
newResourceRadioButton.setToolTipText(bundle.getString("ACS_NewResourceA11yDesc" + getPanelType())); //NOI18N
340
newResourceRadioButton.setMnemonic(bundle.getString("NewResource_Default_Mnemonic").charAt(0)); //NOI18N
341
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
342         gridBagConstraints.gridx = 0;
343         gridBagConstraints.gridy = 3;
344         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
345         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 11);
346         jPanel0.add(newResourceRadioButton, gridBagConstraints);
347
348         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
349         gridBagConstraints.gridx = 0;
350         gridBagConstraints.gridy = this.y; this.y++;
351         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
352         gridBagConstraints.weightx = 1.0;
353         gridBagConstraints.weighty = 0.0;
354         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 0, 40, 0);
355         add(jPanel0, gridBagConstraints);
356         
357         bg.add(existingResourceRadioButton);
358         bg.add(newResourceRadioButton);
359         bg.getSelection().addChangeListener(this);
360         
361         List JavaDoc list = null;
362         if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {
363             list = ResourceUtils.getRegisteredConnectionPools(this.helper.getData());
364         }else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {
365             list = ResourceUtils.getRegisteredJdbcResources(this.helper.getData());
366         }
367         if(list != null){
368             for (int i = 0; i < list.size(); i++) {
369                 existingResourceComboBox.addItem(list.get(i));
370             }
371         }
372         
373         if (existingResourceComboBox.getItemCount() == 0) {
374             existingResourceComboBox.insertItemAt(bundle.getString("NoResource" + getPanelType()), 0); //NOI18N
375
existingResourceRadioButton.setEnabled(true);
376             existingResourceComboBox.setEnabled(true);
377         } else {
378             existingResourceComboBox.insertItemAt(bundle.getString("SelectFromTheList"), 0); //NOI18N
379
existingResourceRadioButton.setSelected(true);
380             newResourceRadioButton.setSelected(false);
381         }
382         existingResourceComboBox.setSelectedIndex(0);
383     }
384     
385     public void stateChanged(final javax.swing.event.ChangeEvent JavaDoc p1) {
386         if (p1.getSource().getClass() == javax.swing.JToggleButton.ToggleButtonModel.class) {
387             if (existingResourceRadioButton.isSelected()) {
388                 existingResourceComboBox.setEnabled(true);
389                 setExistingResourceData();
390             } else {
391                 existingResourceComboBox.setEnabled(false);
392                 setNewResourceData();
393             }
394             
395             if (!firstTime) {
396                 panel.fireChange(this);
397             }
398         }
399     }
400     
401     private void existingResourceComboBoxActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
402         setExistingResourceData();
403     }
404     
405     public boolean isNewResourceSelected() {
406         return createNewResource;
407     }
408     
409     public void setExistingResourceData() {
410         ResourceConfigData data = this.helper.getData();
411         if(existingResourceComboBox.getSelectedIndex() > 0) {
412             String JavaDoc name = existingResourceComboBox.getSelectedItem().toString();
413             if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {
414                 data.setString(__PoolName, name);
415             }else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {
416                 data.setString(__JdbcResourceJndiName, name);
417             }
418         }else{
419             if (!firstTime) {
420                 if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {
421                     data.setString(__PoolName, ""); //NOI18N
422
}else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {
423                     data.setString(__JdbcResourceJndiName, ""); //NOI18N
424
}
425             }
426         }
427         if (!firstTime) {
428             panel.fireChange(this);
429         }
430         createNewResource = false;
431     }
432     
433     public void setNewResourceData() {
434         createNewResource = true;
435     }
436     
437     public void refreshFields() {
438         ResourceConfigData data = this.helper.getData();
439         for (int i = 0; i < jFields.length; i++) {
440             String JavaDoc item;
441             if (FieldHelper.isList(fields[i])) {
442                 item = (String JavaDoc)((JComboBox)jFields[i]).getSelectedItem();
443             } else {
444                 item = (String JavaDoc)((JTextField)jFields[i]).getText();
445             }
446             String JavaDoc fieldName = fields[i].getName();
447             Object JavaDoc value = data.get(fieldName);
448             if (value == null) {
449                 value = FieldHelper.getDefaultValue(fields[i]);
450                 if(fieldName.equals("jndi-name")){ //NOI18N
451
String JavaDoc helperJndiName = data.getTargetFile();
452                     if(helperJndiName != null){
453                         if(getPanelType().equals(TYPE_JDBC_RESOURCE) || getPanelType().equals(TYPE_PERSISTENCE_MANAGER)){
454                             value = value + helperJndiName;
455                         }
456                     }
457                 }
458                 data.set(fieldName, value);
459             }
460             String JavaDoc val = (String JavaDoc)value;
461             if (!item.equals(val)) {
462                 if (FieldHelper.isList(fields[i])) {
463                     ((JComboBox)jFields[i]).setSelectedItem(val);
464                 } else {
465                     ((JTextField)jFields[i]).setText(val);
466                 }
467             }
468          }
469          if (getPanelType().equals(TYPE_JDBC_RESOURCE)) {
470              Object JavaDoc selPool = (Object JavaDoc)data.getString(__PoolName);
471              existingResourceComboBox.setSelectedItem(selPool);
472          }else if (getPanelType().equals(TYPE_PERSISTENCE_MANAGER)) {
473              Object JavaDoc selJDBC = (Object JavaDoc)data.getString(__JdbcResourceJndiName);
474              existingResourceComboBox.setSelectedItem(selJDBC);
475          }
476     }
477        
478     public CommonAttributeVisualPanel setFirstTime(boolean first) {
479         this.firstTime = first;
480         return this;
481     }
482     
483     public void initData() {
484         refreshFields();
485     }
486     
487     protected String JavaDoc getPanelType() {
488         return panelType;
489     }
490     
491     protected void setPanelType(String JavaDoc type) {
492         this.panelType = type;
493     }
494     
495     public void setInitialFocus(){
496        new setFocus(this.existingResourceRadioButton);
497     }
498     
499     public void setPropInitialFocus(){
500        new setFocus(jFields[0]);
501     }
502     
503     public void setHelper(ResourceConfigHelper helper){
504         this.helper = helper;
505         this.helper.getData().setString("jndi-name", helper.getData().getTargetFile()); //NOI18N
506
refreshFields();
507     }
508 }
509
Popular Tags