KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > options > general > AdvancedProxyPanel


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-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.options.general;
20
21 import javax.swing.event.DocumentEvent JavaDoc;
22 import javax.swing.event.DocumentListener JavaDoc;
23
24 /**
25  *
26  * @author Jiri Rechtacek
27  */

28 public class AdvancedProxyPanel extends javax.swing.JPanel JavaDoc {
29     private GeneralOptionsModel options;
30     private String JavaDoc oldHttpsHost;
31     private String JavaDoc oldHttpsPort;
32     private String JavaDoc oldSocksHost;
33     private String JavaDoc oldSocksPort;
34     
35     /** Creates new form AdvancedProxyPanel */
36     public AdvancedProxyPanel (GeneralOptionsModel model) {
37         options = model;
38         initComponents ();
39         tfHttpProxyHost.getDocument().addDocumentListener (new DocumentListener JavaDoc () {
40             public void insertUpdate(DocumentEvent JavaDoc arg0) {
41                 followHttpHostIfDemand ();
42             }
43
44             public void removeUpdate(DocumentEvent JavaDoc arg0) {
45                 followHttpHostIfDemand ();
46             }
47
48             public void changedUpdate(DocumentEvent JavaDoc arg0) {
49                 followHttpHostIfDemand ();
50             }
51         });
52         tfHttpProxyPort.getDocument().addDocumentListener (new DocumentListener JavaDoc () {
53             public void insertUpdate(DocumentEvent JavaDoc arg0) {
54                 followHttpPortIfDemand ();
55             }
56
57             public void removeUpdate(DocumentEvent JavaDoc arg0) {
58                 followHttpPortIfDemand ();
59             }
60
61             public void changedUpdate(DocumentEvent JavaDoc arg0) {
62                 followHttpPortIfDemand ();
63             }
64         });
65     }
66     
67     // helps implement OptionsPanelController
68

69     public void update (String JavaDoc httpHost, String JavaDoc httpPort) {
70         readOptions ();
71         
72         if (! options.getHttpProxyHost ().equals (httpHost)) {
73             tfHttpProxyHost.setText (httpHost);
74         }
75         if (! options.getHttpProxyPort ().equals (httpPort)) {
76             tfHttpProxyPort.setText (httpPort);
77         }
78     }
79
80     public void applyChanges() {
81         writeOptions ();
82     }
83
84     // helpers
85

86     private void readOptions () {
87         cbSameProxySettings.setSelected (options.useProxyAllProtocols ());
88         cbUseProxyAuthentication.setSelected(options.useProxyAuthentication ());
89         tfHttpProxyHost.setText (options.getHttpProxyHost ());
90         tfHttpProxyPort.setText (options.getHttpProxyPort ());
91         tfHttpsProxyHost.setText (options.getHttpsProxyHost ());
92         tfHttpsProxyPort.setText (options.getHttpsProxyPort ());
93         tfSocksHost.setText (options.getSocksHost ());
94         tfSocksPort.setText (options.getSocksPort ());
95         tfUserName.setText (options.getProxyAuthenticationUsername ());
96         pfUserPassword.setText (new String JavaDoc (options.getProxyAuthenticationPassword ()));
97         tfNonProxyHosts.setText (options.getNonProxyHosts ());
98         
99         oldHttpsHost = tfHttpsProxyHost.getText ();
100         oldHttpsPort = tfHttpsProxyPort.getText ();
101         oldSocksHost = tfSocksHost.getText ();
102         oldSocksPort = tfSocksPort.getText ();
103         
104         followHttpProxyIfDemand();
105         updateAuthentication ();
106     }
107     
108     private void writeOptions () {
109         options.setUseProxyAllProtocols (cbSameProxySettings.isSelected ());
110         options.setUseProxyAuthentication(cbUseProxyAuthentication.isSelected ());
111         options.setHttpProxyHost (tfHttpProxyHost.getText ());
112         options.setHttpProxyPort (tfHttpProxyPort.getText ());
113         options.setHttpsProxyHost (tfHttpsProxyHost.getText ());
114         options.setHttpsProxyPort (tfHttpsProxyPort.getText ());
115         options.setSocksHost (tfSocksHost.getText ());
116         options.setSocksPort (tfSocksPort.getText ());
117         options.setNonProxyHosts (tfNonProxyHosts.getText ());
118         options.setAuthenticationUsername (tfUserName.getText ());
119         options.setAuthenticationPassword (pfUserPassword.getPassword ());
120     }
121     
122     private void followHttpProxyIfDemand () {
123         boolean same = cbSameProxySettings.isSelected ();
124         tfHttpsProxyHost.setEnabled (! same);
125         tfHttpsProxyPort.setEnabled (! same);
126         tfSocksHost.setEnabled (! same);
127         tfSocksPort.setEnabled (! same);
128         lHttpsProxyHost.setEnabled (! same);
129         lHttpsProxyPort.setEnabled (! same);
130         lSocksHost.setEnabled (! same);
131         lSocksPort.setEnabled (! same);
132         
133         followHttpHostIfDemand ();
134         followHttpPortIfDemand ();
135     }
136     
137     private void updateAuthentication () {
138         boolean use = cbUseProxyAuthentication.isSelected ();
139         tfUserName.setEnabled (use);
140         lUserName.setEnabled (use);
141         pfUserPassword.setEnabled (use);
142         lUserPassword.setEnabled (use);
143     }
144     
145     private void followHttpHostIfDemand () {
146         if (! cbSameProxySettings.isSelected ()) {
147             return ;
148         }
149         String JavaDoc host = tfHttpProxyHost.getText ();
150         tfHttpsProxyHost.setText (host);
151         tfSocksHost.setText (host);
152     }
153     
154     private void followHttpPortIfDemand () {
155         if (! cbSameProxySettings.isSelected ()) {
156             return ;
157         }
158         String JavaDoc port = tfHttpProxyPort.getText ();
159         tfHttpsProxyPort.setText (port);
160         tfSocksPort.setText (port);
161     }
162     
163     /** This method is called from within the constructor to
164      * initialize the form.
165      * WARNING: Do NOT modify this code. The content of this method is
166      * always regenerated by the Form Editor.
167      */

168     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
169
private void initComponents() {
170
171         lHttpProxyHost = new javax.swing.JLabel JavaDoc();
172         tfHttpProxyHost = new javax.swing.JTextField JavaDoc();
173         cbSameProxySettings = new javax.swing.JCheckBox JavaDoc();
174         lHttpsProxyHost = new javax.swing.JLabel JavaDoc();
175         tfHttpsProxyHost = new javax.swing.JTextField JavaDoc();
176         lSocksHost = new javax.swing.JLabel JavaDoc();
177         tfSocksHost = new javax.swing.JTextField JavaDoc();
178         lHttpProxyPort = new javax.swing.JLabel JavaDoc();
179         lHttpsProxyPort = new javax.swing.JLabel JavaDoc();
180         lSocksPort = new javax.swing.JLabel JavaDoc();
181         tfHttpProxyPort = new javax.swing.JTextField JavaDoc();
182         tfHttpsProxyPort = new javax.swing.JTextField JavaDoc();
183         tfSocksPort = new javax.swing.JTextField JavaDoc();
184         lNonProxyHosts = new javax.swing.JLabel JavaDoc();
185         tfNonProxyHosts = new javax.swing.JTextField JavaDoc();
186         lNonProxyHostsDescription = new javax.swing.JLabel JavaDoc();
187         sSeparator = new javax.swing.JSeparator JavaDoc();
188         cbUseProxyAuthentication = new javax.swing.JCheckBox JavaDoc();
189         lUserName = new javax.swing.JLabel JavaDoc();
190         lUserPassword = new javax.swing.JLabel JavaDoc();
191         tfUserName = new javax.swing.JTextField JavaDoc();
192         pfUserPassword = new javax.swing.JPasswordField JavaDoc();
193
194         lHttpProxyHost.setLabelFor(tfHttpProxyHost);
195         org.openide.awt.Mnemonics.setLocalizedText(lHttpProxyHost, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lHttpProxyHost")); // NOI18N
196

197         org.openide.awt.Mnemonics.setLocalizedText(cbSameProxySettings, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_cbSameProxySettings")); // NOI18N
198
cbSameProxySettings.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
199         cbSameProxySettings.setMargin(new java.awt.Insets JavaDoc(0, 0, 0, 0));
200         cbSameProxySettings.addActionListener(new java.awt.event.ActionListener JavaDoc() {
201             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
202                 cbSameProxySettingsActionPerformed(evt);
203             }
204         });
205
206         lHttpsProxyHost.setLabelFor(tfHttpsProxyHost);
207         org.openide.awt.Mnemonics.setLocalizedText(lHttpsProxyHost, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lHttpsProxyHots")); // NOI18N
208

209         lSocksHost.setLabelFor(tfSocksHost);
210         org.openide.awt.Mnemonics.setLocalizedText(lSocksHost, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lSocksHost")); // NOI18N
211

212         lHttpProxyPort.setLabelFor(tfHttpProxyPort);
213         org.openide.awt.Mnemonics.setLocalizedText(lHttpProxyPort, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lHttpProxyPort")); // NOI18N
214

215         lHttpsProxyPort.setLabelFor(tfHttpsProxyPort);
216         org.openide.awt.Mnemonics.setLocalizedText(lHttpsProxyPort, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lHttpsProxyPort")); // NOI18N
217

218         lSocksPort.setLabelFor(tfSocksPort);
219         org.openide.awt.Mnemonics.setLocalizedText(lSocksPort, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lSocksPort")); // NOI18N
220

221         tfHttpProxyPort.setColumns(4);
222
223         tfHttpsProxyPort.setColumns(4);
224
225         tfSocksPort.setColumns(4);
226
227         lNonProxyHosts.setLabelFor(tfNonProxyHosts);
228         org.openide.awt.Mnemonics.setLocalizedText(lNonProxyHosts, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lNonProxyHosts")); // NOI18N
229

230         org.openide.awt.Mnemonics.setLocalizedText(lNonProxyHostsDescription, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lNonProxyHostsDescription")); // NOI18N
231

232         org.openide.awt.Mnemonics.setLocalizedText(cbUseProxyAuthentication, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_cbUseProxyAuthentication")); // NOI18N
233
cbUseProxyAuthentication.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
234         cbUseProxyAuthentication.addActionListener(new java.awt.event.ActionListener JavaDoc() {
235             public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
236                 cbUseProxyAuthenticationActionPerformed(evt);
237             }
238         });
239
240         lUserName.setLabelFor(tfUserName);
241         org.openide.awt.Mnemonics.setLocalizedText(lUserName, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lUserName")); // NOI18N
242

243         lUserPassword.setLabelFor(pfUserPassword);
244         org.openide.awt.Mnemonics.setLocalizedText(lUserPassword, org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "LBL_AdvancedProxyPanel_lUserPassword")); // NOI18N
245

246         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
247         this.setLayout(layout);
248         layout.setHorizontalGroup(
249             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
250             .add(layout.createSequentialGroup()
251                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
252                     .add(layout.createSequentialGroup()
253                         .add(12, 12, 12)
254                         .add(cbUseProxyAuthentication))
255                     .add(layout.createSequentialGroup()
256                         .addContainerGap()
257                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
258                             .add(lUserName)
259                             .add(lUserPassword))
260                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
261                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
262                             .add(pfUserPassword)
263                             .add(tfUserName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)))
264                     .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
265                         .add(layout.createSequentialGroup()
266                             .addContainerGap()
267                             .add(sSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 414, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
268                         .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
269                             .add(12, 12, 12)
270                             .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
271                                 .add(lHttpProxyHost)
272                                 .add(lHttpsProxyHost)
273                                 .add(lSocksHost)
274                                 .add(lNonProxyHosts))
275                             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
276                             .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
277                                 .add(lNonProxyHostsDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 349, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
278                                 .add(cbSameProxySettings, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 325, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
279                                 .add(layout.createSequentialGroup()
280                                     .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
281                                         .add(org.jdesktop.layout.GroupLayout.LEADING, tfHttpProxyHost)
282                                         .add(org.jdesktop.layout.GroupLayout.LEADING, tfSocksHost)
283                                         .add(org.jdesktop.layout.GroupLayout.LEADING, tfHttpsProxyHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 281, Short.MAX_VALUE))
284                                     .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
285                                     .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
286                                         .add(lHttpProxyPort)
287                                         .add(lHttpsProxyPort)
288                                         .add(lSocksPort))
289                                     .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
290                                     .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
291                                         .add(tfHttpProxyPort)
292                                         .add(tfSocksPort)
293                                         .add(tfHttpsProxyPort)))
294                                 .add(tfNonProxyHosts)))))
295                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
296         );
297         layout.setVerticalGroup(
298             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
299             .add(layout.createSequentialGroup()
300                 .addContainerGap()
301                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
302                     .add(lHttpProxyHost)
303                     .add(tfHttpProxyHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
304                     .add(lHttpProxyPort)
305                     .add(tfHttpProxyPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
306                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
307                 .add(cbSameProxySettings)
308                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
309                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
310                     .add(lHttpsProxyHost)
311                     .add(tfHttpsProxyHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
312                     .add(lHttpsProxyPort)
313                     .add(tfHttpsProxyPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
314                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
315                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
316                     .add(lSocksHost)
317                     .add(tfSocksHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
318                     .add(lSocksPort)
319                     .add(tfSocksPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
320                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
321                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
322                     .add(lNonProxyHosts)
323                     .add(tfNonProxyHosts, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
324                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
325                 .add(lNonProxyHostsDescription)
326                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
327                 .add(sSeparator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
328                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
329                 .add(cbUseProxyAuthentication)
330                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
331                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
332                     .add(lUserName)
333                     .add(tfUserName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
334                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
335                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
336                     .add(lUserPassword)
337                     .add(pfUserPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
338                 .addContainerGap(30, Short.MAX_VALUE))
339         );
340
341         tfHttpProxyHost.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfHttpProxyHost")); // NOI18N
342
cbSameProxySettings.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_cbSameProxySettings")); // NOI18N
343
tfHttpsProxyHost.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfHttpsProxyHost")); // NOI18N
344
tfSocksHost.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfSocksHost")); // NOI18N
345
tfHttpProxyPort.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfHttpProxyPort")); // NOI18N
346
tfHttpsProxyPort.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfHttpsProxyPort")); // NOI18N
347
tfSocksPort.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfSocksPort")); // NOI18N
348
tfNonProxyHosts.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfNonProxyHosts")); // NOI18N
349
cbUseProxyAuthentication.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_cbUseProxyAuthentication")); // NOI18N
350
tfUserName.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_tfUserName")); // NOI18N
351
pfUserPassword.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel_pfUserPassword")); // NOI18N
352

353         getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(AdvancedProxyPanel.class, "ACD_AdvancedProxyPanel")); // NOI18N
354
}// </editor-fold>//GEN-END:initComponents
355

356 private void cbUseProxyAuthenticationActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_cbUseProxyAuthenticationActionPerformed
357
updateAuthentication ();
358 }//GEN-LAST:event_cbUseProxyAuthenticationActionPerformed
359

360 private void cbSameProxySettingsActionPerformed(java.awt.event.ActionEvent JavaDoc evt) {//GEN-FIRST:event_cbSameProxySettingsActionPerformed
361
if (cbSameProxySettings.isSelected ()) {
362         oldHttpsHost = tfHttpsProxyHost.getText ();
363         oldHttpsPort = tfHttpsProxyPort.getText ();
364         oldSocksHost = tfSocksHost.getText ();
365         oldSocksPort = tfSocksPort.getText ();
366     } else {
367         tfHttpsProxyHost.setText (oldHttpsHost);
368          tfHttpsProxyPort.setText (oldHttpsPort);
369          tfSocksHost.setText (oldSocksHost);
370          tfSocksPort.setText (oldSocksPort);
371     }
372     followHttpProxyIfDemand ();
373 }//GEN-LAST:event_cbSameProxySettingsActionPerformed
374

375     
376     // Variables declaration - do not modify//GEN-BEGIN:variables
377
private javax.swing.JCheckBox JavaDoc cbSameProxySettings;
378     private javax.swing.JCheckBox JavaDoc cbUseProxyAuthentication;
379     private javax.swing.JLabel JavaDoc lHttpProxyHost;
380     private javax.swing.JLabel JavaDoc lHttpProxyPort;
381     private javax.swing.JLabel JavaDoc lHttpsProxyHost;
382     private javax.swing.JLabel JavaDoc lHttpsProxyPort;
383     private javax.swing.JLabel JavaDoc lNonProxyHosts;
384     private javax.swing.JLabel JavaDoc lNonProxyHostsDescription;
385     private javax.swing.JLabel JavaDoc lSocksHost;
386     private javax.swing.JLabel JavaDoc lSocksPort;
387     private javax.swing.JLabel JavaDoc lUserName;
388     private javax.swing.JLabel JavaDoc lUserPassword;
389     private javax.swing.JPasswordField JavaDoc pfUserPassword;
390     private javax.swing.JSeparator JavaDoc sSeparator;
391     private javax.swing.JTextField JavaDoc tfHttpProxyHost;
392     private javax.swing.JTextField JavaDoc tfHttpProxyPort;
393     private javax.swing.JTextField JavaDoc tfHttpsProxyHost;
394     private javax.swing.JTextField JavaDoc tfHttpsProxyPort;
395     private javax.swing.JTextField JavaDoc tfNonProxyHosts;
396     private javax.swing.JTextField JavaDoc tfSocksHost;
397     private javax.swing.JTextField JavaDoc tfSocksPort;
398     private javax.swing.JTextField JavaDoc tfUserName;
399     // End of variables declaration//GEN-END:variables
400

401 }
402
Popular Tags