Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 97571 Details for
Bug 228739
[Proxy] add UI support to see what the automatically detected proxy settings are
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for UI and underlying changes
228739.txt (text/plain), 15.92 KB, created by
Francis Upton IV
on 2008-04-25 02:45:20 EDT
(
hide
)
Description:
Patch for UI and underlying changes
Filename:
MIME Type:
Creator:
Francis Upton IV
Created:
2008-04-25 02:45:20 EDT
Size:
15.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.net >Index: src/org/eclipse/ui/internal/net/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/ui/internal/net/messages.properties 14 Apr 2008 13:37:59 -0000 1.5 >+++ src/org/eclipse/ui/internal/net/messages.properties 25 Apr 2008 06:42:24 -0000 >@@ -10,6 +10,7 @@ > # yyyymmdd bug Email and other contact information > # -------- -------- ----------------------------------------------------------- > # 20070201 154100 pmoogk@ca.ibm.com - Peter Moogk, Port internet code from WTP to Eclipse base. >+# 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software) > ############################################################################### > > # >@@ -45,8 +46,15 @@ > ProxyPreferencePage_42=Invalid port > ProxyPreferencePage_43=The port must be an integer > ProxyPreferencePage_44=System proxy configuration (if available) >-ProxyPreferencePage_45=Specifies that system proxy settings are used to access the Internet. If such settings can't be retrieved, no proxy should be used. >-UserValidationDialog_0=Password Required >+ProxyPreferencePage_45=Specifies that system proxy settings are used to access the Internet. If these settings can't be retrieved, no proxy is used. >+ProxyPreferencePage_showSystemConfig_button=Show >+ProxyPreferencePage_showSystemConfig_tooltip=Shows the current values of the system proxy configuration. >+ProxyPreferencePage_showConfigDialogTitle=These values were determined from your system configuration: >+ProxyPreferencePage_showConfigDialog_None=No system proxy configuration information was found. >+ProxyPreferencePage_showConfigDialog_Protocol=Protocol >+ProxyPreferencePage_showConfigDialog_SourceValue=Source/Value >+ProxyPreferencePage_showConfigDialog_User=User: >+ProxyPreferencePage_showConfigDialog_Password=Password: > UserValidationDialog_1=Connect to: {0} > UserValidationDialog_2=&Password: > UserValidationDialog_3=&User name: >Index: src/org/eclipse/ui/internal/net/NetUIMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/NetUIMessages.java,v >retrieving revision 1.5 >diff -u -r1.5 NetUIMessages.java >--- src/org/eclipse/ui/internal/net/NetUIMessages.java 14 Apr 2008 13:37:59 -0000 1.5 >+++ src/org/eclipse/ui/internal/net/NetUIMessages.java 25 Apr 2008 06:42:23 -0000 >@@ -10,6 +10,7 @@ > * yyyymmdd bug Email and other contact information > * -------- -------- ----------------------------------------------------------- > * 20070201 154100 pmoogk@ca.ibm.com - Peter Moogk, Port internet code from WTP to Eclipse base. >+ * 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software) > *******************************************************************************/ > package org.eclipse.ui.internal.net; > >@@ -76,11 +77,27 @@ > public static String ProxyPreferencePage_8; > > public static String ProxyPreferencePage_9; >- >+ > public static String ProxyPreferencePage_44; >- >+ > public static String ProxyPreferencePage_45; > >+ public static String ProxyPreferencePage_showSystemConfig_button; >+ >+ public static String ProxyPreferencePage_showSystemConfig_tooltip; >+ >+ public static String ProxyPreferencePage_showConfigDialogTitle; >+ >+ public static String ProxyPreferencePage_showConfigDialog_None; >+ >+ public static String ProxyPreferencePage_showConfigDialog_Protocol; >+ >+ public static String ProxyPreferencePage_showConfigDialog_SourceValue; >+ >+ public static String ProxyPreferencePage_showConfigDialog_User; >+ >+ public static String ProxyPreferencePage_showConfigDialog_Password; >+ > public static String TITLE_PREFERENCE_HOSTS_DIALOG; > > public static String LABEL_PREFERENCE_HOSTS_DIALOG; >Index: src/org/eclipse/ui/internal/net/ProxyPreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/ProxyPreferencePage.java,v >retrieving revision 1.11 >diff -u -r1.11 ProxyPreferencePage.java >--- src/org/eclipse/ui/internal/net/ProxyPreferencePage.java 14 Apr 2008 13:37:59 -0000 1.11 >+++ src/org/eclipse/ui/internal/net/ProxyPreferencePage.java 25 Apr 2008 06:42:24 -0000 >@@ -15,13 +15,18 @@ > * 20070402 180622 brockj@tpg.com.au - Brock Janiczak, Inconsistent enablement states in network preference page > * 20070416 177897 ymnk@jcraft.com - Atsuhiko Yamanaka, Improve UI of Proxy Preferences Page > * 20070801 197977 holger.oehm@sap.com - Holger Oehm, [Proxy] non-proxy hosts not correctly updated >+ * 20080424 228739 francisu@ieee.org - Francis Upton (Oakland Software), dialog for system prop values > *******************************************************************************/ > package org.eclipse.ui.internal.net; > >+import org.eclipse.core.internal.net.ProxyData; >+import org.eclipse.core.internal.net.ProxyManager; > import org.eclipse.core.net.proxy.IProxyData; > import org.eclipse.core.net.proxy.IProxyService; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.preference.PreferencePage; > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; >@@ -34,6 +39,7 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPreferencePage; >@@ -46,9 +52,11 @@ > = "org.eclipse.ui.net.proxy_preference_page_context"; //$NON-NLS-1$ > > Entry[] entryList; >+ Button systemProxyConfigurationButton; > Button directConnectionToButton; > Button manualProxyConfigurationButton; > Button useSameProxyButton; >+ Button showSystemProxyConfigButton; > private Label nonHostLabel; > private NonProxyHostsComposite nonHostComposite; > Button enableProxyAuth; >@@ -57,7 +65,6 @@ > Text userid; > Text password; > private IProxyService proxyService; >- Button systemProxyConfigurationButton; > > public ProxyPreferencePage() { > super(NetUIMessages.ProxyPreferencePage_2); >@@ -84,30 +91,59 @@ > entryList[i] = new Entry(pd); > } > >- Composite composite = new Composite(parent, SWT.NONE); >+ final Composite composite = new Composite(parent, SWT.NONE); > GridLayout layout = new GridLayout(); > layout.numColumns = 1; > layout.marginRight = 5; > layout.marginTop = 5; > layout.marginWidth = 0; > composite.setLayout(layout); >- GridData data = new GridData(GridData.FILL_BOTH); >- composite.setLayoutData(data); >+ composite.setLayoutData(new GridData(GridData.FILL_BOTH)); > >- systemProxyConfigurationButton = new Button(composite, SWT.RADIO); >- systemProxyConfigurationButton.setLayoutData(new GridData()); >- systemProxyConfigurationButton.setText(NetUIMessages.ProxyPreferencePage_44); >+ Composite sysComposite = new Composite(composite, SWT.NONE); >+ layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginTop = 0; >+ layout.marginBottom = 0; >+ layout.marginWidth = 0; >+ sysComposite.setLayout(layout); >+ sysComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ systemProxyConfigurationButton = new Button(sysComposite, SWT.RADIO); >+ systemProxyConfigurationButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false)); >+ systemProxyConfigurationButton >+ .setText(NetUIMessages.ProxyPreferencePage_44); > systemProxyConfigurationButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_45); >- systemProxyConfigurationButton.addSelectionListener(new SelectionAdapter() { >- public void widgetSelected(SelectionEvent e) { >- if (systemProxyConfigurationButton.getSelection()) >- enableControls(false); >- } >- }); >+ systemProxyConfigurationButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ if (systemProxyConfigurationButton.getSelection()) >+ enableControls(false); >+ } >+ }); > >- directConnectionToButton = new Button(composite, SWT.RADIO); >- directConnectionToButton.setLayoutData(new GridData()); >+ showSystemProxyConfigButton = new Button(sysComposite, SWT.PUSH); >+ showSystemProxyConfigButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_END, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false)); >+ showSystemProxyConfigButton >+ .setText(NetUIMessages.ProxyPreferencePage_showSystemConfig_button); >+ showSystemProxyConfigButton >+ .setToolTipText(NetUIMessages.ProxyPreferencePage_showSystemConfig_tooltip); >+ showSystemProxyConfigButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ showSystemProxyInfo(composite.getShell()); >+ } >+ }); >+ >+ directConnectionToButton = new Button(sysComposite, SWT.RADIO); >+ directConnectionToButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false, 2, 1)); > directConnectionToButton.setText(NetUIMessages.ProxyPreferencePage_3); > directConnectionToButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_1); >@@ -118,17 +154,21 @@ > } > }); > >- manualProxyConfigurationButton = new Button(composite, SWT.RADIO); >+ manualProxyConfigurationButton = new Button(sysComposite, SWT.RADIO); >+ manualProxyConfigurationButton.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, true, false, 2, 1)); > manualProxyConfigurationButton > .setText(NetUIMessages.ProxyPreferencePage_4); > manualProxyConfigurationButton > .setToolTipText(NetUIMessages.ProxyPreferencePage_0); >- manualProxyConfigurationButton.addSelectionListener(new SelectionAdapter() { >- public void widgetSelected(SelectionEvent e) { >- if (manualProxyConfigurationButton.getSelection()) >- enableControls(true); >- } >- }); >+ manualProxyConfigurationButton >+ .addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ if (manualProxyConfigurationButton.getSelection()) >+ enableControls(true); >+ } >+ }); > > final Composite manualProxyConfigurationComposite = new Composite( > composite, SWT.NONE); >@@ -231,6 +271,105 @@ > return composite; > } > >+ protected void showSystemProxyInfo(Shell shell) { >+ final ProxyData[] pds = ((ProxyManager) ProxyManager.getProxyManager()).getSystemProxyData(); >+ >+ Dialog dialog = new Dialog(shell) { >+ protected boolean isResizable() { >+ return true; >+ } >+ >+ protected Control createDialogArea(Composite parent) { >+ Composite c = (Composite) super.createDialogArea(parent); >+ >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginTop = 5; >+ layout.marginBottom = 5; >+ layout.marginWidth = 10; >+ c.setLayout(layout); >+ c.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ >+ Label l; >+ >+ if (pds.length == 0) { >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_None); >+ l.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false, 2, >+ 1)); >+ return c; >+ } >+ >+ l = new Label(c, SWT.NONE); >+ l.setText(NetUIMessages.ProxyPreferencePage_showConfigDialogTitle); >+ l.setLayoutData(new GridData( >+ GridData.HORIZONTAL_ALIGN_BEGINNING, >+ GridData.VERTICAL_ALIGN_BEGINNING, false, false, 2, 1)); >+ >+ l = new Label(c, SWT.NONE); >+ l = new Label(c, SWT.NONE); >+ >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_Protocol); >+ l = new Label(c, SWT.NONE); >+ l >+ .setText(NetUIMessages.ProxyPreferencePage_showConfigDialog_SourceValue); >+ >+ for (int i = 0; i < pds.length; i++) { >+ l = new Label(c, SWT.NONE); >+ l.setText(pds[i].getType()); >+ l = new Label(c, SWT.NONE); >+ l.setText(pds[i].getSource()); >+ >+ l = new Label(c, SWT.NONE); >+ l.setText(""); //$NON-NLS-1$ >+ l = new Label(c, SWT.NONE); >+ l.setText(buildLabelString(pds[i])); >+ } >+ return c; >+ } >+ >+ protected String buildLabelString(ProxyData pd) { >+ StringBuffer sb = new StringBuffer(); >+ sb.append(pd.getHost()); >+ if (pd.getPort() != 0) { >+ sb.append(":"); //$NON-NLS-1$ >+ sb.append(pd.getPort()); >+ } >+ if (pd.getUserId() != null) { >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(NetUIMessages.ProxyPreferencePage_showConfigDialog_User); >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(pd.getUserId()); >+ if (pd.getPassword() != null) { >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(NetUIMessages.ProxyPreferencePage_showConfigDialog_Password); >+ sb.append(" "); //$NON-NLS-1$ >+ sb.append(pd.getPassword()); >+ } >+ } >+ return sb.toString(); >+ } >+ >+ protected void configureShell(Shell shell) { >+ super.configureShell(shell); >+ shell.setText("System Proxy Configuration"); //$NON-NLS-1$ >+ } >+ >+ protected void createButtonsForButtonBar(Composite parent) { >+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, >+ true); >+ } >+ >+ }; >+ >+ dialog.open(); >+ } >+ > protected void performApply() { > if (proxyService == null) > return; >#P org.eclipse.core.net >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/META-INF/MANIFEST.MF,v >retrieving revision 1.9 >diff -u -r1.9 MANIFEST.MF >--- META-INF/MANIFEST.MF 18 Apr 2008 10:04:49 -0000 1.9 >+++ META-INF/MANIFEST.MF 25 Apr 2008 06:42:25 -0000 >@@ -12,7 +12,8 @@ > org.eclipse.osgi;bundle-version="3.4.0", > org.eclipse.equinox.registry;bundle-version="3.4.0" > Bundle-ActivationPolicy: lazy >-Export-Package: org.eclipse.core.internal.net;x-internal:=true, >+Export-Package: org.eclipse.core.internal.net;x-friends:="org.eclipse.ui.net", >+ org.eclipse.core.internal.net.proxy.unix, > org.eclipse.core.net.proxy > Bundle-RequiredExecutionEnvironment: J2SE-1.4, > CDC-1.0/Foundation-1.0, >Index: src/org/eclipse/core/internal/net/ProxyManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java,v >retrieving revision 1.14 >diff -u -r1.14 ProxyManager.java >--- src/org/eclipse/core/internal/net/ProxyManager.java 18 Apr 2008 10:04:49 -0000 1.14 >+++ src/org/eclipse/core/internal/net/ProxyManager.java 25 Apr 2008 06:42:25 -0000 >@@ -7,6 +7,8 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Oakland Software Incorporated (Francis Upton) francisu@ieee.org >+ * Bug 228739 - add UI support to show actual system config > *******************************************************************************/ > package org.eclipse.core.internal.net; > >@@ -175,6 +177,28 @@ > doSetProxyData(proxies); > } > >+ // Used for the UI to see how we got the current system proxy config >+ public ProxyData[] getSystemProxyData() { >+ if (nativeProxyProvider == null) >+ return new ProxyData[] {}; >+ List pdList = new ArrayList(); >+ >+ try { >+ for (int i = 0; i < proxies.length; i++) { >+ ProxyType type = proxies[i]; >+ // All we care about is the protocol, the rest of the URI does not matter >+ IProxyData[] nativeResult = nativeProxyProvider.getProxyData(new URI(type >+ .getName() >+ + "://dummyhost")); //$NON-NLS-1$ >+ for (int nr = 0;nr < nativeResult.length; nr++) >+ pdList.add(nativeResult[nr]); >+ } >+ } catch (URISyntaxException e) { >+ Activator.logError("Unexpected exception", e); //$NON-NLS-1$ >+ } >+ return (ProxyData[]) pdList.toArray(new ProxyData[]{}); >+ } >+ > private void doSetProxyData(IProxyData[] proxyDatas) { > IProxyData[] oldData = getProxyData(); > String[] hosts = getNonProxiedHosts();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228739
:
97571
|
98755
|
115783
|
118282
|
118360