Merge "Issue #1298 Changes for non-blocking SetValueDialog." into development

Former-commit-id: 7f22292e89e05b881466efd1d81ef851c454246a
This commit is contained in:
Lee Venable 2012-11-13 16:02:04 -06:00 committed by Gerrit Code Review
commit dbdfda1d04
3 changed files with 26 additions and 17 deletions

View file

@ -60,6 +60,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* 05Aug2008 #1407 ebabin Dim delta button for wx/discrete types. * 05Aug2008 #1407 ebabin Dim delta button for wx/discrete types.
* Oct 25, 2012 #1287 rferrel Code clean up part of non-blocking dialog. * Oct 25, 2012 #1287 rferrel Code clean up part of non-blocking dialog.
* Oct 13, 2012 #1298 rferrel Changes for non-blocking SetDeltaDialog. * Oct 13, 2012 #1298 rferrel Changes for non-blocking SetDeltaDialog.
* Changes for non-blocking SetValueDialog.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -111,7 +112,7 @@ public class EditActionsDialog extends CaveJFACEDialog implements
public EditActionsDialog(Shell parentShell) { public EditActionsDialog(Shell parentShell) {
super(parentShell); super(parentShell);
title = "Edit Actions"; title = "Edit Actions";
setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE | SWT.RESIZE); setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE);
dataManager = DataManager.getCurrentInstance(); dataManager = DataManager.getCurrentInstance();
parm = dataManager.getSpatialDisplayManager().getActivatedParm(); parm = dataManager.getSpatialDisplayManager().getActivatedParm();
@ -328,12 +329,7 @@ public class EditActionsDialog extends CaveJFACEDialog implements
} }
private void showPickupDialog() { private void showPickupDialog() {
Shell shell = getParentShell(); SetValueDialog.openDialog();
SetValueDialog svd = new SetValueDialog(shell, dataManager);
svd.setBlockOnOpen(false);
svd.open();
} }
/* /*

View file

@ -33,6 +33,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Monitor; import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType; import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
@ -52,6 +53,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jun 18, 2009 #1318 randerso Ported AWIPS I pickup value dialogs * Jun 18, 2009 #1318 randerso Ported AWIPS I pickup value dialogs
* Nov 13, 2012 #1298 rferrel Changes for non-blocking dialog.
* *
* </pre> * </pre>
* *
@ -62,9 +64,11 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
public class SetValueDialog extends CaveJFACEDialog implements public class SetValueDialog extends CaveJFACEDialog implements
IDisplayedParmListChangedListener, IActivatedParmChangedListener { IDisplayedParmListChangedListener, IActivatedParmChangedListener {
private static final int DISMISS_ID = IDialogConstants.CLIENT_ID + 1; private static SetValueDialog dialog;
private static final int ASSIGN_ID = IDialogConstants.CLIENT_ID + 0; private final int DISMISS_ID = IDialogConstants.CLIENT_ID + 1;
private final int ASSIGN_ID = IDialogConstants.CLIENT_ID + 0;
private DataManager dataManager; private DataManager dataManager;
@ -78,15 +82,26 @@ public class SetValueDialog extends CaveJFACEDialog implements
private Composite valueFrame; private Composite valueFrame;
public static void openDialog() {
if (dialog == null) {
Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
DataManager dataManager = DataManager.getCurrentInstance();
dialog = new SetValueDialog(parent, dataManager);
dialog.setBlockOnOpen(false);
}
dialog.open();
}
/** /**
* Constructor * Constructor is private use openDialog
* *
* @param parentShell * @param parentShell
* parent shell * parent shell
* @param dataManager * @param dataManager
* DataManager for the associated window * DataManager for the associated window
*/ */
public SetValueDialog(Shell parentShell, DataManager dataManager) { private SetValueDialog(Shell parentShell, DataManager dataManager) {
super(parentShell); super(parentShell);
this.dataManager = dataManager; this.dataManager = dataManager;
@ -191,6 +206,8 @@ public class SetValueDialog extends CaveJFACEDialog implements
setValue = null; setValue = null;
} }
SetValueDialog.dialog = null;
return super.close(); return super.close();
} }

View file

@ -99,6 +99,7 @@ import com.raytheon.viz.ui.input.InputAdapter;
* 06/03/2011 #8919 rferrel No longer display color bar when * 06/03/2011 #8919 rferrel No longer display color bar when
* VisMode is GRAPHIC * VisMode is GRAPHIC
* 11/13/20112 #1298 rferrel Changes for non-blocking SetDeltaDialog. * 11/13/20112 #1298 rferrel Changes for non-blocking SetDeltaDialog.
* Changes for non-blocking SetValueDialog.
* *
* </pre> * </pre>
* *
@ -535,12 +536,7 @@ public class GFEColorbarResource extends
} }
private void showPickupDialog() { private void showPickupDialog() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() SetValueDialog.openDialog();
.getShell();
SetValueDialog svd = new SetValueDialog(shell, dManager);
svd.setBlockOnOpen(false);
svd.open();
} }
private class SetPickupAction extends AbstractRightClickAction { private class SetPickupAction extends AbstractRightClickAction {