KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > db > explorer > dlg > NewConnectionPanel


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 package org.netbeans.modules.db.explorer.dlg;
21 import java.awt.BorderLayout JavaDoc;
22 import java.util.List JavaDoc;
23 import java.util.ResourceBundle JavaDoc;
24 import javax.swing.JComponent JavaDoc;
25 import javax.swing.SwingUtilities JavaDoc;
26
27 import javax.swing.event.DocumentListener JavaDoc;
28 import javax.swing.event.ListDataListener JavaDoc;
29
30 import org.netbeans.modules.db.explorer.DatabaseConnection;
31 import org.netbeans.api.db.explorer.JDBCDriver;
32 import org.netbeans.api.db.explorer.JDBCDriverManager;
33 import org.netbeans.api.progress.ProgressHandle;
34 import org.netbeans.api.progress.ProgressHandleFactory;
35 import org.netbeans.modules.db.util.DatabaseExplorerInternalUIs;
36 import org.netbeans.modules.db.util.DriverListUtil;
37
38 import org.openide.util.NbBundle;
39
40 public class NewConnectionPanel extends ConnectionDialog.FocusablePanel implements DocumentListener JavaDoc, ListDataListener JavaDoc {
41
42     private ConnectionDialogMediator mediator;
43     // private Vector templates;
44
private DatabaseConnection connection;
45     private ProgressHandle progressHandle;
46     private JComponent JavaDoc progressComponent;
47
48     private static final String JavaDoc BUNDLE = "org.netbeans.modules.db.resources.Bundle"; //NOI18N
49

50     public NewConnectionPanel(ConnectionDialogMediator mediator, String JavaDoc driverClass, DatabaseConnection connection) {
51         this.mediator = mediator;
52         this.connection = connection;
53         initComponents();
54         initAccessibility();
55         
56         DatabaseExplorerInternalUIs.connect(templateComboBox, JDBCDriverManager.getDefault(), driverClass);
57         
58         ConnectionProgressListener progressListener = new ConnectionProgressListener() {
59             public void connectionStarted() {
60                 startProgress();
61             }
62             
63             public void connectionStep(String JavaDoc step) {
64                 setProgressMessage(step);
65             }
66
67             public void connectionFinished() {
68                 stopProgress(true);
69             }
70
71             public void connectionFailed() {
72                 stopProgress(false);
73             }
74         };
75         mediator.addConnectionProgressListener(progressListener);
76         
77         driverTextField.setText(connection.getDriver());
78         urlComboBox.setSelectedItem(connection.getDatabase());
79         userTextField.setText(connection.getUser());
80         passwordField.setText(connection.getPassword());
81
82         String JavaDoc driver = connection.getDriver();
83         String JavaDoc driverName = connection.getDriverName();
84         if (driver != null && driverName != null) {
85             for (int i = 0; i < templateComboBox.getItemCount(); i++) {
86                 Object JavaDoc item = templateComboBox.getItemAt(i);
87                 if (item instanceof JDBCDriver) {
88                     JDBCDriver dbDriver = (JDBCDriver)item;
89                     if (dbDriver.getClassName().equals(driver) && dbDriver.getName().equals(driverName)) {
90                         templateComboBox.setSelectedIndex(i);
91                         break;
92                     }
93                 }
94             }
95         }
96
97         driverTextField.getDocument().addDocumentListener(this);
98         userTextField.getDocument().addDocumentListener(this);
99         passwordField.getDocument().addDocumentListener(this);
100         templateComboBox.getModel().addListDataListener(this);
101         urlComboBox.getModel().addListDataListener(this);
102
103         checkValid();
104     }
105
106     private void initAccessibility() {
107         ResourceBundle JavaDoc b = NbBundle.getBundle(BUNDLE);
108         templateLabel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_NewConnectionDriverNameA11yDesc")); //NOI18N
109
templateComboBox.getAccessibleContext().setAccessibleName(b.getString("ACS_NewConnectionDriverNameComboBoxA11yName")); //NOI18N
110
driverLabel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_NewConnectionDriverClassA11yDesc")); //NOI18N
111
driverTextField.getAccessibleContext().setAccessibleName(b.getString("ACS_NewConnectionDriverClassComboBoxA11yName")); //NOI18N
112
urlLabel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_NewConnectionDatabaseURLA11yDesc")); //NOI18N
113
urlComboBox.getAccessibleContext().setAccessibleName(b.getString("ACS_NewConnectionDatabaseURLTextFieldA11yName")); //NOI18N
114
userLabel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_NewConnectionUserNameA11yDesc")); //NOI18N
115
userTextField.getAccessibleContext().setAccessibleName(b.getString("ACS_NewConnectionUserNameTextFieldA11yName")); //NOI18N
116
passwordLabel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_NewConnectionPasswordA11yDesc")); //NOI18N
117
passwordField.getAccessibleContext().setAccessibleName(b.getString("ACS_NewConnectionPasswordTextFieldA11yName")); //NOI18N
118
connectProgressPanel.getAccessibleContext().setAccessibleName(b.getString("ACS_ConnectionProgressBarA11yName")); //NOI18N
119
connectProgressPanel.getAccessibleContext().setAccessibleDescription(b.getString("ACS_ConnectionProgressBarA11yDesc")); //NOI18N
120
}
121
122     public void initializeFocus() {
123         getInitiallyFocusedComponent().requestFocusInWindow();
124     }
125
126     private JComponent JavaDoc getInitiallyFocusedComponent() {
127         if (templateComboBox.getItemCount() <= 1) { // the first item is "Add Driver...""
128
return templateComboBox;
129         }
130         if (connection.getDatabase().length() == 0) {
131             return urlComboBox;
132         }
133         if (userTextField.getText().length() == 0) {
134             return userTextField;
135         }
136         if (passwordField.getPassword().length == 0) {
137             return passwordField;
138         }
139         // fall back to the URL field
140
return urlComboBox;
141     }
142
143     /** This method is called from within the constructor to
144      * initialize the form.
145      * WARNING: Do NOT modify this code. The content of this method is
146      * always regenerated by the Form Editor.
147      */

148     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
149
private void initComponents() {
150         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
151
152         templateLabel = new javax.swing.JLabel JavaDoc();
153         templateComboBox = new javax.swing.JComboBox JavaDoc();
154         driverLabel = new javax.swing.JLabel JavaDoc();
155         driverTextField = new javax.swing.JTextField JavaDoc();
156         urlLabel = new javax.swing.JLabel JavaDoc();
157         urlComboBox = new javax.swing.JComboBox JavaDoc();
158         userLabel = new javax.swing.JLabel JavaDoc();
159         userTextField = new javax.swing.JTextField JavaDoc();
160         passwordLabel = new javax.swing.JLabel JavaDoc();
161         passwordField = new javax.swing.JPasswordField JavaDoc();
162         passwordCheckBox = new javax.swing.JCheckBox JavaDoc();
163         jPanel1 = new javax.swing.JPanel JavaDoc();
164         connectProgressPanel = new javax.swing.JPanel JavaDoc();
165         progressMessageLabel = new javax.swing.JLabel JavaDoc();
166         progressContainerPanel = new javax.swing.JPanel JavaDoc();
167
168         FormListener formListener = new FormListener();
169
170         setLayout(new java.awt.GridBagLayout JavaDoc());
171
172         templateLabel.setLabelFor(templateComboBox);
173         org.openide.awt.Mnemonics.setLocalizedText(templateLabel, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionDriverName")); // NOI18N
174
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
175         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
176         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
177         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 0);
178         add(templateLabel, gridBagConstraints);
179
180         templateComboBox.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_NewConnectionDriverNameComboBoxA11yDesc")); // NOI18N
181
templateComboBox.addItemListener(formListener);
182         templateComboBox.addActionListener(formListener);
183         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
184         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
185         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 5, 0, 11);
186         add(templateComboBox, gridBagConstraints);
187
188         driverLabel.setLabelFor(driverTextField);
189         org.openide.awt.Mnemonics.setLocalizedText(driverLabel, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionDriverClass")); // NOI18N
190
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
191         gridBagConstraints.gridx = 0;
192         gridBagConstraints.gridy = 1;
193         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
194         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
195         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
196         add(driverLabel, gridBagConstraints);
197
198         driverTextField.setColumns(50);
199         driverTextField.setEditable(false);
200         driverTextField.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_NewConnectionDriverClassComboBoxA11yDesc")); // NOI18N
201
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
202         gridBagConstraints.gridx = 1;
203         gridBagConstraints.gridy = 1;
204         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
205         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 11);
206         add(driverTextField, gridBagConstraints);
207
208         urlLabel.setLabelFor(urlComboBox);
209         org.openide.awt.Mnemonics.setLocalizedText(urlLabel, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionDatabaseURL")); // NOI18N
210
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
211         gridBagConstraints.gridx = 0;
212         gridBagConstraints.gridy = 2;
213         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
214         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
215         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
216         add(urlLabel, gridBagConstraints);
217
218         urlComboBox.setEditable(true);
219         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
220         gridBagConstraints.gridx = 1;
221         gridBagConstraints.gridy = 2;
222         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
223         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 11);
224         add(urlComboBox, gridBagConstraints);
225
226         userLabel.setLabelFor(userTextField);
227         org.openide.awt.Mnemonics.setLocalizedText(userLabel, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionUserName")); // NOI18N
228
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
229         gridBagConstraints.gridx = 0;
230         gridBagConstraints.gridy = 3;
231         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
232         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
233         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
234         add(userLabel, gridBagConstraints);
235
236         userTextField.setColumns(50);
237         userTextField.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_NewConnectionUserNameTextFieldA11yDesc")); // NOI18N
238
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
239         gridBagConstraints.gridx = 1;
240         gridBagConstraints.gridy = 3;
241         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
242         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 11);
243         add(userTextField, gridBagConstraints);
244
245         passwordLabel.setLabelFor(passwordField);
246         org.openide.awt.Mnemonics.setLocalizedText(passwordLabel, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionPassword")); // NOI18N
247
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
248         gridBagConstraints.gridx = 0;
249         gridBagConstraints.gridy = 4;
250         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
251         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
252         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 12, 0, 0);
253         add(passwordLabel, gridBagConstraints);
254
255         passwordField.setColumns(50);
256         passwordField.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_NewConnectionPasswordTextFieldA11yDesc")); // NOI18N
257
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
258         gridBagConstraints.gridx = 1;
259         gridBagConstraints.gridy = 4;
260         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
261         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 11);
262         add(passwordField, gridBagConstraints);
263
264         org.openide.awt.Mnemonics.setLocalizedText(passwordCheckBox, NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("NewConnectionRememberPassword")); // NOI18N
265
passwordCheckBox.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_NewConnectionRememberPasswordA11yDesc")); // NOI18N
266
gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
267         gridBagConstraints.gridx = 1;
268         gridBagConstraints.gridy = 5;
269         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
270         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
271         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 0, 11);
272         add(passwordCheckBox, gridBagConstraints);
273         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
274         gridBagConstraints.gridy = 6;
275         gridBagConstraints.gridwidth = 2;
276         gridBagConstraints.weightx = 1.0;
277         gridBagConstraints.weighty = 1.0;
278         add(jPanel1, gridBagConstraints);
279
280         connectProgressPanel.setToolTipText(NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle").getString("ACS_ConnectionProgressBarA11yDesc")); // NOI18N
281
connectProgressPanel.setLayout(new java.awt.BorderLayout JavaDoc(0, 5));
282
283         org.openide.awt.Mnemonics.setLocalizedText(progressMessageLabel, " ");
284         connectProgressPanel.add(progressMessageLabel, java.awt.BorderLayout.NORTH);
285
286         progressContainerPanel.setMinimumSize(new java.awt.Dimension JavaDoc(20, 20));
287         progressContainerPanel.setPreferredSize(new java.awt.Dimension JavaDoc(20, 20));
288         progressContainerPanel.setLayout(new java.awt.BorderLayout JavaDoc());
289         connectProgressPanel.add(progressContainerPanel, java.awt.BorderLayout.CENTER);
290
291         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
292         gridBagConstraints.gridx = 0;
293         gridBagConstraints.gridy = 7;
294         gridBagConstraints.gridwidth = 2;
295         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
296         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 11, 11);
297         add(connectProgressPanel, gridBagConstraints);
298     }
299
300     // Code for dispatching events from components to event handlers.
301

302     private class FormListener implements java.awt.event.ActionListener JavaDoc, java.awt.event.ItemListener JavaDoc {
303         FormListener() {}
304         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
305             if (evt.getSource() == templateComboBox) {
306                 NewConnectionPanel.this.templateComboBoxActionPerformed(evt);
307             }
308         }
309
310         public void itemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {
311             if (evt.getSource() == templateComboBox) {
312                 NewConnectionPanel.this.templateComboBoxItemStateChanged(evt);
313             }
314         }
315     }// </editor-fold>//GEN-END:initComponents
316

317     private void templateComboBoxItemStateChanged(java.awt.event.ItemEvent JavaDoc evt) {//GEN-FIRST:event_templateComboBoxItemStateChanged
318
checkValid();
319     }//GEN-LAST:event_templateComboBoxItemStateChanged
320

321     private void templateComboBoxActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_templateComboBoxActionPerformed
322
Object JavaDoc item = templateComboBox.getSelectedItem();
323         if (!(item instanceof JDBCDriver)) {
324             return;
325         }
326         JDBCDriver drv = (JDBCDriver)item;
327         List JavaDoc urls = null;
328         String JavaDoc driver = null;
329         if (drv != null) {
330            driver = drv.getClassName();
331            urls = DriverListUtil.getURLs(driver);
332         }
333         
334         urlComboBox.removeAllItems();
335         if (!connection.getDatabase().equals("")) // NOI18N
336
urlComboBox.addItem(connection.getDatabase());
337         else if (urls != null)
338             for (int i = 0; i < urls.size(); i++)
339                 urlComboBox.addItem((String JavaDoc) urls.get(i));
340         
341         if (driver != null)
342            driverTextField.setText(driver);
343     }//GEN-LAST:event_templateComboBoxActionPerformed
344

345
346     // Variables declaration - do not modify//GEN-BEGIN:variables
347
private javax.swing.JPanel JavaDoc connectProgressPanel;
348     private javax.swing.JLabel JavaDoc driverLabel;
349     private javax.swing.JTextField JavaDoc driverTextField;
350     private javax.swing.JPanel JavaDoc jPanel1;
351     private javax.swing.JCheckBox JavaDoc passwordCheckBox;
352     private javax.swing.JPasswordField JavaDoc passwordField;
353     private javax.swing.JLabel JavaDoc passwordLabel;
354     private javax.swing.JPanel JavaDoc progressContainerPanel;
355     private javax.swing.JLabel JavaDoc progressMessageLabel;
356     private javax.swing.JComboBox JavaDoc templateComboBox;
357     private javax.swing.JLabel JavaDoc templateLabel;
358     private javax.swing.JComboBox JavaDoc urlComboBox;
359     private javax.swing.JLabel JavaDoc urlLabel;
360     private javax.swing.JLabel JavaDoc userLabel;
361     private javax.swing.JTextField JavaDoc userTextField;
362     // End of variables declaration//GEN-END:variables
363

364     private JDBCDriver getSelectedDriver() {
365         Object JavaDoc item = templateComboBox.getSelectedItem();
366         if (item instanceof JDBCDriver) {
367             return (JDBCDriver)item;
368         }
369         return null;
370     }
371     
372     public void setConnectionInfo() {
373         JDBCDriver driver = getSelectedDriver();
374         if (driver != null) {
375             connection.setDriverName(driver.getName());
376             connection.setDriver(driver.getClassName());
377         }
378         // issue 86967: using getEditor().getItem() instead of getSelectedItem()
379
// because the it may happen that the user hasn't pressed Enter yet when this method is called
380
connection.setDatabase(urlComboBox.getEditor().getItem().toString());
381         connection.setUser(userTextField.getText());
382         connection.setPassword(getPassword());
383         connection.setRememberPassword(passwordCheckBox.isSelected());
384     }
385
386     private String JavaDoc getPassword() {
387         String JavaDoc password;
388         String JavaDoc tempPassword = new String JavaDoc(passwordField.getPassword());
389         if (tempPassword.length() > 0)
390             password = tempPassword;
391         else
392             password = null;
393
394         return password;
395     }
396
397     public String JavaDoc getTitle() {
398         return NbBundle.getBundle(BUNDLE).getString("NewConnectionDialogTitle"); //NOI18N
399
}
400
401     private void startProgress() {
402         SwingUtilities.invokeLater(new Runnable JavaDoc() {
403             public void run() {
404                 progressHandle = ProgressHandleFactory.createHandle(null);
405                 progressComponent = ProgressHandleFactory.createProgressComponent(progressHandle);
406                 progressContainerPanel.add(progressComponent, BorderLayout.CENTER);
407                 progressHandle.start();
408                 progressMessageLabel.setText(NbBundle.getBundle(BUNDLE).getString("ConnectionProgress_Connecting"));
409             }
410         });
411     }
412     
413     private void setProgressMessage(final String JavaDoc message) {
414         SwingUtilities.invokeLater(new Runnable JavaDoc() {
415             public void run() {
416                 progressMessageLabel.setText(message);
417             }
418         });
419     }
420
421     private void stopProgress(final boolean connected) {
422         SwingUtilities.invokeLater(new Runnable JavaDoc() {
423             public void run() {
424                 progressHandle.finish();
425                 progressContainerPanel.remove(progressComponent);
426                 // without this, the removed progress component remains painted on its parent... why?
427
progressContainerPanel.repaint();
428                 if (connected) {
429                     progressMessageLabel.setText(NbBundle.getBundle(BUNDLE).getString("ConnectionProgress_Established"));
430                 } else {
431                     progressMessageLabel.setText(NbBundle.getBundle(BUNDLE).getString("ConnectionProgress_Failed"));
432                 }
433             }
434         });
435     }
436     
437     private void resetProgress() {
438         progressMessageLabel.setText(""); // NOI18N
439
}
440     
441     public void changedUpdate(javax.swing.event.DocumentEvent JavaDoc e) {
442         fireChange();
443     }
444
445     public void insertUpdate(javax.swing.event.DocumentEvent JavaDoc e) {
446         fireChange();
447     }
448
449     public void removeUpdate(javax.swing.event.DocumentEvent JavaDoc e) {
450         fireChange();
451     }
452
453     public void contentsChanged(javax.swing.event.ListDataEvent JavaDoc e) {
454         fireChange();
455     }
456
457     public void intervalAdded(javax.swing.event.ListDataEvent JavaDoc e) {
458         fireChange();
459     }
460
461     public void intervalRemoved(javax.swing.event.ListDataEvent JavaDoc e) {
462         fireChange();
463     }
464
465     private void fireChange() {
466         firePropertyChange("argumentChanged", null, null);
467         resetProgress();
468     }
469     
470     private void checkValid() {
471         mediator.setValid(getSelectedDriver() != null);
472     }
473 }
474
Popular Tags