Issue #1287 Changes for non-blocking PublishDialog.

Change-Id: I551850f82ad40bfa9c49d10c6b8193ec365ccea2

Former-commit-id: 93472a82e5 [formerly 833b7bb850 [formerly a0b4c4eb635ce39cf1a25c78620d317e59d33061]]
Former-commit-id: 833b7bb850
Former-commit-id: 4c40059a5a
This commit is contained in:
Roger Ferrel 2012-10-25 15:38:50 -05:00
parent a982185c63
commit e312a9313c
3 changed files with 31 additions and 15 deletions

View file

@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 6, 2008 Eric Babin Initial Creation
* Oct 25, 2012 1287 rferrel Changes for non-blocking PublishDialog.
*
* </pre>
*
@ -44,6 +45,7 @@ import com.raytheon.viz.gfe.dialogs.PublishDialog;
*/
public class ShowPublishDialog extends AbstractHandler {
private PublishDialog dialog;
/*
* (non-Javadoc)
@ -54,14 +56,21 @@ public class ShowPublishDialog extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
DataManager dm = DataManager.getCurrentInstance();
if (dm != null) {
if (dm == null) {
return null;
}
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
PublishDialog dialog = new PublishDialog(shell, dm);
dialog.setBlockOnOpen(true);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
return null;
@ -80,8 +89,8 @@ public class ShowPublishDialog extends AbstractHandler {
DataManager dm = DataManager.getCurrentInstance();
if (dm != null) {
return !dm.getParmManager().getMutableDatabase().equals(
dm.getParmManager().getProductDB());
return !dm.getParmManager().getMutableDatabase()
.equals(dm.getParmManager().getProductDB());
}
return false;
}

View file

@ -64,6 +64,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* ------------ ---------- ----------- --------------------------
* Mar 7, 2008 Eric Babin Initial Creation
* Oct 27, 2012 1287 rferrel Code cleanup for non-blocking dialog.
* Oct 25, 2012 1287 rferrel Code changes for non-blocking PublishDialog.
*
* </pre>
*
@ -95,6 +96,8 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
private DatabaseID mutableDB;
private PublishDialog publishDlg;
public ProductScriptsDialog(Shell parent, DataManager dataManager) {
super(parent);
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
@ -116,9 +119,14 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
}
private void launchPublishToOfficial() {
PublishDialog dialog = new PublishDialog(getParentShell(), dataManager);
dialog.setBlockOnOpen(true);
dialog.open();
if (publishDlg == null || publishDlg.getShell() == null
|| publishDlg.isDisposed()) {
publishDlg = new PublishDialog(getParentShell(), dataManager);
publishDlg.setBlockOnOpen(false);
publishDlg.open();
} else {
publishDlg.bringToTop();
}
}
@Override

View file

@ -76,6 +76,7 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* Mar 6, 2008 Eric Babin Initial Creation
* Sep 01, 2009 #1370 randerso Completely reworked
* Aug 05, 2010 6698 mpduff Moved Publish work to its own thread.
* Oct 25, 2012 1287 rferrel Code cleanup for non-blocking dialog.
*
* </pre>
*
@ -83,12 +84,12 @@ import com.raytheon.viz.ui.widgets.ToggleSelectList;
* @version 1.0
*/
public class PublishDialog extends CaveJFACEDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus
private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(PublishDialog.class);
private static final int MAX_LIST_HEIGHT = 10;
private final int MAX_LIST_HEIGHT = 10;
private static final PythonPreferenceStore prefs = Activator.getDefault()
private final PythonPreferenceStore prefs = Activator.getDefault()
.getPreferenceStore();
private static Boolean IscStateP;
@ -514,8 +515,6 @@ public class PublishDialog extends CaveJFACEDialog {
@Override
protected void okPressed() {
this.getShell().setEnabled(false);
// getButton(IDialogConstants.OK_ID).setEnabled(false);
// getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
publishCB();
}
}