1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-27 19:05:38 +02:00

Merge "Fix JSchConnection Proxy Link"

This commit is contained in:
John Eblen 2014-11-13 11:51:52 -05:00 committed by Gerrit Code Review @ Eclipse.org
commit cda4c419d6
2 changed files with 18 additions and 1 deletions

View file

@ -13,7 +13,7 @@ JSchConnectionPage_Edit_Connection=Edit Connection
JSchConnectionPage_Edit_properties_of_an_existing_connection=Edit properties of an existing connection
JSchConnectionPage_Please_enter_name_for_connection=Please enter a name for the connection
JSchConnectionPage_Proxy=SSH Proxy Settings
JSchConnectionPage_Help=If 'Local' is selected and proxy command is empty, no proxy is used.\nSee <a href=\"org.eclipse.ui.net.NetPreferences\">Network Connections</a> for SOCKS and HTTP proxy options.
JSchConnectionPage_Help=If 'Local' is selected and proxy command is empty, no proxy is used.\nSee <a>Network Connections</a> for SOCKS and HTTP proxy options.
JSchConnectionPage_SelectCommand=Enter a local or remote command such as 'nc %h %p'. Can be empty for an ssh gateway.
JSchConnectionPage_SelectConnection=Select 'Remote' for an ssh gateway or a remote proxy command.
JSchConnectionPage_Settings0=Connection Settings

View file

@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionManager;
@ -33,6 +34,7 @@ import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
@ -45,6 +47,7 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.IExpansionListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
@ -79,6 +82,7 @@ public class JSchConnectionPage extends WizardPage {
private final DataModifyListener fDataModifyListener = new DataModifyListener();
private RemoteConnectionWidget fProxyConnectionWidget;
private Text fProxyCommandText;
private static final String PREFS_PAGE_ID_NET_PROXY = "org.eclipse.ui.net.NetPreferences"; //$NON-NLS-1$
public JSchConnectionPage(IRemoteConnectionManager connMgr) {
super(Messages.JSchNewConnectionPage_New_Connection);
@ -289,6 +293,19 @@ public class JSchConnectionPage extends WizardPage {
Link link = new Link(proxyComp, SWT.WRAP);
final GridData linkLayoutData = new GridData(GridData.FILL_HORIZONTAL);
link.setLayoutData(linkLayoutData);
link.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferenceDialog dlg = PreferencesUtil.createPreferenceDialogOn(getShell(), PREFS_PAGE_ID_NET_PROXY,
new String[] { PREFS_PAGE_ID_NET_PROXY }, null);
dlg.open();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// ignore
}
});
linkLayoutData.widthHint = 400;
link.setText(Messages.JSchConnectionPage_Help);
}