From 60fd298721bc6525c6f740280504f3d994008842 Mon Sep 17 00:00:00 2001 From: Nate Jensen Date: Mon, 17 Feb 2014 17:10:07 -0600 Subject: [PATCH] Issue #2704 fix alertviz connectivity checks Former-commit-id: 742217ded005cdd88b5d60a6283f6226381b4f8d [formerly 0160ab046428a73a816f94399cf74e737b995f79] [formerly 0c4de50218247da8cd5816119ae3aa0b6244ba7a] [formerly 4d6899452598f711ecf3db4937ebb2670adeae8a [formerly 0c4de50218247da8cd5816119ae3aa0b6244ba7a [formerly adfb9c293456aeced60e3ab41575d8b3b0f635b8]]] Former-commit-id: 4d6899452598f711ecf3db4937ebb2670adeae8a Former-commit-id: 4ab3a27b137394410a2b8da012bfe21a237dd4b6 [formerly 228ab8dd60a06fb6400925cdf701c9b8895adabe] Former-commit-id: 121bcd184ac0d938902a8f06e03be0f7b6853f33 --- .../ConnectivityPreferenceDialog.java | 13 +++++++------ .../ui/ThinClientConnectivityDialog.java | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/ConnectivityPreferenceDialog.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/ConnectivityPreferenceDialog.java index 13b359cdeb..354200de15 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/ConnectivityPreferenceDialog.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/ConnectivityPreferenceDialog.java @@ -68,6 +68,7 @@ import com.raytheon.uf.viz.core.comm.IConnectivityCallback; * Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking. * Feb 04, 2014 2704 njensen Shifted some private fields/methods to protected, * Added status and details, better site validation + * Feb 17, 2014 2704 njensen Changed some alertviz fields to protected * * * @@ -117,15 +118,15 @@ public class ConnectivityPreferenceDialog extends Dialog { private Label localizationLabel; - private Text localizationText; + protected Text localizationText; private String localization = ""; private boolean localizationGood = false; - private Text alertVizText; + protected Text alertVizText; - private String alertVizServer = null; + protected String alertVizServer = null; private boolean alertVizGood = true; @@ -460,7 +461,7 @@ public class ConnectivityPreferenceDialog extends Dialog { localizationCallback); } - private void validateAlertviz() { + protected void validateAlertviz() { ConnectivityManager.checkAlertService(alertVizServer, alertCallback); } @@ -657,8 +658,8 @@ public class ConnectivityPreferenceDialog extends Dialog { if (status != null) { statusLabel.setText(status); } else { - throw new IllegalStateException( - "Connectivity dialog received non-good status without status message"); + // shoudln't be able to reach this but just in case + statusLabel.setText("Connection error"); } } } diff --git a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ui/ThinClientConnectivityDialog.java b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ui/ThinClientConnectivityDialog.java index b175c5a886..76835e644d 100644 --- a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ui/ThinClientConnectivityDialog.java +++ b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ui/ThinClientConnectivityDialog.java @@ -61,6 +61,7 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants; * Nov 23, 2011 bsteffen Initial creation * Aug 02, 2013 2202 bsteffen Add edex specific connectivity checking. * Feb 04, 2014 2704 njensen Refactored + * Feb 17, 2014 2704 njensen Added checks for alertviz connectivity * * * @@ -303,6 +304,16 @@ public class ThinClientConnectivityDialog extends ConnectivityPreferenceDialog { siteText.setBackground(getTextColor(isSiteGood())); } + // validate alertviz + // apparently alertvizserver == null means it's alertviz itself + if (alertVizServer != null) { + if (alertVizText != null && !alertVizText.isDisposed()) { + setAlertVizServer(alertVizText.getText()); + super.validateAlertviz(); + alertVizText.setBackground(getTextColor(isAlertVizGood())); + } + } + boolean everythingGood = servicesGood && pypiesGood && isSiteGood() && isAlertVizGood() && jmsGood; updateStatus(everythingGood, status, details); @@ -326,6 +337,11 @@ public class ThinClientConnectivityDialog extends ConnectivityPreferenceDialog { useProxy = useProxyCheck.getSelection(); proxyText.setEnabled(useProxy); super.setLocalizationEnabled(!useProxy); + if (useProxy) { + if (localizationText != null && !localizationText.isDisposed()) { + localizationText.setBackground(getTextColor(true)); + } + } validate(); }