This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 75856
Collapse All | Expand All

(-)editor/options/src/org/netbeans/modules/options/general/Bundle.properties (-1 / +18 lines)
Lines 64-70 Link Here
64
Confirm_Delete=&Confirm Delete:
64
Confirm_Delete=&Confirm Delete:
65
CTL_Web_Proxy=Web Proxy:
65
CTL_Web_Proxy=Web Proxy:
66
CTL_Proxy_Settings=Proxy
66
CTL_Proxy_Settings=Proxy
67
CTL_Proxy_Port=Po&rt\:
67
CTL_Proxy_Port=P&ort\:
68
CTL_Proxy_Host=HTTP Pro&xy\:
68
CTL_Proxy_Host=HTTP Pro&xy\:
69
Code_Folding=Code Folding:
69
Code_Folding=Code Folding:
70
Show=Show:
70
Show=Show:
Lines 79-84 Link Here
79
Fold_JavaDoc=Fold &Javadoc Comments
79
Fold_JavaDoc=Fold &Javadoc Comments
80
Fold_Licence=F&old Initial Comment
80
Fold_Licence=F&old Initial Comment
81
Auto_Popup=Auto Popup:
81
Auto_Popup=Auto Popup:
82
CTL_ProxyDetailsName=Proxy Details
82
Auto_Popup_Completion=Completion Window
83
Auto_Popup_Completion=Completion Window
83
Auto_Popup_JavaDoc=Javadoc Window
84
Auto_Popup_JavaDoc=Javadoc Window
84
CTL_Update_every_startup=Every Startup
85
CTL_Update_every_startup=Every Startup
Lines 103-105 Link Here
103
CTL_Non_Proxy=No Prox&y For\:
104
CTL_Non_Proxy=No Prox&y For\:
104
105
105
Non_Proxy_Hint=(e.g. localhost, *.netbeans.org, *.mydomain.com)
106
Non_Proxy_Hint=(e.g. localhost, *.netbeans.org, *.mydomain.com)
107
108
CTL_SocksHost=SO&CKS Host
109
CTL_SocksPort=Po&rt\:
110
111
CTL_UseAuthentication=&Use authentication
112
113
CTL_AuthUser=User&name\:
114
CTL_AuthPwd=&Password\:
115
116
ProxyDetailsDialog.tfAuthUser.text=
117
118
ProxyDetailsDialog.pfAuthPwd.text=
119
120
CTL_ProxyDetails=De&tails...
121
AN_ProxyDetails=N/A
122
AD_ProxyDetails=N/A
(-)editor/options/src/org/netbeans/modules/options/general/GeneralOptionsModel.java (-37 / +59 lines)
Lines 25-105 Link Here
25
import java.util.Iterator;
25
import java.util.Iterator;
26
import java.util.List;
26
import java.util.List;
27
import java.util.Map;
27
import java.util.Map;
28
import java.util.prefs.Preferences;
28
import javax.swing.text.EditorKit;
29
import javax.swing.text.EditorKit;
29
import org.netbeans.core.IDESettings;
30
import org.netbeans.core.IDESettings;
31
import org.netbeans.core.ProxySettings;
30
import org.netbeans.editor.BaseKit;
32
import org.netbeans.editor.BaseKit;
31
import org.netbeans.modules.autoupdate.Settings;
33
import org.netbeans.modules.autoupdate.Settings;
32
import org.netbeans.modules.editor.options.AllOptionsFolder;
34
import org.netbeans.modules.editor.options.AllOptionsFolder;
33
import org.netbeans.modules.editor.options.BaseOptions;
35
import org.netbeans.modules.editor.options.BaseOptions;
34
import org.openide.util.Lookup;
36
import org.openide.util.Lookup;
37
import org.openide.util.NbPreferences;
35
38
36
39
37
class GeneralOptionsModel {
40
class GeneralOptionsModel {
38
    
41
    
39
    
42
    
43
    private static Preferences getPreferences() {
44
        return NbPreferences.root ().node ("org/netbeans/core");
45
    }
46
    
40
    int getProxyType () {
47
    int getProxyType () {
41
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
48
        return getPreferences ().getInt (ProxySettings.PROXY_TYPE, ProxySettings.AUTO_DETECT_PROXY);
42
            (IDESettings.class, true);
43
        if (ideSettings.getProxyType () == IDESettings.DIRECT_CONNECTION)
44
            return 0;
45
        if (ideSettings.getProxyType () == IDESettings.AUTO_DETECT_PROXY)
46
            return 1;
47
        return 2;
48
    }
49
    }
49
    
50
    
50
    void setProxyType (int proxyType) {
51
    void setProxyType (int proxyType) {
51
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
52
        getPreferences  ().putInt (ProxySettings.PROXY_TYPE, proxyType);
52
            (IDESettings.class, true);
53
        switch (proxyType) {
54
            case 0:
55
                ideSettings.setProxyType (IDESettings.DIRECT_CONNECTION);
56
                break;
57
            case 1:
58
                ideSettings.setProxyType (IDESettings.AUTO_DETECT_PROXY);
59
                break;
60
            default:
61
                ideSettings.setProxyType (IDESettings.MANUAL_SET_PROXY);
62
        }
63
    }
53
    }
64
    
54
    
65
    String getProxyHost () {
55
    String getProxyHost () {
66
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
56
        return ProxySettings.getHttpHost ();
67
            (IDESettings.class, true);
68
        return ideSettings.getUserProxyHost ();
69
    }
57
    }
70
    
58
    
71
    void setProxyHost (String proxyHost) {
59
    void setProxyHost (String proxyHost) {
72
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
60
        getPreferences ().put (ProxySettings.CUSTOM_HTTP_HOST, proxyHost);
73
            (IDESettings.class, true);
74
        ideSettings.setUserProxyHost (proxyHost);
75
    }
61
    }
76
    
62
    
77
    int getProxyPort () {
63
    int getProxyPort () {
78
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
79
            (IDESettings.class, true);
80
        try {
64
        try {
81
            return Integer.parseInt (ideSettings.getUserProxyPort ());
65
            return Integer.parseInt (ProxySettings.getHttpPort ());
82
        } catch (NumberFormatException ex) {
66
        } catch (NumberFormatException ex) {
83
            return -1;
67
            return -1;
84
        }
68
        }
85
    }
69
    }
86
    
70
    
87
    void setProxyPort (int proxyPort) {
71
    void setProxyPort (int proxyPort) {
88
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
72
        getPreferences ().put (ProxySettings.CUSTOM_HTTP_PORT, "" + proxyPort);
89
            (IDESettings.class, true);
73
    }
90
        ideSettings.setUserProxyPort ("" + proxyPort);
74
    
75
    String getSocksHost () {
76
        return ProxySettings.getSocksHost ();
77
    }
78
    
79
    void setSocksHost (String socksHost) {
80
        getPreferences ().put (ProxySettings.CUSTOM_SOCKS_HOST, socksHost);
81
    }
82
    
83
    int getSocksPort () {
84
        try {
85
            return Integer.parseInt (ProxySettings.getSocksPort ());
86
        } catch (NumberFormatException ex) {
87
            return -1;
88
        }
89
    }
90
    
91
    void setSocksPort (int socksPort) {
92
        getPreferences ().put (ProxySettings.CUSTOM_SOCKS_PORT, "" + socksPort);
91
    }
93
    }
92
    
94
    
93
    String getUserNonProxy () {
95
    String getUserNonProxy () {
94
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
96
        return code2view (ProxySettings.getNonProxyHosts ());
95
            (IDESettings.class, true);
96
        return code2view (ideSettings.getUserNonProxyHosts ());
97
    }
97
    }
98
    
98
    
99
    void setUserNonProxy (String nonProxy) {
99
    void setUserNonProxy (String nonProxy) {
100
        IDESettings ideSettings = (IDESettings) IDESettings.findObject 
100
        getPreferences ().put (ProxySettings.NOT_PROXY_HOSTS, view2code (nonProxy));
101
            (IDESettings.class, true);
101
    }
102
        ideSettings.setUserNonProxyHosts (view2code (nonProxy));
102
    
103
    boolean useProxyAuthentication () {
104
        return ProxySettings.useAuthentication ();
105
    }
106
    
107
    void setUseProxyAuthentication (boolean use) {
108
        getPreferences ().putBoolean (ProxySettings.USE_PROXY_AUTHENTICATION, use);
109
    }
110
    
111
    String getProxyAuthenticationUsername () {
112
        return ProxySettings.getAuthenticationUsername ();
113
    }
114
    
115
    void setAuthenticationUsername (String username) {
116
        getPreferences ().put (ProxySettings.PROXY_AUTHENTICATION_USERNAME, username);
117
    }
118
    
119
    char [] getProxyAuthenticationPassword () {
120
        return ProxySettings.getAuthenticationPassword ();
121
    }
122
    
123
    void setAuthenticationPassword (char [] password) {
124
        getPreferences ().put (ProxySettings.PROXY_AUTHENTICATION_PASSWORD, new String (password));
103
    }
125
    }
104
    
126
    
105
    boolean getAutoUpdateAskBeforeCheck () {
127
    boolean getAutoUpdateAskBeforeCheck () {
(-)editor/options/src/org/netbeans/modules/options/general/GeneralOptionsPanel.form (-75 / +147 lines)
Lines 13-60 Link Here
13
  <Layout>
13
  <Layout>
14
    <DimensionLayout dim="0">
14
    <DimensionLayout dim="0">
15
      <Group type="103" groupAlignment="0" attributes="0">
15
      <Group type="103" groupAlignment="0" attributes="0">
16
          <Group type="102" attributes="0">
17
              <EmptySpace min="-2" max="-2" attributes="0"/>
18
              <Component id="lWebProxy" min="-2" max="-2" attributes="0"/>
19
              <EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
20
              <Group type="103" groupAlignment="0" attributes="0">
21
                  <Component id="rbList" alignment="0" min="-2" max="-2" attributes="0"/>
22
                  <Component id="rbTree" alignment="0" min="-2" pref="420" max="-2" attributes="0"/>
23
                  <Component id="cbWebBrowser" alignment="0" min="-2" pref="444" max="-2" attributes="0"/>
24
                  <Component id="rbUseSystemProxy" alignment="0" min="-2" max="-2" attributes="0"/>
25
                  <Component id="rbNoProxy" alignment="0" min="-2" max="-2" attributes="0"/>
26
                  <Component id="rbHTTPProxy" alignment="0" min="-2" max="-2" attributes="0"/>
27
                  <Component id="cbCheckPeriod" alignment="0" min="-2" pref="444" max="-2" attributes="2"/>
28
                  <Component id="cbAskBeforeCheck" alignment="0" min="-2" pref="40" max="-2" attributes="0"/>
29
                  <Group type="102" attributes="0">
30
                      <Group type="103" groupAlignment="0" attributes="0">
31
                          <Component id="lProxyHost" alignment="0" min="-2" max="-2" attributes="0"/>
32
                          <Component id="lNonProxyHosts" alignment="0" min="-2" max="-2" attributes="0"/>
33
                      </Group>
34
                      <EmptySpace min="-2" max="-2" attributes="0"/>
35
                      <Group type="103" groupAlignment="0" attributes="0">
36
                          <Group type="102" attributes="0">
37
                              <Component id="tfProxyHost" pref="228" max="32767" attributes="2"/>
38
                              <EmptySpace min="-2" max="-2" attributes="0"/>
39
                              <Component id="lProxyPort" min="-2" max="-2" attributes="0"/>
40
                              <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
41
                              <Component id="tfProxyPort" min="-2" pref="62" max="-2" attributes="1"/>
42
                          </Group>
43
                          <Component id="tfNonProxyHosts" pref="341" max="32767" attributes="2"/>
44
                          <Component id="lNonProxyHostsHint" alignment="0" min="-2" max="-2" attributes="0"/>
45
                      </Group>
46
                  </Group>
47
              </Group>
48
              <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
49
          </Group>
50
          <Group type="102" alignment="0" attributes="0">
51
              <EmptySpace min="12" pref="12" max="12" attributes="0"/>
52
              <Component id="lAskBeforeCheck" min="-2" max="-2" attributes="0"/>
53
          </Group>
54
          <Group type="102" alignment="0" attributes="0">
55
              <EmptySpace min="12" pref="12" max="12" attributes="0"/>
56
              <Component id="lCheckPeriod" min="-2" max="-2" attributes="0"/>
57
          </Group>
58
          <Group type="102" alignment="0" attributes="0">
16
          <Group type="102" alignment="0" attributes="0">
59
              <EmptySpace min="12" pref="12" max="12" attributes="0"/>
17
              <EmptySpace min="12" pref="12" max="12" attributes="0"/>
60
              <Component id="lViewJavaPackagesAs" min="-2" max="-2" attributes="0"/>
18
              <Component id="lViewJavaPackagesAs" min="-2" max="-2" attributes="0"/>
Lines 65-75 Link Here
65
          </Group>
23
          </Group>
66
          <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
24
          <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
67
              <Group type="102" alignment="0" attributes="1">
25
              <Group type="102" alignment="0" attributes="1">
68
                  <Component id="lAutoUpdate" min="-2" max="-2" attributes="0"/>
69
                  <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
70
                  <Component id="jSeparator3" max="32767" attributes="2"/>
71
              </Group>
72
              <Group type="102" alignment="0" attributes="1">
73
                  <Component id="lProxy" min="-2" max="-2" attributes="0"/>
26
                  <Component id="lProxy" min="-2" max="-2" attributes="0"/>
74
                  <EmptySpace max="-2" attributes="0"/>
27
                  <EmptySpace max="-2" attributes="0"/>
75
                  <Component id="jSeparator2" max="32767" attributes="2"/>
28
                  <Component id="jSeparator2" max="32767" attributes="2"/>
Lines 80-85 Link Here
80
                  <Component id="jSeparator1" min="-2" pref="570" max="-2" attributes="2"/>
33
                  <Component id="jSeparator1" min="-2" pref="570" max="-2" attributes="2"/>
81
              </Group>
34
              </Group>
82
          </Group>
35
          </Group>
36
          <Group type="102" alignment="1" attributes="0">
37
              <EmptySpace min="-2" pref="166" max="-2" attributes="0"/>
38
              <Component id="lNonProxyHosts" min="-2" max="-2" attributes="0"/>
39
              <EmptySpace min="-2" max="-2" attributes="0"/>
40
              <Group type="103" groupAlignment="0" attributes="0">
41
                  <Component id="tfNonProxyHosts" pref="372" max="32767" attributes="2"/>
42
                  <Component id="lNonProxyHostsHint" alignment="0" min="-2" max="-2" attributes="0"/>
43
              </Group>
44
              <EmptySpace max="-2" attributes="0"/>
45
          </Group>
46
          <Group type="102" alignment="0" attributes="0">
47
              <EmptySpace min="-2" max="-2" attributes="0"/>
48
              <Component id="lWebProxy" min="-2" max="-2" attributes="0"/>
49
              <EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
50
              <Group type="103" groupAlignment="0" attributes="0">
51
                  <Group type="102" alignment="0" attributes="0">
52
                      <Component id="lSocksHost" min="-2" max="-2" attributes="0"/>
53
                      <EmptySpace max="-2" attributes="0"/>
54
                  </Group>
55
                  <Group type="102" alignment="0" attributes="0">
56
                      <Group type="103" groupAlignment="0" attributes="0">
57
                          <Component id="rbList" alignment="0" min="-2" max="-2" attributes="0"/>
58
                          <Component id="rbTree" alignment="0" min="-2" pref="420" max="-2" attributes="0"/>
59
                          <Component id="cbWebBrowser" alignment="0" min="-2" pref="444" max="-2" attributes="0"/>
60
                          <Component id="rbUseSystemProxy" alignment="0" min="-2" max="-2" attributes="0"/>
61
                          <Component id="rbNoProxy" alignment="0" min="-2" max="-2" attributes="0"/>
62
                          <Component id="rbHTTPProxy" alignment="0" min="-2" max="-2" attributes="0"/>
63
                          <Group type="102" alignment="1" attributes="0">
64
                              <Component id="lProxyHost" min="-2" max="-2" attributes="0"/>
65
                              <EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
66
                              <Group type="103" groupAlignment="1" attributes="0">
67
                                  <Component id="tfSocksHost" alignment="0" pref="229" max="32767" attributes="0"/>
68
                                  <Component id="tfProxyHost" alignment="0" pref="229" max="32767" attributes="2"/>
69
                              </Group>
70
                              <EmptySpace max="-2" attributes="0"/>
71
                              <Group type="103" groupAlignment="0" attributes="0">
72
                                  <Component id="lProxyPort" alignment="0" min="-2" max="-2" attributes="0"/>
73
                                  <Component id="lSocksPort" alignment="0" min="-2" pref="36" max="-2" attributes="0"/>
74
                              </Group>
75
                              <EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
76
                              <Group type="103" groupAlignment="0" max="-2" attributes="0">
77
                                  <Component id="tfProxyPort" max="32767" attributes="1"/>
78
                                  <Component id="tfSocksPort" alignment="0" pref="85" max="32767" attributes="1"/>
79
                              </Group>
80
                          </Group>
81
                          <Group type="102" alignment="1" attributes="0">
82
                              <EmptySpace max="-2" attributes="0"/>
83
                              <Component id="detailsButton" min="-2" max="-2" attributes="0"/>
84
                          </Group>
85
                      </Group>
86
                      <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
87
                  </Group>
88
              </Group>
89
          </Group>
90
          <Group type="102" alignment="0" attributes="0">
91
              <Group type="103" groupAlignment="0" attributes="0">
92
                  <Group type="102" alignment="0" attributes="0">
93
                      <EmptySpace min="166" pref="166" max="166" attributes="0"/>
94
                      <Group type="103" groupAlignment="0" attributes="0">
95
                          <Component id="cbCheckPeriod" alignment="0" min="-2" pref="444" max="-2" attributes="2"/>
96
                          <Component id="cbAskBeforeCheck" alignment="0" min="-2" pref="40" max="-2" attributes="0"/>
97
                      </Group>
98
                      <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
99
                  </Group>
100
                  <Group type="102" alignment="0" attributes="0">
101
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
102
                      <Component id="lAskBeforeCheck" min="-2" max="-2" attributes="0"/>
103
                  </Group>
104
                  <Group type="102" alignment="0" attributes="0">
105
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
106
                      <Component id="lCheckPeriod" min="-2" max="-2" attributes="0"/>
107
                  </Group>
108
                  <Group type="102" alignment="0" attributes="1">
109
                      <Component id="lAutoUpdate" min="-2" max="-2" attributes="0"/>
110
                      <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
111
                      <Component id="jSeparator3" pref="545" max="32767" attributes="2"/>
112
                  </Group>
113
              </Group>
114
              <EmptySpace max="-2" attributes="0"/>
115
          </Group>
83
      </Group>
116
      </Group>
84
    </DimensionLayout>
117
    </DimensionLayout>
85
    <DimensionLayout dim="1">
118
    <DimensionLayout dim="1">
Lines 116-147 Link Here
116
                  <Component id="lWebProxy" min="-2" max="-2" attributes="0"/>
149
                  <Component id="lWebProxy" min="-2" max="-2" attributes="0"/>
117
              </Group>
150
              </Group>
118
              <EmptySpace max="-2" attributes="0"/>
151
              <EmptySpace max="-2" attributes="0"/>
119
              <Group type="103" groupAlignment="1" attributes="0">
152
              <Component id="rbNoProxy" min="-2" max="-2" attributes="0"/>
120
                  <Group type="102" attributes="0">
153
              <EmptySpace max="-2" attributes="0"/>
121
                      <Component id="rbNoProxy" min="-2" max="-2" attributes="0"/>
154
              <Component id="rbHTTPProxy" min="-2" max="-2" attributes="0"/>
122
                      <EmptySpace max="-2" attributes="0"/>
155
              <EmptySpace max="-2" attributes="0"/>
123
                      <Component id="rbHTTPProxy" min="-2" max="-2" attributes="0"/>
156
              <Group type="103" groupAlignment="0" attributes="0">
124
                      <EmptySpace max="-2" attributes="0"/>
157
                  <Component id="lProxyHost" min="-2" max="-2" attributes="0"/>
125
                      <Group type="103" groupAlignment="0" attributes="0">
158
                  <Group type="103" groupAlignment="3" attributes="0">
126
                          <Group type="102" attributes="0">
159
                      <Component id="tfProxyHost" alignment="3" min="-2" max="-2" attributes="0"/>
127
                              <Component id="lProxyHost" min="-2" max="-2" attributes="0"/>
160
                      <Component id="lProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
128
                              <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
161
                      <Component id="tfProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
129
                              <Group type="103" groupAlignment="0" attributes="0">
130
                                  <Component id="lNonProxyHosts" alignment="0" min="-2" max="-2" attributes="0"/>
131
                                  <Component id="tfNonProxyHosts" alignment="0" min="-2" max="-2" attributes="0"/>
132
                              </Group>
133
                          </Group>
134
                          <Group type="103" groupAlignment="3" attributes="0">
135
                              <Component id="tfProxyHost" alignment="3" min="-2" max="-2" attributes="0"/>
136
                              <Component id="lProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
137
                              <Component id="tfProxyPort" alignment="3" min="-2" max="-2" attributes="0"/>
138
                          </Group>
139
                      </Group>
140
                      <EmptySpace max="-2" attributes="0"/>
141
                      <Component id="lNonProxyHostsHint" min="-2" pref="16" max="-2" attributes="0"/>
142
                      <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
143
                      <Component id="jSeparator3" min="-2" pref="10" max="-2" attributes="1"/>
144
                  </Group>
162
                  </Group>
163
              </Group>
164
              <EmptySpace max="-2" attributes="0"/>
165
              <Group type="103" groupAlignment="0" attributes="0">
166
                  <Component id="lSocksHost" min="-2" max="-2" attributes="0"/>
167
                  <Group type="103" alignment="0" groupAlignment="3" attributes="0">
168
                      <Component id="tfSocksHost" alignment="3" min="-2" max="-2" attributes="0"/>
169
                      <Component id="lSocksPort" alignment="3" min="-2" max="-2" attributes="0"/>
170
                      <Component id="tfSocksPort" alignment="3" min="-2" max="-2" attributes="0"/>
171
                  </Group>
172
              </Group>
173
              <EmptySpace max="-2" attributes="0"/>
174
              <Component id="detailsButton" min="-2" max="-2" attributes="0"/>
175
              <EmptySpace pref="13" max="32767" attributes="0"/>
176
              <Group type="103" groupAlignment="0" attributes="0">
177
                  <Component id="lNonProxyHosts" alignment="0" min="-2" max="-2" attributes="0"/>
178
                  <Component id="tfNonProxyHosts" alignment="0" min="-2" max="-2" attributes="0"/>
179
              </Group>
180
              <EmptySpace max="-2" attributes="0"/>
181
              <Component id="lNonProxyHostsHint" min="-2" pref="16" max="-2" attributes="0"/>
182
              <EmptySpace max="-2" attributes="0"/>
183
              <Group type="103" groupAlignment="1" attributes="0">
184
                  <Component id="jSeparator3" alignment="1" min="-2" pref="10" max="-2" attributes="1"/>
145
                  <Component id="lAutoUpdate" min="-2" max="-2" attributes="1"/>
185
                  <Component id="lAutoUpdate" min="-2" max="-2" attributes="1"/>
146
              </Group>
186
              </Group>
147
              <EmptySpace max="-2" attributes="0"/>
187
              <EmptySpace max="-2" attributes="0"/>
Lines 154-160 Link Here
154
                  <Component id="lAskBeforeCheck" alignment="1" min="-2" max="-2" attributes="0"/>
194
                  <Component id="lAskBeforeCheck" alignment="1" min="-2" max="-2" attributes="0"/>
155
                  <Component id="cbAskBeforeCheck" alignment="1" min="-2" max="-2" attributes="0"/>
195
                  <Component id="cbAskBeforeCheck" alignment="1" min="-2" max="-2" attributes="0"/>
156
              </Group>
196
              </Group>
157
              <EmptySpace pref="111" max="32767" attributes="0"/>
197
              <EmptySpace min="-2" pref="55" max="-2" attributes="0"/>
158
          </Group>
198
          </Group>
159
      </Group>
199
      </Group>
160
    </DimensionLayout>
200
    </DimensionLayout>
Lines 225-231 Link Here
225
    </Component>
265
    </Component>
226
    <Component class="javax.swing.JRadioButton" name="rbNoProxy">
266
    <Component class="javax.swing.JRadioButton" name="rbNoProxy">
227
      <Properties>
267
      <Properties>
228
        <Property name="text" type="java.lang.String" value="No Proxy"/>
268
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
269
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_No_Proxy" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
270
        </Property>
229
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
271
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
230
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
272
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
231
            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
273
            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
Lines 238-244 Link Here
238
    </Component>
280
    </Component>
239
    <Component class="javax.swing.JRadioButton" name="rbUseSystemProxy">
281
    <Component class="javax.swing.JRadioButton" name="rbUseSystemProxy">
240
      <Properties>
282
      <Properties>
241
        <Property name="text" type="java.lang.String" value="Use System Proxy Settings"/>
283
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
284
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_Use_System_Proxy_Settings" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
285
        </Property>
242
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
286
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
243
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
287
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
244
            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
288
            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
Lines 373-378 Link Here
373
      </Properties>
417
      </Properties>
374
    </Component>
418
    </Component>
375
    <Component class="javax.swing.JSeparator" name="jSeparator2">
419
    <Component class="javax.swing.JSeparator" name="jSeparator2">
420
    </Component>
421
    <Component class="javax.swing.JLabel" name="lSocksHost">
422
      <Properties>
423
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
424
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_SocksHost" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
425
        </Property>
426
      </Properties>
427
    </Component>
428
    <Component class="javax.swing.JTextField" name="tfSocksHost">
429
    </Component>
430
    <Component class="javax.swing.JLabel" name="lSocksPort">
431
      <Properties>
432
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
433
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_SocksPort" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
434
        </Property>
435
      </Properties>
436
    </Component>
437
    <Component class="javax.swing.JTextField" name="tfSocksPort">
438
    </Component>
439
    <Component class="javax.swing.JButton" name="detailsButton">
440
      <Properties>
441
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
442
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_ProxyDetails" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
443
        </Property>
444
      </Properties>
445
      <Events>
446
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="detailsButtonActionPerformed"/>
447
      </Events>
376
    </Component>
448
    </Component>
377
  </SubComponents>
449
  </SubComponents>
378
</Form>
450
</Form>
(-)editor/options/src/org/netbeans/modules/options/general/GeneralOptionsPanel.java (-64 / +193 lines)
Lines 19-24 Link Here
19
 */
19
 */
20
20
21
import java.awt.Component;
21
import java.awt.Component;
22
import java.awt.Dialog;
22
import java.awt.event.ActionEvent;
23
import java.awt.event.ActionEvent;
23
import java.awt.event.ActionListener;
24
import java.awt.event.ActionListener;
24
import java.lang.reflect.Method;
25
import java.lang.reflect.Method;
Lines 31-38 Link Here
31
import javax.swing.JPanel;
32
import javax.swing.JPanel;
32
import org.netbeans.beaninfo.editors.HtmlBrowser;
33
import org.netbeans.beaninfo.editors.HtmlBrowser;
33
import org.netbeans.core.IDESettings;
34
import org.netbeans.core.IDESettings;
35
import org.openide.DialogDescriptor;
36
import org.openide.DialogDisplayer;
37
import org.openide.NotifyDescriptor;
34
import org.openide.awt.Mnemonics;
38
import org.openide.awt.Mnemonics;
35
import org.openide.options.SystemOption;
39
import org.openide.options.SystemOption;
40
import org.openide.util.HelpCtx;
36
import org.openide.util.Lookup;
41
import org.openide.util.Lookup;
37
import org.openide.util.NbBundle;
42
import org.openide.util.NbBundle;
38
43
Lines 69-79 Link Here
69
        loc (lWebProxy, "Web_Proxy");
74
        loc (lWebProxy, "Web_Proxy");
70
        loc (lProxyHost, "Proxy_Host");
75
        loc (lProxyHost, "Proxy_Host");
71
        loc (lProxyPort, "Proxy_Port");
76
        loc (lProxyPort, "Proxy_Port");
77
        loc (lSocksHost, "SocksHost");
78
        loc (lSocksPort, "SocksPort");
72
        loc (lNonProxyHosts, "Non_Proxy");
79
        loc (lNonProxyHosts, "Non_Proxy");
73
        loc (lAutoUpdate, "Auto_Update");
80
        loc (lAutoUpdate, "Auto_Update");
74
        loc (lCheckPeriod, "Check_Period");
81
        loc (lCheckPeriod, "Check_Period");
75
        loc (lAskBeforeCheck, "Ask_Before_Check");
82
        loc (lAskBeforeCheck, "Ask_Before_Check");
76
            
83
        loc (detailsButton, "ProxyDetails");
77
            
84
            
78
            
85
            
79
        cbWebBrowser.getAccessibleContext ().setAccessibleName (loc ("AN_Web_Browser"));
86
        cbWebBrowser.getAccessibleContext ().setAccessibleName (loc ("AN_Web_Browser"));
Lines 94-99 Link Here
94
        cbWebBrowser.addActionListener (this);
101
        cbWebBrowser.addActionListener (this);
95
        tfProxyHost.addActionListener (this);
102
        tfProxyHost.addActionListener (this);
96
        tfProxyPort.addActionListener (this);
103
        tfProxyPort.addActionListener (this);
104
        tfSocksHost.addActionListener (this);
105
        tfSocksPort.addActionListener (this);
97
        cbCheckPeriod.addActionListener (this);
106
        cbCheckPeriod.addActionListener (this);
98
        cbAskBeforeCheck.addActionListener (this);
107
        cbAskBeforeCheck.addActionListener (this);
99
        
108
        
Lines 123-128 Link Here
123
     */
132
     */
124
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
133
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
125
    private void initComponents() {
134
    private void initComponents() {
135
126
        lGeneral = new javax.swing.JLabel();
136
        lGeneral = new javax.swing.JLabel();
127
        jSeparator1 = new javax.swing.JSeparator();
137
        jSeparator1 = new javax.swing.JSeparator();
128
        lViewJavaPackagesAs = new javax.swing.JLabel();
138
        lViewJavaPackagesAs = new javax.swing.JLabel();
Lines 149-154 Link Here
149
        tfNonProxyHosts = new javax.swing.JTextField();
159
        tfNonProxyHosts = new javax.swing.JTextField();
150
        lNonProxyHostsHint = new javax.swing.JLabel();
160
        lNonProxyHostsHint = new javax.swing.JLabel();
151
        jSeparator2 = new javax.swing.JSeparator();
161
        jSeparator2 = new javax.swing.JSeparator();
162
        lSocksHost = new javax.swing.JLabel();
163
        tfSocksHost = new javax.swing.JTextField();
164
        lSocksPort = new javax.swing.JLabel();
165
        tfSocksPort = new javax.swing.JTextField();
166
        detailsButton = new javax.swing.JButton();
152
167
153
        lGeneral.setText("General");
168
        lGeneral.setText("General");
154
169
Lines 169-179 Link Here
169
184
170
        lWebProxy.setText("Web Proxy:");
185
        lWebProxy.setText("Web Proxy:");
171
186
172
        rbNoProxy.setText("No Proxy");
187
        rbNoProxy.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_No_Proxy")); // NOI18N
173
        rbNoProxy.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
188
        rbNoProxy.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
174
        rbNoProxy.setMargin(new java.awt.Insets(0, 0, 0, 0));
189
        rbNoProxy.setMargin(new java.awt.Insets(0, 0, 0, 0));
175
190
176
        rbUseSystemProxy.setText("Use System Proxy Settings");
191
        rbUseSystemProxy.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_Use_System_Proxy_Settings")); // NOI18N
177
        rbUseSystemProxy.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
192
        rbUseSystemProxy.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
178
        rbUseSystemProxy.setMargin(new java.awt.Insets(0, 0, 0, 0));
193
        rbUseSystemProxy.setMargin(new java.awt.Insets(0, 0, 0, 0));
179
194
Lines 219-226 Link Here
219
234
220
        lNonProxyHosts.setLabelFor(tfNonProxyHosts);
235
        lNonProxyHosts.setLabelFor(tfNonProxyHosts);
221
        lNonProxyHosts.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_Non_Proxy", new Object[] {})); // NOI18N
236
        lNonProxyHosts.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_Non_Proxy", new Object[] {})); // NOI18N
222
        lNonProxyHosts.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "AN_NonProxy", new Object[] {})); // NOI18N
223
        lNonProxyHosts.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "AD_NonProxy", new Object[] {})); // NOI18N
224
237
225
        tfNonProxyHosts.addFocusListener(new java.awt.event.FocusAdapter() {
238
        tfNonProxyHosts.addFocusListener(new java.awt.event.FocusAdapter() {
226
            public void focusGained(java.awt.event.FocusEvent evt) {
239
            public void focusGained(java.awt.event.FocusEvent evt) {
Lines 233-277 Link Here
233
246
234
        lNonProxyHostsHint.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "Non_Proxy_Hint", new Object[] {})); // NOI18N
247
        lNonProxyHostsHint.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "Non_Proxy_Hint", new Object[] {})); // NOI18N
235
248
249
        lSocksHost.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_SocksHost")); // NOI18N
250
251
        lSocksPort.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_SocksPort")); // NOI18N
252
253
        detailsButton.setText(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_ProxyDetails")); // NOI18N
254
        detailsButton.addActionListener(new java.awt.event.ActionListener() {
255
            public void actionPerformed(java.awt.event.ActionEvent evt) {
256
                detailsButtonActionPerformed(evt);
257
            }
258
        });
259
236
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
260
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
237
        this.setLayout(layout);
261
        this.setLayout(layout);
238
        layout.setHorizontalGroup(
262
        layout.setHorizontalGroup(
239
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
263
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
240
            .add(layout.createSequentialGroup()
264
            .add(layout.createSequentialGroup()
241
                .addContainerGap()
242
                .add(lWebProxy)
243
                .add(87, 87, 87)
244
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
245
                    .add(rbList)
246
                    .add(rbTree, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 420, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
247
                    .add(cbWebBrowser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 444, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
248
                    .add(rbUseSystemProxy)
249
                    .add(rbNoProxy)
250
                    .add(rbHTTPProxy)
251
                    .add(cbCheckPeriod, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 444, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
252
                    .add(cbAskBeforeCheck, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
253
                    .add(layout.createSequentialGroup()
254
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
255
                            .add(lProxyHost)
256
                            .add(lNonProxyHosts))
257
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
258
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
259
                            .add(layout.createSequentialGroup()
260
                                .add(tfProxyHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
261
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
262
                                .add(lProxyPort)
263
                                .add(2, 2, 2)
264
                                .add(tfProxyPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 62, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
265
                            .add(tfNonProxyHosts, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
266
                            .add(lNonProxyHostsHint))))
267
                .add(19, 19, 19))
268
            .add(layout.createSequentialGroup()
269
                .add(12, 12, 12)
270
                .add(lAskBeforeCheck))
271
            .add(layout.createSequentialGroup()
272
                .add(12, 12, 12)
273
                .add(lCheckPeriod))
274
            .add(layout.createSequentialGroup()
275
                .add(12, 12, 12)
265
                .add(12, 12, 12)
276
                .add(lViewJavaPackagesAs))
266
                .add(lViewJavaPackagesAs))
277
            .add(layout.createSequentialGroup()
267
            .add(layout.createSequentialGroup()
Lines 279-288 Link Here
279
                .add(lWebBrowser))
269
                .add(lWebBrowser))
280
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
270
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
281
                .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
271
                .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
282
                    .add(lAutoUpdate)
283
                    .add(18, 18, 18)
284
                    .add(jSeparator3))
285
                .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
286
                    .add(lProxy)
272
                    .add(lProxy)
287
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
273
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
288
                    .add(jSeparator2))
274
                    .add(jSeparator2))
Lines 290-295 Link Here
290
                    .add(lGeneral)
276
                    .add(lGeneral)
291
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
277
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
292
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 570, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
278
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 570, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
279
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
280
                .add(166, 166, 166)
281
                .add(lNonProxyHosts)
282
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
283
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
284
                    .add(tfNonProxyHosts, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
285
                    .add(lNonProxyHostsHint))
286
                .addContainerGap())
287
            .add(layout.createSequentialGroup()
288
                .addContainerGap()
289
                .add(lWebProxy)
290
                .add(87, 87, 87)
291
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
292
                    .add(layout.createSequentialGroup()
293
                        .add(lSocksHost)
294
                        .addContainerGap())
295
                    .add(layout.createSequentialGroup()
296
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
297
                            .add(rbList)
298
                            .add(rbTree, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 420, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
299
                            .add(cbWebBrowser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 444, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
300
                            .add(rbUseSystemProxy)
301
                            .add(rbNoProxy)
302
                            .add(rbHTTPProxy)
303
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
304
                                .add(lProxyHost)
305
                                .add(21, 21, 21)
306
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
307
                                    .add(org.jdesktop.layout.GroupLayout.LEADING, tfSocksHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
308
                                    .add(org.jdesktop.layout.GroupLayout.LEADING, tfProxyHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE))
309
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
310
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
311
                                    .add(lProxyPort)
312
                                    .add(lSocksPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 36, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
313
                                .add(2, 2, 2)
314
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
315
                                    .add(tfProxyPort)
316
                                    .add(tfSocksPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE)))
317
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
318
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
319
                                .add(detailsButton)))
320
                        .add(19, 19, 19))))
321
            .add(layout.createSequentialGroup()
322
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
323
                    .add(layout.createSequentialGroup()
324
                        .add(166, 166, 166)
325
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
326
                            .add(cbCheckPeriod, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 444, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
327
                            .add(cbAskBeforeCheck, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
328
                        .add(19, 19, 19))
329
                    .add(layout.createSequentialGroup()
330
                        .add(12, 12, 12)
331
                        .add(lAskBeforeCheck))
332
                    .add(layout.createSequentialGroup()
333
                        .add(12, 12, 12)
334
                        .add(lCheckPeriod))
335
                    .add(layout.createSequentialGroup()
336
                        .add(lAutoUpdate)
337
                        .add(18, 18, 18)
338
                        .add(jSeparator3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)))
339
                .addContainerGap())
293
        );
340
        );
294
        layout.setVerticalGroup(
341
        layout.setVerticalGroup(
295
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
342
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
Lines 319-345 Link Here
319
                    .add(rbUseSystemProxy)
366
                    .add(rbUseSystemProxy)
320
                    .add(lWebProxy))
367
                    .add(lWebProxy))
321
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
368
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
369
                .add(rbNoProxy)
370
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
371
                .add(rbHTTPProxy)
372
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
373
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
374
                    .add(lProxyHost)
375
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
376
                        .add(tfProxyHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
377
                        .add(lProxyPort)
378
                        .add(tfProxyPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
379
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
380
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
381
                    .add(lSocksHost)
382
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
383
                        .add(tfSocksHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
384
                        .add(lSocksPort)
385
                        .add(tfSocksPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
386
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
387
                .add(detailsButton)
388
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 13, Short.MAX_VALUE)
389
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
390
                    .add(lNonProxyHosts)
391
                    .add(tfNonProxyHosts, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
392
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
393
                .add(lNonProxyHostsHint, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
394
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
322
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
395
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
323
                    .add(layout.createSequentialGroup()
396
                    .add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
324
                        .add(rbNoProxy)
325
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
326
                        .add(rbHTTPProxy)
327
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
328
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
329
                            .add(layout.createSequentialGroup()
330
                                .add(lProxyHost)
331
                                .add(10, 10, 10)
332
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
333
                                    .add(lNonProxyHosts)
334
                                    .add(tfNonProxyHosts, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
335
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
336
                                .add(tfProxyHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
337
                                .add(lProxyPort)
338
                                .add(tfProxyPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
339
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
340
                        .add(lNonProxyHostsHint, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 16, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
341
                        .add(18, 18, 18)
342
                        .add(jSeparator3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
343
                    .add(lAutoUpdate))
397
                    .add(lAutoUpdate))
344
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
398
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
345
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
399
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
Lines 349-358 Link Here
349
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
403
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
350
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lAskBeforeCheck)
404
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lAskBeforeCheck)
351
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, cbAskBeforeCheck))
405
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, cbAskBeforeCheck))
352
                .addContainerGap(111, Short.MAX_VALUE))
406
                .add(55, 55, 55))
353
        );
407
        );
408
409
        lNonProxyHosts.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "AN_NonProxy", new Object[] {})); // NOI18N
410
        lNonProxyHosts.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(GeneralOptionsPanel.class, "AD_NonProxy", new Object[] {})); // NOI18N
354
    }// </editor-fold>//GEN-END:initComponents
411
    }// </editor-fold>//GEN-END:initComponents
355
412
413
414
    private void detailsButtonActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailsButtonActionPerformed
415
        if (! detailsButton.isEnabled()) {
416
            return ;
417
        }
418
        ProxyDetailsDialog details = new ProxyDetailsDialog (model.useProxyAuthentication(),
419
                                                             model.getProxyAuthenticationUsername (),
420
                                                             model.getProxyAuthenticationPassword ());
421
        DialogDescriptor dd = new DialogDescriptor (details, NbBundle.getMessage(GeneralOptionsPanel.class, "CTL_ProxyDetailsName"));
422
        // #48931: set help Id (asked by web team)
423
        dd.setHelpCtx (new HelpCtx (GeneralOptionsPanel.class.getName () + ".getPasswordAuthentication")); // NOI18N
424
        Dialog dialog = DialogDisplayer.getDefault ().createDialog (dd);
425
        dialog.setVisible (true);
426
427
        if (dd.getValue ().equals (NotifyDescriptor.OK_OPTION)) {
428
            //return new java.net.PasswordAuthentication ( passwordPanel.getUsername(), passwordPanel.getPassword() );
429
            // XXX Put into preferences
430
            model.setUseProxyAuthentication (details.useAuthentication ());
431
            model.setAuthenticationUsername (details.getAuthenticationUsername ());
432
            model.setAuthenticationPassword (details.getPasswordAuthentication ());
433
        } else {
434
            // do nothing
435
        }
436
//GEN-HEADEREND:event_detailsButtonActionPerformed
437
    }//GEN-LAST:event_detailsButtonActionPerformed
356
    private void tfNonProxyHostsFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfNonProxyHostsFocusLost
438
    private void tfNonProxyHostsFocusLost (java.awt.event.FocusEvent evt) {//GEN-FIRST:event_tfNonProxyHostsFocusLost
357
        tfNonProxyHosts.select (0, 0);
439
        tfNonProxyHosts.select (0, 0);
358
    }//GEN-LAST:event_tfNonProxyHostsFocusLost
440
    }//GEN-LAST:event_tfNonProxyHostsFocusLost
Lines 385-390 Link Here
385
    private javax.swing.JCheckBox cbAskBeforeCheck;
467
    private javax.swing.JCheckBox cbAskBeforeCheck;
386
    private javax.swing.JComboBox cbCheckPeriod;
468
    private javax.swing.JComboBox cbCheckPeriod;
387
    private javax.swing.JComboBox cbWebBrowser;
469
    private javax.swing.JComboBox cbWebBrowser;
470
    private javax.swing.JButton detailsButton;
388
    private javax.swing.JSeparator jSeparator1;
471
    private javax.swing.JSeparator jSeparator1;
389
    private javax.swing.JSeparator jSeparator2;
472
    private javax.swing.JSeparator jSeparator2;
390
    private javax.swing.JSeparator jSeparator3;
473
    private javax.swing.JSeparator jSeparator3;
Lines 397-402 Link Here
397
    private javax.swing.JLabel lProxy;
480
    private javax.swing.JLabel lProxy;
398
    private javax.swing.JLabel lProxyHost;
481
    private javax.swing.JLabel lProxyHost;
399
    private javax.swing.JLabel lProxyPort;
482
    private javax.swing.JLabel lProxyPort;
483
    private javax.swing.JLabel lSocksHost;
484
    private javax.swing.JLabel lSocksPort;
400
    private javax.swing.JLabel lViewJavaPackagesAs;
485
    private javax.swing.JLabel lViewJavaPackagesAs;
401
    private javax.swing.JLabel lWebBrowser;
486
    private javax.swing.JLabel lWebBrowser;
402
    private javax.swing.JLabel lWebProxy;
487
    private javax.swing.JLabel lWebProxy;
Lines 408-413 Link Here
408
    private javax.swing.JTextField tfNonProxyHosts;
493
    private javax.swing.JTextField tfNonProxyHosts;
409
    private javax.swing.JTextField tfProxyHost;
494
    private javax.swing.JTextField tfProxyHost;
410
    private javax.swing.JTextField tfProxyPort;
495
    private javax.swing.JTextField tfProxyPort;
496
    private javax.swing.JTextField tfSocksHost;
497
    private javax.swing.JTextField tfSocksPort;
411
    // End of variables declaration//GEN-END:variables
498
    // End of variables declaration//GEN-END:variables
412
    
499
    
413
    
500
    
Lines 444-470 Link Here
444
                rbNoProxy.setSelected (true);
531
                rbNoProxy.setSelected (true);
445
                tfProxyHost.setEnabled (false);
532
                tfProxyHost.setEnabled (false);
446
                tfProxyPort.setEnabled (false);
533
                tfProxyPort.setEnabled (false);
534
                tfSocksPort.setEnabled (false);
535
                tfSocksHost.setEnabled (false);
447
                tfNonProxyHosts.setEnabled (false);
536
                tfNonProxyHosts.setEnabled (false);
537
                detailsButton.setEnabled (false);
448
                break;
538
                break;
449
            case 1:
539
            case 1:
450
                rbUseSystemProxy.setSelected (true);
540
                rbUseSystemProxy.setSelected (true);
451
                tfProxyHost.setEnabled (false);
541
                tfProxyHost.setEnabled (false);
452
                tfProxyPort.setEnabled (false);
542
                tfProxyPort.setEnabled (false);
543
                tfSocksPort.setEnabled (false);
544
                tfSocksHost.setEnabled (false);
453
                tfNonProxyHosts.setEnabled (false);
545
                tfNonProxyHosts.setEnabled (false);
546
                detailsButton.setEnabled (false);
454
                break;
547
                break;
455
            default:
548
            default:
456
                rbHTTPProxy.setSelected (true);
549
                rbHTTPProxy.setSelected (true);
457
                tfProxyHost.setEnabled (true);
550
                tfProxyHost.setEnabled (true);
458
                tfProxyPort.setEnabled (true);
551
                tfProxyPort.setEnabled (true);
459
                tfNonProxyHosts.setEnabled (true);
552
                tfNonProxyHosts.setEnabled (true);
553
                tfSocksPort.setEnabled (true);
554
                tfSocksHost.setEnabled (true);
555
                detailsButton.setEnabled (true);
460
                break;
556
                break;
461
        }
557
        }
558
        
559
        // http proxy settings
462
        tfProxyHost.setText (model.getProxyHost ());
560
        tfProxyHost.setText (model.getProxyHost ());
463
        int port = model.getProxyPort ();
561
        int port = model.getProxyPort ();
464
        if (port > 0)
562
        if (port > 0)
465
            tfProxyPort.setText (Integer.toString (port));
563
            tfProxyPort.setText (Integer.toString (port));
466
        else
564
        else
467
            tfProxyPort.setText ("");
565
            tfProxyPort.setText ("");
566
567
        // socks proxy settings
568
        tfSocksHost.setText (model.getSocksHost ());
569
        port = model.getSocksPort ();
570
        if (port > 0)
571
            tfSocksPort.setText (Integer.toString (port));
572
        else
573
            tfSocksPort.setText ("");
574
        
575
        // non proxy host
468
        tfNonProxyHosts.setText (model.getUserNonProxy ());
576
        tfNonProxyHosts.setText (model.getUserNonProxy ());
469
577
470
        // Autoupdate settings
578
        // Autoupdate settings
Lines 530-535 Link Here
530
            model.setProxyType (2);
638
            model.setProxyType (2);
531
        }
639
        }
532
        
640
        
641
        // write http proxy
533
        model.setProxyHost (tfProxyHost.getText ());
642
        model.setProxyHost (tfProxyHost.getText ());
534
        try {
643
        try {
535
            model.setProxyPort (
644
            model.setProxyPort (
Lines 538-543 Link Here
538
        } catch (NumberFormatException ex) {
647
        } catch (NumberFormatException ex) {
539
            model.setProxyPort (0);
648
            model.setProxyPort (0);
540
        }
649
        }
650
651
        // write socks proxy
652
        model.setSocksHost (tfSocksHost.getText ());
653
        try {
654
            model.setSocksPort (
655
                Math.max (Integer.parseInt (tfSocksPort.getText ()), 0)
656
            );
657
        } catch (NumberFormatException ex) {
658
            model.setSocksPort (0);
659
        }
660
        
661
        // write non proxt hosts
541
        model.setUserNonProxy (tfNonProxyHosts.getText ());
662
        model.setUserNonProxy (tfNonProxyHosts.getText ());
542
663
543
        // Autoupdate settings
664
        // Autoupdate settings
Lines 588-593 Link Here
588
            if (!tfProxyPort.getText ().equals (Integer.toString (model.getProxyPort ()))) return true;
709
            if (!tfProxyPort.getText ().equals (Integer.toString (model.getProxyPort ()))) return true;
589
        } else
710
        } else
590
            if (!tfProxyPort.getText ().equals ("")) return true;
711
            if (!tfProxyPort.getText ().equals ("")) return true;
712
        if (!tfSocksHost.getText ().equals (model.getSocksHost ())) return true;
713
        if (model.getSocksPort () > 0) {
714
            if (!tfSocksPort.getText ().equals (Integer.toString (model.getSocksPort ()))) return true;
715
        } else
716
            if (!tfSocksPort.getText ().equals ("")) return true;
591
        if (!tfNonProxyHosts.getText ().equals (model.getUserNonProxy ())) {
717
        if (!tfNonProxyHosts.getText ().equals (model.getUserNonProxy ())) {
592
            return true;
718
            return true;
593
        }
719
        }
Lines 598-603 Link Here
598
        changed = true;
724
        changed = true;
599
        tfProxyHost.setEnabled (rbHTTPProxy.isSelected ());
725
        tfProxyHost.setEnabled (rbHTTPProxy.isSelected ());
600
        tfProxyPort.setEnabled (rbHTTPProxy.isSelected ());
726
        tfProxyPort.setEnabled (rbHTTPProxy.isSelected ());
727
        tfSocksPort.setEnabled (rbHTTPProxy.isSelected ());
728
        tfSocksHost.setEnabled (rbHTTPProxy.isSelected ());
729
        detailsButton.setEnabled (rbHTTPProxy.isSelected ());
601
        tfNonProxyHosts.setEnabled (rbHTTPProxy.isSelected ());
730
        tfNonProxyHosts.setEnabled (rbHTTPProxy.isSelected ());
602
    }
731
    }
603
}
732
}
(-)editor/options/src/org/netbeans/modules/options/general/ProxyDetailsDialog.form (+117 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
2
3
<Form version="1.3" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
5
    <Component class="javax.swing.JTextField" name="jTextField1">
6
      <Properties>
7
        <Property name="text" type="java.lang.String" value="jTextField1"/>
8
      </Properties>
9
    </Component>
10
  </NonVisualComponents>
11
  <AuxValues>
12
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
13
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
14
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
15
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
16
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
17
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
18
  </AuxValues>
19
20
  <Layout>
21
    <DimensionLayout dim="0">
22
      <Group type="103" groupAlignment="0" attributes="0">
23
          <Group type="102" attributes="0">
24
              <EmptySpace max="-2" attributes="0"/>
25
              <Group type="103" groupAlignment="0" attributes="0">
26
                  <Component id="useAuthentication" min="-2" max="-2" attributes="0"/>
27
                  <Group type="102" alignment="1" attributes="0">
28
                      <Group type="103" groupAlignment="0" attributes="0">
29
                          <Component id="lAuthUser" alignment="0" min="-2" max="-2" attributes="0"/>
30
                          <Component id="lAuthPwd" alignment="0" min="-2" max="-2" attributes="0"/>
31
                      </Group>
32
                      <EmptySpace max="-2" attributes="0"/>
33
                      <Group type="103" groupAlignment="0" attributes="0">
34
                          <Component id="pfAuthPwd" alignment="0" pref="262" max="32767" attributes="0"/>
35
                          <Component id="tfAuthUser" alignment="0" pref="262" max="32767" attributes="0"/>
36
                      </Group>
37
                  </Group>
38
              </Group>
39
              <EmptySpace max="-2" attributes="0"/>
40
          </Group>
41
      </Group>
42
    </DimensionLayout>
43
    <DimensionLayout dim="1">
44
      <Group type="103" groupAlignment="0" attributes="0">
45
          <Group type="102" alignment="0" attributes="0">
46
              <EmptySpace max="-2" attributes="0"/>
47
              <Component id="useAuthentication" min="-2" max="-2" attributes="0"/>
48
              <EmptySpace max="-2" attributes="0"/>
49
              <Group type="103" groupAlignment="3" attributes="0">
50
                  <Component id="lAuthUser" alignment="3" min="-2" max="-2" attributes="0"/>
51
                  <Component id="tfAuthUser" alignment="3" min="-2" max="-2" attributes="0"/>
52
              </Group>
53
              <EmptySpace max="-2" attributes="0"/>
54
              <Group type="103" groupAlignment="3" attributes="0">
55
                  <Component id="lAuthPwd" alignment="3" min="-2" max="-2" attributes="0"/>
56
                  <Component id="pfAuthPwd" alignment="3" min="-2" max="-2" attributes="0"/>
57
              </Group>
58
              <EmptySpace pref="44" max="32767" attributes="0"/>
59
          </Group>
60
      </Group>
61
    </DimensionLayout>
62
  </Layout>
63
  <SubComponents>
64
    <Component class="javax.swing.JCheckBox" name="useAuthentication">
65
      <Properties>
66
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
67
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_UseAuthentication" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
68
        </Property>
69
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
70
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
71
            <EmptyBorder bottom="0" left="0" right="0" top="0"/>
72
          </Border>
73
        </Property>
74
        <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
75
          <Insets value="[0, 0, 0, 0]"/>
76
        </Property>
77
      </Properties>
78
      <Events>
79
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="useAuthenticationActionPerformed"/>
80
      </Events>
81
    </Component>
82
    <Component class="javax.swing.JLabel" name="lAuthUser">
83
      <Properties>
84
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
85
          <ComponentRef name="tfAuthUser"/>
86
        </Property>
87
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
88
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_AuthUser" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
89
        </Property>
90
      </Properties>
91
    </Component>
92
    <Component class="javax.swing.JLabel" name="lAuthPwd">
93
      <Properties>
94
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
95
          <ComponentRef name="pfAuthPwd"/>
96
        </Property>
97
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
98
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="CTL_AuthPwd" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
99
        </Property>
100
      </Properties>
101
    </Component>
102
    <Component class="javax.swing.JTextField" name="tfAuthUser">
103
      <Properties>
104
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
105
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="ProxyDetailsDialog.tfAuthUser.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
106
        </Property>
107
      </Properties>
108
    </Component>
109
    <Component class="javax.swing.JPasswordField" name="pfAuthPwd">
110
      <Properties>
111
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
112
          <ResourceString bundle="org/netbeans/modules/options/general/Bundle.properties" key="ProxyDetailsDialog.pfAuthPwd.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
113
        </Property>
114
      </Properties>
115
    </Component>
116
  </SubComponents>
117
</Form>
(-)editor/options/src/org/netbeans/modules/options/general/ProxyDetailsDialog.java (+156 lines)
Added Link Here
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.options.general;
21
22
import org.openide.awt.Mnemonics;
23
import org.openide.util.NbBundle;
24
25
/**
26
 *
27
 * @author  Jiri Rechtacek
28
 */
29
public class ProxyDetailsDialog extends javax.swing.JPanel {
30
    
31
    /** Creates new form ProxyDetaildDialog */
32
    private ProxyDetailsDialog () {
33
    }
34
    
35
    public ProxyDetailsDialog (boolean use, String user, char [] password) {
36
        initComponents ();
37
        Mnemonics.setLocalizedText (useAuthentication, NbBundle.getMessage (ProxyDetailsDialog.class, "CTL_UseAuthentication"));
38
        Mnemonics.setLocalizedText (lAuthUser, NbBundle.getMessage (ProxyDetailsDialog.class, "CTL_AuthUser"));
39
        Mnemonics.setLocalizedText (lAuthPwd, NbBundle.getMessage (ProxyDetailsDialog.class, "CTL_AuthPwd"));
40
        useAuthentication.setSelected (use);
41
        tfAuthUser.setText (user);
42
        pfAuthPwd.setText (new String (password));
43
        applyChanges ();
44
    }
45
    
46
    boolean useAuthentication () {
47
        return useAuthentication.isSelected ();
48
    }
49
    
50
    String getAuthenticationUsername () {
51
        return tfAuthUser.getText ();
52
    }
53
    
54
    char [] getPasswordAuthentication () {
55
        return pfAuthPwd.getPassword ();
56
    }
57
    
58
    /** This method is called from within the constructor to
59
     * initialize the form.
60
     * WARNING: Do NOT modify this code. The content of this method is
61
     * always regenerated by the Form Editor.
62
     */
63
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
64
    private void initComponents() {
65
66
        jTextField1 = new javax.swing.JTextField();
67
        useAuthentication = new javax.swing.JCheckBox();
68
        lAuthUser = new javax.swing.JLabel();
69
        lAuthPwd = new javax.swing.JLabel();
70
        tfAuthUser = new javax.swing.JTextField();
71
        pfAuthPwd = new javax.swing.JPasswordField();
72
73
        jTextField1.setText("jTextField1");
74
75
        useAuthentication.setText(org.openide.util.NbBundle.getMessage(ProxyDetailsDialog.class, "CTL_UseAuthentication")); // NOI18N
76
        useAuthentication.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
77
        useAuthentication.setMargin(new java.awt.Insets(0, 0, 0, 0));
78
        useAuthentication.addActionListener(new java.awt.event.ActionListener() {
79
            public void actionPerformed(java.awt.event.ActionEvent evt) {
80
                useAuthenticationActionPerformed(evt);
81
            }
82
        });
83
84
        lAuthUser.setLabelFor(tfAuthUser);
85
        lAuthUser.setText(org.openide.util.NbBundle.getMessage(ProxyDetailsDialog.class, "CTL_AuthUser")); // NOI18N
86
87
        lAuthPwd.setLabelFor(pfAuthPwd);
88
        lAuthPwd.setText(org.openide.util.NbBundle.getMessage(ProxyDetailsDialog.class, "CTL_AuthPwd")); // NOI18N
89
90
        tfAuthUser.setText(org.openide.util.NbBundle.getMessage(ProxyDetailsDialog.class, "ProxyDetailsDialog.tfAuthUser.text")); // NOI18N
91
92
        pfAuthPwd.setText(org.openide.util.NbBundle.getMessage(ProxyDetailsDialog.class, "ProxyDetailsDialog.pfAuthPwd.text")); // NOI18N
93
94
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
95
        this.setLayout(layout);
96
        layout.setHorizontalGroup(
97
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98
            .addGroup(layout.createSequentialGroup()
99
                .addContainerGap()
100
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
101
                    .addComponent(useAuthentication)
102
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
103
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
104
                            .addComponent(lAuthUser)
105
                            .addComponent(lAuthPwd))
106
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
107
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
108
                            .addComponent(pfAuthPwd, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
109
                            .addComponent(tfAuthUser, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE))))
110
                .addContainerGap())
111
        );
112
        layout.setVerticalGroup(
113
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
114
            .addGroup(layout.createSequentialGroup()
115
                .addContainerGap()
116
                .addComponent(useAuthentication)
117
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
118
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
119
                    .addComponent(lAuthUser)
120
                    .addComponent(tfAuthUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
121
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
122
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
123
                    .addComponent(lAuthPwd)
124
                    .addComponent(pfAuthPwd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
125
                .addContainerGap(44, Short.MAX_VALUE))
126
        );
127
    }// </editor-fold>//GEN-END:initComponents
128
 
129
    private void useAuthenticationActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useAuthenticationActionPerformed
130
        applyChanges ();
131
    }//GEN-LAST:event_useAuthenticationActionPerformed
132
   
133
    
134
    // Variables declaration - do not modify//GEN-BEGIN:variables
135
    private javax.swing.JTextField jTextField1;
136
    private javax.swing.JLabel lAuthPwd;
137
    private javax.swing.JLabel lAuthUser;
138
    private javax.swing.JPasswordField pfAuthPwd;
139
    private javax.swing.JTextField tfAuthUser;
140
    private javax.swing.JCheckBox useAuthentication;
141
    // End of variables declaration//GEN-END:variables
142
    
143
    private void applyChanges () {
144
        if (useAuthentication.isSelected ()) {
145
            tfAuthUser.setEnabled (true);
146
            pfAuthPwd.setEnabled (true);
147
            lAuthPwd.setEnabled (true);
148
            lAuthUser.setEnabled (true);
149
        } else {
150
            tfAuthUser.setEnabled (false);
151
            pfAuthPwd.setEnabled (false);
152
            lAuthPwd.setEnabled (false);
153
            lAuthUser.setEnabled (false);
154
        }
155
    }
156
}
(-)core/options/apichanges.xml (+14 lines)
Lines 74-79 Link Here
74
        </description>
74
        </description>
75
        <issue number="70826"/>
75
        <issue number="70826"/>
76
    </change>          
76
    </change>          
77
    <change id="Added-OptionsCustomizer">
78
        <api name="OptionsAPI"/>
79
        <summary>Add an API for opening the Options dialog</summary>
80
        <version major="1" minor="5"/>
81
        <date day="13" month="11" year="2006"/>
82
        <author login="jrechtacek"/>
83
        <compatibility addition="yes" binary="compatible" semantic="compatible" source="compatible" deprecation="no" deletion="no" modification="no"/>
84
        <description>
85
            <p>
86
                <code>OptionsCustomizer.show</code> displays a Options dialog.
87
            </p>
88
        </description>
89
        <issue number="74855"/>
90
    </change>
77
</changes>
91
</changes>
78
92
79
  <!-- Now the surrounding HTML text and document structure: -->
93
  <!-- Now the surrounding HTML text and document structure: -->
(-)core/options/manifest.mf (-1 / +1 lines)
Lines 2-5 Link Here
2
OpenIDE-Module: org.netbeans.modules.options.api/1
2
OpenIDE-Module: org.netbeans.modules.options.api/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties
4
OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml
4
OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml
5
OpenIDE-Module-Specification-Version: 1.4
5
OpenIDE-Module-Specification-Version: 1.5
(-)core/options/nbproject/project.xml (-1 / +2 lines)
Lines 101-108 Link Here
101
                    <compile-dependency/>
101
                    <compile-dependency/>
102
                    <run-dependency/>
102
                    <run-dependency/>
103
                </dependency>
103
                </dependency>
104
                </module-dependencies>
104
            </module-dependencies>
105
            <public-packages>
105
            <public-packages>
106
                <package>org.netbeans.api.options</package>
106
                <package>org.netbeans.spi.options</package>
107
                <package>org.netbeans.spi.options</package>
107
            </public-packages>
108
            </public-packages>
108
        </data>
109
        </data>
(-)core/options/src/org/netbeans/modules/options/OptionsWindowAction.java (+4 lines)
Lines 69-74 Link Here
69
    }
69
    }
70
70
71
    public void actionPerformed (ActionEvent evt) {     
71
    public void actionPerformed (ActionEvent evt) {     
72
        openOptionsWindow ();
73
    }
74
    
75
    public final void openOptionsWindow () {
72
        if (dialog != null) {
76
        if (dialog != null) {
73
            // dialog already opened
77
            // dialog already opened
74
            dialog.setVisible (true);
78
            dialog.setVisible (true);
75
* The contents of this file are subject to the terms of the Common Development
79
* The contents of this file are subject to the terms of the Common Development
76
* and Distribution License (the License). You may not use this file except in
80
* and Distribution License (the License). You may not use this file except in
77
* compliance with the License.
81
* compliance with the License.
78
*
82
*
79
* You can obtain a copy of the License at http://www.netbeans.org/cddl.html
83
* You can obtain a copy of the License at http://www.netbeans.org/cddl.html
80
* or http://www.netbeans.org/cddl.txt.
84
* or http://www.netbeans.org/cddl.txt.
81
*
85
*
82
* When distributing Covered Code, include this CDDL Header Notice in each file
86
* When distributing Covered Code, include this CDDL Header Notice in each file
83
* and include the License file at http://www.netbeans.org/cddl.txt.
87
* and include the License file at http://www.netbeans.org/cddl.txt.
84
* If applicable, add the following below the CDDL Header, with the fields
88
* If applicable, add the following below the CDDL Header, with the fields
85
* enclosed by brackets [] replaced by your own identifying information:
89
* enclosed by brackets [] replaced by your own identifying information:
86
* "Portions Copyrighted [year] [name of copyright owner]"
90
* "Portions Copyrighted [year] [name of copyright owner]"
87
*
91
*
88
* The Original Software is NetBeans. The Initial Developer of the Original
92
* The Original Software is NetBeans. The Initial Developer of the Original
89
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
93
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
90
* Microsystems, Inc. All Rights Reserved.
94
* Microsystems, Inc. All Rights Reserved.
91
*/
95
*/
92
*
96
*
93
* @author Jiri Rechtacek
97
* @author Jiri Rechtacek
94
*/
98
*/
95
   
99
   
96
   /** Shows Options dialog. */
100
   /** Shows Options dialog. */
97
   public static final void show () {
101
   public static final void show () {
98
       new OptionsWindowAction ().openOptionsWindow ();
102
       new OptionsWindowAction ().openOptionsWindow ();
99
   }
103
   }
100
   
104
   

Return to bug 75856