diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/Activator.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/Activator.java index 4acd865522..3416f2bdc0 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/Activator.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/Activator.java @@ -34,6 +34,20 @@ import com.raytheon.viz.gfe.smarttool.script.SmartToolJob; /** * The activator class controls the plug-in life cycle + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ *                                     Initial creation
+ * Oct 30, 2012 1298       rferrel     Must be a blocking dialog.
+ * 
+ * 
+ * + * @author unknown + * @version 1.0 */ public class Activator extends AbstractUIPlugin implements BundleActivator { private static final transient IUFStatusHandler statusHandler = UFStatus @@ -101,17 +115,22 @@ public class Activator extends AbstractUIPlugin implements BundleActivator { public PythonPreferenceStore getPreferenceStore() { synchronized (this) { if (pythonPrefs == null) { - if (cfgDlg == null) { + if (cfgDlg == null || cfgDlg.getShell() == null + || cfgDlg.isDisposed()) { cfgDlg = new GFEConfigDialog( new Shell(Display.getDefault())); + // Must keep as a blocking dialog for eclipse plugins to + // work properly. + cfgDlg.setBlockOnOpen(true); + cfgDlg.open(); + } else { + cfgDlg.bringToTop(); } - cfgDlg.setBlockOnOpen(true); - cfgDlg.open(); - String config = cfgDlg.getConfig(); // this is necessary because we sometimes get in here // recursively and only want to do this once if (pythonPrefs == null) { + String config = cfgDlg.getConfig(); pythonPrefs = new PythonPreferenceStore(config); statusHandler.handle(Priority.EVENTA, "GFE started with configuration: " + config); diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java index a3d1c885f6..885b065b5e 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/GFEConfigDialog.java @@ -83,6 +83,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; * Date Ticket// Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 30, 2009 randerso Initial creation + * Oct 30, 2012 1298 rferrel Code cleanup for non-blocking dialog. * * * @@ -91,34 +92,33 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; */ public class GFEConfigDialog extends CaveJFACEDialog { - private static final transient IUFStatusHandler statusHandler = UFStatus + private final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GFEConfigDialog.class); - private static final String DEFAULT_CONFIG = "gfeConfig"; + private final String DEFAULT_CONFIG = "gfeConfig"; - private static final String LAST_CONFIG = FileUtil.join("gfe", - "lastConfig.txt"); + private final String LAST_CONFIG = FileUtil.join("gfe", "lastConfig.txt"); // Number of votes for Extra Photos - private static final int[][] splashVotes = new int[][] { { 14, 10 }, - { 15, 8 }, { 16, 7 }, { 17, 5 }, { 18, 5 }, { 19, 8 }, { 20, 5 }, - { 21, 7 }, { 22, 7 }, { 23, 5 }, { 24, 6 }, { 25, 9 }, { 26, 6 }, - { 27, 9 }, { 28, 8 } }; + private final int[][] splashVotes = new int[][] { { 14, 10 }, { 15, 8 }, + { 16, 7 }, { 17, 5 }, { 18, 5 }, { 19, 8 }, { 20, 5 }, { 21, 7 }, + { 22, 7 }, { 23, 5 }, { 24, 6 }, { 25, 9 }, { 26, 6 }, { 27, 9 }, + { 28, 8 } }; - private static final int[][] splashDist = new int[splashVotes.length][2]; + private final int[][] splashDist = new int[splashVotes.length][2]; // Percentage of time to show a winner - private static final double winnerThreshold = .65; + private final double winnerThreshold = .65; // Percentage of time to show an extra photo - private static final double extrasThreshold = .30; + private final double extrasThreshold = .30; // The remainder will be developer's choice photos - private static final int totalPics = 45; + private final int totalPics = 45; - private static final int totalVotes; + private final int totalVotes; - static { + { int val = 0; for (int i = 0; i < splashVotes.length; i++) { val += splashVotes[i][1]; @@ -128,7 +128,7 @@ public class GFEConfigDialog extends CaveJFACEDialog { totalVotes = val; } - private static Set usedImages = new HashSet(totalPics); + private Set usedImages = new HashSet(totalPics); private Image image;