Issue #2119 Added check when no selected lid.

Change-Id: Ia85dbc8957353ba44e94f7aa7b28cab0787165ac

Former-commit-id: 541b7fbc93 [formerly dc5059f06b] [formerly 541b7fbc93 [formerly dc5059f06b] [formerly e7dc1184b1 [formerly 4a64a5b44a05a1c91b9a3d878ea0806e68c6d788]]]
Former-commit-id: e7dc1184b1
Former-commit-id: dc0e31fcdd [formerly 440ea0fc25]
Former-commit-id: c549efa0c1
This commit is contained in:
Roger Ferrel 2013-06-19 14:16:38 -05:00
parent 83081bebe2
commit a4bee23421
2 changed files with 13 additions and 22 deletions

View file

@ -40,6 +40,7 @@ import com.raytheon.viz.hydrocommon.HydroDisplayManager;
* 6/27/06 lvenable Initial creation. * 6/27/06 lvenable Initial creation.
* 02/07/2013 1578 rferrel Changes for non-blocking ProductViewerDlg. * 02/07/2013 1578 rferrel Changes for non-blocking ProductViewerDlg.
* 03/27/2013 1790 rferrel Bug fix for non-blocking dialogs. * 03/27/2013 1790 rferrel Bug fix for non-blocking dialogs.
* 06/19/2013 2119 rferrel Changed check for no selected lid.
* *
* </pre> * </pre>
* *
@ -59,19 +60,18 @@ public class ProductViewerAction extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
String currentLid = HydroDisplayManager.getInstance().getCurrentLid(); HydroDisplayManager manager = HydroDisplayManager.getInstance();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
if (dialog == null || dialog.isDisposed()) { if (manager.isCurrentLidSelected(shell)) {
if (dialog == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() dialog = new ProductViewerDlg(shell);
.getShell(); dialog.open();
dialog = new ProductViewerDlg(shell); } else {
dialog.open(); dialog.setLid(manager.getCurrentLid());
} else { dialog.bringToTop();
dialog.bringToTop(); }
}
if (currentLid != null) {
dialog.setLid(currentLid);
} }
return null; return null;
} }

View file

@ -65,6 +65,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 12/11/2009 2488 mpduff Refactored dialog to work as * 12/11/2009 2488 mpduff Refactored dialog to work as
* in AWIPS 1 * in AWIPS 1
* 02/07/2013 1578 rferrel Make dialog non-blocking. * 02/07/2013 1578 rferrel Make dialog non-blocking.
* 06/19/2013 2119 rferrel Remove no longer needed shouldOpen.
* *
* </pre> * </pre>
* *
@ -211,16 +212,6 @@ public class ProductViewerDlg extends CaveSWTDialog {
loadProductList(); loadProductList();
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#shouldOpen()
*/
@Override
protected boolean shouldOpen() {
return HydroDisplayManager.getInstance().isCurrentLidSelected(shell);
}
/** /**
* Create the Product Information group container. * Create the Product Information group container.
*/ */