Omaha #3236 thin client pref page supports proxy server as text or combo
field Change-Id: I7514d27a9b404e1c33cb6f7292475ff99bed4de0 Former-commit-id:e5c3c32bcb
[formerlyf4c1691c8d
] [formerlye5c3c32bcb
[formerlyf4c1691c8d
] [formerly061482b015
[formerly 1a9433a524e5b8267fc3303db0763ac4685ec46d]]] Former-commit-id:061482b015
Former-commit-id:dc99cf6c15
[formerly40a3c0a372
] Former-commit-id:392ddd5ce0
This commit is contained in:
parent
dce9962e54
commit
f957dd8e18
2 changed files with 34 additions and 10 deletions
|
@ -22,7 +22,6 @@ package com.raytheon.uf.viz.thinclient.cave.preferences;
|
|||
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.jface.preference.StringFieldEditor;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
|
@ -30,11 +29,12 @@ import org.eclipse.swt.events.SelectionEvent;
|
|||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.viz.core.comm.ConnectivityManager;
|
||||
import com.raytheon.uf.viz.core.comm.ConnectivityManager.ConnectivityResult;
|
||||
import com.raytheon.uf.viz.core.comm.IConnectivityCallback;
|
||||
import com.raytheon.uf.viz.core.localization.TextOrCombo;
|
||||
import com.raytheon.uf.viz.core.localization.TextOrComboEditor;
|
||||
import com.raytheon.uf.viz.thinclient.Activator;
|
||||
import com.raytheon.uf.viz.thinclient.ThinClientUriUtil;
|
||||
import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
||||
|
@ -53,6 +53,7 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
|||
* preference.
|
||||
* Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking.
|
||||
* Feb 04, 2014 2704 njensen Only one field for proxy server
|
||||
* Jun 26, 2014 3236 njensen Proxy server can now be text or combo field
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,7 +64,7 @@ public class ThinClientServerPreferences extends FieldEditorPreferencePage {
|
|||
|
||||
private BooleanFieldEditor useProxies;
|
||||
|
||||
private StringFieldEditor proxyServer;
|
||||
private TextOrComboEditor proxyServer;
|
||||
|
||||
private Button connectivityButton;
|
||||
|
||||
|
@ -86,15 +87,23 @@ public class ThinClientServerPreferences extends FieldEditorPreferencePage {
|
|||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
|
||||
useProxies = new BooleanFieldEditor(
|
||||
ThinClientPreferenceConstants.P_USE_PROXIES,
|
||||
"&Use Proxy Servers", getFieldEditorParent());
|
||||
|
||||
addField(useProxies);
|
||||
proxyServer = new StringFieldEditor(
|
||||
proxyServer = new TextOrComboEditor(getFieldEditorParent(),
|
||||
this.getPreferenceStore(),
|
||||
ThinClientPreferenceConstants.P_PROXY_ADDRESS,
|
||||
"&Proxy Address: ", getFieldEditorParent());
|
||||
ThinClientPreferenceConstants.P_PROXY_SERVER_OPTIONS,
|
||||
"&Proxy Address: ");
|
||||
proxyServer.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkConnectivity();
|
||||
}
|
||||
});
|
||||
|
||||
proxyServer.setErrorMessage("Cannot connect to Proxy server");
|
||||
addField(proxyServer);
|
||||
|
||||
|
@ -132,7 +141,8 @@ public class ThinClientServerPreferences extends FieldEditorPreferencePage {
|
|||
boolean serverError = false;
|
||||
|
||||
// check HTTP Server
|
||||
Text text = proxyServer.getTextControl(getFieldEditorParent());
|
||||
TextOrCombo text = proxyServer
|
||||
.getTextOrComboControl(getFieldEditorParent());
|
||||
String proxyAddr = text.getText().trim();
|
||||
ConnectivityManager.checkLocalizationServer(
|
||||
ThinClientUriUtil.getServicesAddress(proxyAddr),
|
||||
|
@ -154,10 +164,10 @@ public class ThinClientServerPreferences extends FieldEditorPreferencePage {
|
|||
});
|
||||
|
||||
if (servicesResult.hasConnectivity && pypiesResult.hasConnectivity) {
|
||||
text.setBackground(Display.getDefault().getSystemColor(
|
||||
SWT.COLOR_WHITE));
|
||||
text.widget.setBackground(null);
|
||||
proxyServer.clearErrorMessage();
|
||||
} else {
|
||||
text.setBackground(Display.getDefault().getSystemColor(
|
||||
text.widget.setBackground(Display.getDefault().getSystemColor(
|
||||
SWT.COLOR_RED));
|
||||
serverError = true;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -194,6 +195,19 @@ public class ThinClientConnectivityDialog extends ConnectivityPreferenceDialog {
|
|||
proxySrv.widget.setLayoutData(gd);
|
||||
proxySrv.setText(proxyAddress == null ? "" : proxyAddress);
|
||||
proxySrv.widget.setBackground(getTextColor(servicesGood && pypiesGood));
|
||||
proxySrv.addSelectionListener(new SelectionListener() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
// user clicked an option
|
||||
validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
// user hit Enter
|
||||
performOk();
|
||||
}
|
||||
});
|
||||
|
||||
new Label(textBoxComp, SWT.NONE);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue