001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.db.explorer.dlg;
043:
044: import java.awt.BorderLayout;
045: import java.util.List;
046: import java.util.ResourceBundle;
047: import javax.swing.JComponent;
048: import javax.swing.SwingUtilities;
049:
050: import javax.swing.event.DocumentListener;
051: import javax.swing.event.ListDataListener;
052:
053: import org.netbeans.modules.db.explorer.DatabaseConnection;
054: import org.netbeans.api.db.explorer.JDBCDriver;
055: import org.netbeans.api.db.explorer.JDBCDriverManager;
056: import org.netbeans.api.progress.ProgressHandle;
057: import org.netbeans.api.progress.ProgressHandleFactory;
058: import org.netbeans.modules.db.util.DatabaseExplorerInternalUIs;
059: import org.netbeans.modules.db.util.DriverListUtil;
060:
061: import org.openide.util.NbBundle;
062:
063: public class NewConnectionPanel extends ConnectionDialog.FocusablePanel
064: implements DocumentListener, ListDataListener {
065:
066: private ConnectionDialogMediator mediator;
067: // private Vector templates;
068: private DatabaseConnection connection;
069: private ProgressHandle progressHandle;
070: private JComponent progressComponent;
071:
072: private static final String BUNDLE = "org.netbeans.modules.db.resources.Bundle"; //NOI18N
073:
074: public NewConnectionPanel(ConnectionDialogMediator mediator,
075: String driverClass, DatabaseConnection connection) {
076: this .mediator = mediator;
077: this .connection = connection;
078: initComponents();
079: initAccessibility();
080:
081: DatabaseExplorerInternalUIs.connect(templateComboBox,
082: JDBCDriverManager.getDefault(), driverClass);
083:
084: ConnectionProgressListener progressListener = new ConnectionProgressListener() {
085: public void connectionStarted() {
086: startProgress();
087: }
088:
089: public void connectionStep(String step) {
090: setProgressMessage(step);
091: }
092:
093: public void connectionFinished() {
094: stopProgress(true);
095: }
096:
097: public void connectionFailed() {
098: stopProgress(false);
099: }
100: };
101: mediator.addConnectionProgressListener(progressListener);
102:
103: driverTextField.setText(connection.getDriver());
104: urlComboBox.setSelectedItem(connection.getDatabase());
105: userTextField.setText(connection.getUser());
106: passwordField.setText(connection.getPassword());
107:
108: String driver = connection.getDriver();
109: String driverName = connection.getDriverName();
110: if (driver != null && driverName != null) {
111: for (int i = 0; i < templateComboBox.getItemCount(); i++) {
112: Object item = templateComboBox.getItemAt(i);
113: if (item instanceof JDBCDriver) {
114: JDBCDriver dbDriver = (JDBCDriver) item;
115: if (dbDriver.getClassName().equals(driver)
116: && dbDriver.getName().equals(driverName)) {
117: templateComboBox.setSelectedIndex(i);
118: break;
119: }
120: }
121: }
122: }
123:
124: driverTextField.getDocument().addDocumentListener(this );
125: userTextField.getDocument().addDocumentListener(this );
126: passwordField.getDocument().addDocumentListener(this );
127: templateComboBox.getModel().addListDataListener(this );
128: urlComboBox.getModel().addListDataListener(this );
129:
130: checkValid();
131: }
132:
133: private void initAccessibility() {
134: ResourceBundle b = NbBundle.getBundle(BUNDLE);
135: templateLabel.getAccessibleContext().setAccessibleDescription(
136: b.getString("ACS_NewConnectionDriverNameA11yDesc")); //NOI18N
137: templateComboBox
138: .getAccessibleContext()
139: .setAccessibleName(
140: b
141: .getString("ACS_NewConnectionDriverNameComboBoxA11yName")); //NOI18N
142: driverLabel.getAccessibleContext().setAccessibleDescription(
143: b.getString("ACS_NewConnectionDriverClassA11yDesc")); //NOI18N
144: driverTextField
145: .getAccessibleContext()
146: .setAccessibleName(
147: b
148: .getString("ACS_NewConnectionDriverClassComboBoxA11yName")); //NOI18N
149: urlLabel.getAccessibleContext().setAccessibleDescription(
150: b.getString("ACS_NewConnectionDatabaseURLA11yDesc")); //NOI18N
151: urlComboBox
152: .getAccessibleContext()
153: .setAccessibleName(
154: b
155: .getString("ACS_NewConnectionDatabaseURLTextFieldA11yName")); //NOI18N
156: userLabel.getAccessibleContext().setAccessibleDescription(
157: b.getString("ACS_NewConnectionUserNameA11yDesc")); //NOI18N
158: userTextField
159: .getAccessibleContext()
160: .setAccessibleName(
161: b
162: .getString("ACS_NewConnectionUserNameTextFieldA11yName")); //NOI18N
163: passwordLabel.getAccessibleContext().setAccessibleDescription(
164: b.getString("ACS_NewConnectionPasswordA11yDesc")); //NOI18N
165: passwordField
166: .getAccessibleContext()
167: .setAccessibleName(
168: b
169: .getString("ACS_NewConnectionPasswordTextFieldA11yName")); //NOI18N
170: connectProgressPanel.getAccessibleContext().setAccessibleName(
171: b.getString("ACS_ConnectionProgressBarA11yName")); //NOI18N
172: connectProgressPanel
173: .getAccessibleContext()
174: .setAccessibleDescription(
175: b
176: .getString("ACS_ConnectionProgressBarA11yDesc")); //NOI18N
177: }
178:
179: public void initializeFocus() {
180: getInitiallyFocusedComponent().requestFocusInWindow();
181: }
182:
183: private JComponent getInitiallyFocusedComponent() {
184: if (templateComboBox.getItemCount() <= 1) { // the first item is "Add Driver...""
185: return templateComboBox;
186: }
187: if (connection.getDatabase().length() == 0) {
188: return urlComboBox;
189: }
190: if (userTextField.getText().length() == 0) {
191: return userTextField;
192: }
193: if (passwordField.getPassword().length == 0) {
194: return passwordField;
195: }
196: // fall back to the URL field
197: return urlComboBox;
198: }
199:
200: /** This method is called from within the constructor to
201: * initialize the form.
202: * WARNING: Do NOT modify this code. The content of this method is
203: * always regenerated by the Form Editor.
204: */
205: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
206: private void initComponents() {
207: java.awt.GridBagConstraints gridBagConstraints;
208:
209: templateLabel = new javax.swing.JLabel();
210: templateComboBox = new javax.swing.JComboBox();
211: driverLabel = new javax.swing.JLabel();
212: driverTextField = new javax.swing.JTextField();
213: urlLabel = new javax.swing.JLabel();
214: urlComboBox = new javax.swing.JComboBox();
215: userLabel = new javax.swing.JLabel();
216: userTextField = new javax.swing.JTextField();
217: passwordLabel = new javax.swing.JLabel();
218: passwordField = new javax.swing.JPasswordField();
219: passwordCheckBox = new javax.swing.JCheckBox();
220: jPanel1 = new javax.swing.JPanel();
221: connectProgressPanel = new javax.swing.JPanel();
222: progressMessageLabel = new javax.swing.JLabel();
223: progressContainerPanel = new javax.swing.JPanel();
224:
225: FormListener formListener = new FormListener();
226:
227: setLayout(new java.awt.GridBagLayout());
228:
229: templateLabel.setLabelFor(templateComboBox);
230: org.openide.awt.Mnemonics.setLocalizedText(templateLabel,
231: NbBundle.getBundle(
232: "org.netbeans.modules.db.resources.Bundle")
233: .getString("NewConnectionDriverName")); // NOI18N
234: gridBagConstraints = new java.awt.GridBagConstraints();
235: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
236: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
237: gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 0);
238: add(templateLabel, gridBagConstraints);
239:
240: templateComboBox.setToolTipText(NbBundle.getBundle(
241: "org.netbeans.modules.db.resources.Bundle").getString(
242: "ACS_NewConnectionDriverNameComboBoxA11yDesc")); // NOI18N
243: templateComboBox.addItemListener(formListener);
244: templateComboBox.addActionListener(formListener);
245: gridBagConstraints = new java.awt.GridBagConstraints();
246: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
247: gridBagConstraints.insets = new java.awt.Insets(12, 5, 0, 11);
248: add(templateComboBox, gridBagConstraints);
249:
250: driverLabel.setLabelFor(driverTextField);
251: org.openide.awt.Mnemonics.setLocalizedText(driverLabel,
252: NbBundle.getBundle(
253: "org.netbeans.modules.db.resources.Bundle")
254: .getString("NewConnectionDriverClass")); // NOI18N
255: gridBagConstraints = new java.awt.GridBagConstraints();
256: gridBagConstraints.gridx = 0;
257: gridBagConstraints.gridy = 1;
258: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
259: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
260: gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
261: add(driverLabel, gridBagConstraints);
262:
263: driverTextField.setColumns(50);
264: driverTextField.setEditable(false);
265: driverTextField.setToolTipText(NbBundle.getBundle(
266: "org.netbeans.modules.db.resources.Bundle").getString(
267: "ACS_NewConnectionDriverClassComboBoxA11yDesc")); // NOI18N
268: gridBagConstraints = new java.awt.GridBagConstraints();
269: gridBagConstraints.gridx = 1;
270: gridBagConstraints.gridy = 1;
271: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
272: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 11);
273: add(driverTextField, gridBagConstraints);
274:
275: urlLabel.setLabelFor(urlComboBox);
276: org.openide.awt.Mnemonics.setLocalizedText(urlLabel, NbBundle
277: .getBundle("org.netbeans.modules.db.resources.Bundle")
278: .getString("NewConnectionDatabaseURL")); // NOI18N
279: gridBagConstraints = new java.awt.GridBagConstraints();
280: gridBagConstraints.gridx = 0;
281: gridBagConstraints.gridy = 2;
282: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
283: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
284: gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
285: add(urlLabel, gridBagConstraints);
286:
287: urlComboBox.setEditable(true);
288: gridBagConstraints = new java.awt.GridBagConstraints();
289: gridBagConstraints.gridx = 1;
290: gridBagConstraints.gridy = 2;
291: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
292: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 11);
293: add(urlComboBox, gridBagConstraints);
294:
295: userLabel.setLabelFor(userTextField);
296: org.openide.awt.Mnemonics.setLocalizedText(userLabel, NbBundle
297: .getBundle("org.netbeans.modules.db.resources.Bundle")
298: .getString("NewConnectionUserName")); // NOI18N
299: gridBagConstraints = new java.awt.GridBagConstraints();
300: gridBagConstraints.gridx = 0;
301: gridBagConstraints.gridy = 3;
302: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
303: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
304: gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
305: add(userLabel, gridBagConstraints);
306:
307: userTextField.setColumns(50);
308: userTextField.setToolTipText(NbBundle.getBundle(
309: "org.netbeans.modules.db.resources.Bundle").getString(
310: "ACS_NewConnectionUserNameTextFieldA11yDesc")); // NOI18N
311: gridBagConstraints = new java.awt.GridBagConstraints();
312: gridBagConstraints.gridx = 1;
313: gridBagConstraints.gridy = 3;
314: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
315: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 11);
316: add(userTextField, gridBagConstraints);
317:
318: passwordLabel.setLabelFor(passwordField);
319: org.openide.awt.Mnemonics.setLocalizedText(passwordLabel,
320: NbBundle.getBundle(
321: "org.netbeans.modules.db.resources.Bundle")
322: .getString("NewConnectionPassword")); // NOI18N
323: gridBagConstraints = new java.awt.GridBagConstraints();
324: gridBagConstraints.gridx = 0;
325: gridBagConstraints.gridy = 4;
326: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
327: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
328: gridBagConstraints.insets = new java.awt.Insets(5, 12, 0, 0);
329: add(passwordLabel, gridBagConstraints);
330:
331: passwordField.setColumns(50);
332: passwordField.setToolTipText(NbBundle.getBundle(
333: "org.netbeans.modules.db.resources.Bundle").getString(
334: "ACS_NewConnectionPasswordTextFieldA11yDesc")); // NOI18N
335: gridBagConstraints = new java.awt.GridBagConstraints();
336: gridBagConstraints.gridx = 1;
337: gridBagConstraints.gridy = 4;
338: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
339: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 11);
340: add(passwordField, gridBagConstraints);
341:
342: org.openide.awt.Mnemonics.setLocalizedText(passwordCheckBox,
343: NbBundle.getBundle(
344: "org.netbeans.modules.db.resources.Bundle")
345: .getString("NewConnectionRememberPassword")); // NOI18N
346: passwordCheckBox.setToolTipText(NbBundle.getBundle(
347: "org.netbeans.modules.db.resources.Bundle").getString(
348: "ACS_NewConnectionRememberPasswordA11yDesc")); // NOI18N
349: passwordCheckBox
350: .setVerticalTextPosition(javax.swing.SwingConstants.TOP);
351: gridBagConstraints = new java.awt.GridBagConstraints();
352: gridBagConstraints.gridx = 1;
353: gridBagConstraints.gridy = 5;
354: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
355: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
356: gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 11);
357: add(passwordCheckBox, gridBagConstraints);
358: gridBagConstraints = new java.awt.GridBagConstraints();
359: gridBagConstraints.gridy = 6;
360: gridBagConstraints.gridwidth = 2;
361: gridBagConstraints.weightx = 1.0;
362: gridBagConstraints.weighty = 1.0;
363: add(jPanel1, gridBagConstraints);
364:
365: connectProgressPanel.setToolTipText(NbBundle.getBundle(
366: "org.netbeans.modules.db.resources.Bundle").getString(
367: "ACS_ConnectionProgressBarA11yDesc")); // NOI18N
368: connectProgressPanel.setLayout(new java.awt.BorderLayout(0, 5));
369:
370: org.openide.awt.Mnemonics.setLocalizedText(
371: progressMessageLabel, " ");
372: connectProgressPanel.add(progressMessageLabel,
373: java.awt.BorderLayout.NORTH);
374:
375: progressContainerPanel.setMinimumSize(new java.awt.Dimension(
376: 20, 20));
377: progressContainerPanel.setPreferredSize(new java.awt.Dimension(
378: 20, 20));
379: progressContainerPanel.setLayout(new java.awt.BorderLayout());
380: connectProgressPanel.add(progressContainerPanel,
381: java.awt.BorderLayout.CENTER);
382:
383: gridBagConstraints = new java.awt.GridBagConstraints();
384: gridBagConstraints.gridx = 0;
385: gridBagConstraints.gridy = 7;
386: gridBagConstraints.gridwidth = 2;
387: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
388: gridBagConstraints.insets = new java.awt.Insets(12, 12, 11, 11);
389: add(connectProgressPanel, gridBagConstraints);
390: }
391:
392: // Code for dispatching events from components to event handlers.
393:
394: private class FormListener implements
395: java.awt.event.ActionListener, java.awt.event.ItemListener {
396: FormListener() {
397: }
398:
399: public void actionPerformed(java.awt.event.ActionEvent evt) {
400: if (evt.getSource() == templateComboBox) {
401: NewConnectionPanel.this
402: .templateComboBoxActionPerformed(evt);
403: }
404: }
405:
406: public void itemStateChanged(java.awt.event.ItemEvent evt) {
407: if (evt.getSource() == templateComboBox) {
408: NewConnectionPanel.this
409: .templateComboBoxItemStateChanged(evt);
410: }
411: }
412: }// </editor-fold>//GEN-END:initComponents
413:
414: private void templateComboBoxItemStateChanged(
415: java.awt.event.ItemEvent evt) {//GEN-FIRST:event_templateComboBoxItemStateChanged
416: checkValid();
417: }//GEN-LAST:event_templateComboBoxItemStateChanged
418:
419: private void templateComboBoxActionPerformed(
420: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_templateComboBoxActionPerformed
421: Object item = templateComboBox.getSelectedItem();
422: if (!(item instanceof JDBCDriver)) {
423: return;
424: }
425: JDBCDriver drv = (JDBCDriver) item;
426: List urls = null;
427: String driver = null;
428: if (drv != null) {
429: driver = drv.getClassName();
430: urls = DriverListUtil.getURLs(driver);
431: }
432:
433: urlComboBox.removeAllItems();
434: if (!connection.getDatabase().equals("")) // NOI18N
435: urlComboBox.addItem(connection.getDatabase());
436: else if (urls != null)
437: for (int i = 0; i < urls.size(); i++)
438: urlComboBox.addItem((String) urls.get(i));
439:
440: if (driver != null)
441: driverTextField.setText(driver);
442: }//GEN-LAST:event_templateComboBoxActionPerformed
443:
444: // Variables declaration - do not modify//GEN-BEGIN:variables
445: private javax.swing.JPanel connectProgressPanel;
446: private javax.swing.JLabel driverLabel;
447: private javax.swing.JTextField driverTextField;
448: private javax.swing.JPanel jPanel1;
449: private javax.swing.JCheckBox passwordCheckBox;
450: private javax.swing.JPasswordField passwordField;
451: private javax.swing.JLabel passwordLabel;
452: private javax.swing.JPanel progressContainerPanel;
453: private javax.swing.JLabel progressMessageLabel;
454: private javax.swing.JComboBox templateComboBox;
455: private javax.swing.JLabel templateLabel;
456: private javax.swing.JComboBox urlComboBox;
457: private javax.swing.JLabel urlLabel;
458: private javax.swing.JLabel userLabel;
459: private javax.swing.JTextField userTextField;
460:
461: // End of variables declaration//GEN-END:variables
462:
463: private JDBCDriver getSelectedDriver() {
464: Object item = templateComboBox.getSelectedItem();
465: if (item instanceof JDBCDriver) {
466: return (JDBCDriver) item;
467: }
468: return null;
469: }
470:
471: public void setConnectionInfo() {
472: JDBCDriver driver = getSelectedDriver();
473: if (driver != null) {
474: connection.setDriverName(driver.getName());
475: connection.setDriver(driver.getClassName());
476: }
477: // issue 86967: using getEditor().getItem() instead of getSelectedItem()
478: // because the it may happen that the user hasn't pressed Enter yet when this method is called
479: connection.setDatabase(urlComboBox.getEditor().getItem()
480: .toString());
481: connection.setUser(userTextField.getText());
482: connection.setPassword(getPassword());
483: connection.setRememberPassword(passwordCheckBox.isSelected());
484: }
485:
486: private String getPassword() {
487: String password;
488: String tempPassword = new String(passwordField.getPassword());
489: if (tempPassword.length() > 0)
490: password = tempPassword;
491: else
492: password = null;
493:
494: return password;
495: }
496:
497: public String getTitle() {
498: return NbBundle.getBundle(BUNDLE).getString(
499: "NewConnectionDialogTitle"); //NOI18N
500: }
501:
502: private void startProgress() {
503: SwingUtilities.invokeLater(new Runnable() {
504: public void run() {
505: progressHandle = ProgressHandleFactory
506: .createHandle(null);
507: progressComponent = ProgressHandleFactory
508: .createProgressComponent(progressHandle);
509: progressContainerPanel.add(progressComponent,
510: BorderLayout.CENTER);
511: progressHandle.start();
512: progressMessageLabel.setText(NbBundle.getBundle(BUNDLE)
513: .getString("ConnectionProgress_Connecting"));
514: }
515: });
516: }
517:
518: private void setProgressMessage(final String message) {
519: SwingUtilities.invokeLater(new Runnable() {
520: public void run() {
521: progressMessageLabel.setText(message);
522: }
523: });
524: }
525:
526: private void stopProgress(final boolean connected) {
527: SwingUtilities.invokeLater(new Runnable() {
528: public void run() {
529: progressHandle.finish();
530: progressContainerPanel.remove(progressComponent);
531: // without this, the removed progress component remains painted on its parent... why?
532: progressContainerPanel.repaint();
533: if (connected) {
534: progressMessageLabel.setText(NbBundle.getBundle(
535: BUNDLE).getString(
536: "ConnectionProgress_Established"));
537: } else {
538: progressMessageLabel.setText(NbBundle.getBundle(
539: BUNDLE).getString(
540: "ConnectionProgress_Failed"));
541: }
542: }
543: });
544: }
545:
546: private void resetProgress() {
547: progressMessageLabel.setText(""); // NOI18N
548: }
549:
550: public void changedUpdate(javax.swing.event.DocumentEvent e) {
551: fireChange();
552: }
553:
554: public void insertUpdate(javax.swing.event.DocumentEvent e) {
555: fireChange();
556: }
557:
558: public void removeUpdate(javax.swing.event.DocumentEvent e) {
559: fireChange();
560: }
561:
562: public void contentsChanged(javax.swing.event.ListDataEvent e) {
563: fireChange();
564: }
565:
566: public void intervalAdded(javax.swing.event.ListDataEvent e) {
567: fireChange();
568: }
569:
570: public void intervalRemoved(javax.swing.event.ListDataEvent e) {
571: fireChange();
572: }
573:
574: private void fireChange() {
575: firePropertyChange("argumentChanged", null, null);
576: resetProgress();
577: }
578:
579: private void checkValid() {
580: mediator.setValid(getSelectedDriver() != null);
581: }
582: }
|