Merge "Issue #1287 Chamges for non-blocking GridsInterpolateDialog." into development
Former-commit-id:38ceefb7ef
[formerly b9746712b90aa685c91b4f484e5eed9bfc920a8b] Former-commit-id:14294c1984
This commit is contained in:
commit
3f5bf75b08
2 changed files with 34 additions and 12 deletions
|
@ -30,6 +30,7 @@ import com.raytheon.viz.gfe.core.DataManager;
|
||||||
import com.raytheon.viz.gfe.core.parm.Parm.InterpState;
|
import com.raytheon.viz.gfe.core.parm.Parm.InterpState;
|
||||||
import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode;
|
import com.raytheon.viz.gfe.core.parm.ParmState.InterpMode;
|
||||||
import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler to show Grid Interpolation Dialog and initiate interpolation
|
* Handler to show Grid Interpolation Dialog and initiate interpolation
|
||||||
|
@ -40,6 +41,7 @@ import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
* ------------ ---------- -------------- --------------------------
|
* ------------ ---------- -------------- --------------------------
|
||||||
* Feb 27, 2008 Eric Babin Initial Creation
|
* Feb 27, 2008 Eric Babin Initial Creation
|
||||||
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
||||||
|
* Oct 25, 2012 #1287 rferrel Changes for non-blocking GridsInterpolateDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -48,6 +50,7 @@ import com.raytheon.viz.gfe.dialogs.GridsInterpolateDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ShowGridsInterpolationDialog extends AbstractHandler {
|
public class ShowGridsInterpolationDialog extends AbstractHandler {
|
||||||
|
private GridsInterpolateDialog dialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
@ -58,20 +61,38 @@ public class ShowGridsInterpolationDialog extends AbstractHandler {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
|
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
.getShell();
|
.getShell();
|
||||||
|
|
||||||
GridsInterpolateDialog dialog = new GridsInterpolateDialog(shell);
|
dialog = new GridsInterpolateDialog(shell);
|
||||||
dialog.setBlockOnOpen(true);
|
dialog.setBlockOnOpen(false);
|
||||||
|
dialog.setCloseCallback(new ICloseCallback() {
|
||||||
|
|
||||||
if (dialog.open() == IDialogConstants.OK_ID) {
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof Integer) {
|
||||||
|
int returnCode = (Integer) returnValue;
|
||||||
|
if (returnCode == IDialogConstants.OK_ID) {
|
||||||
InterpMode interpMode = dialog.getInterpMode();
|
InterpMode interpMode = dialog.getInterpMode();
|
||||||
int interval = dialog.getInterval() * 3600;
|
int interval = dialog.getInterval() * 3600;
|
||||||
int duration = dialog.getDuration() * 3600;
|
int duration = dialog.getDuration() * 3600;
|
||||||
|
|
||||||
DataManager.getCurrentInstance().getParmOp().interpolateSelected(
|
DataManager
|
||||||
interpMode, InterpState.ASYNC, interval, duration);
|
.getCurrentInstance()
|
||||||
} // else do nothing...
|
.getParmOp()
|
||||||
|
.interpolateSelected(interpMode,
|
||||||
|
InterpState.ASYNC, interval,
|
||||||
|
duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialog = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.open();
|
||||||
|
} else {
|
||||||
|
dialog.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||||
* ------------ ---------- -------------- --------------------------
|
* ------------ ---------- -------------- --------------------------
|
||||||
* Feb 26, 2008 Eric Babin Initial Creation
|
* Feb 26, 2008 Eric Babin Initial Creation
|
||||||
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
* Jun 4, 2008 #1161 Ron Anderson Reworked
|
||||||
|
* Oct 25, 2012 #1287 rferrel Code clean for non-blocking dialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -60,7 +61,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GridsInterpolateDialog extends CaveJFACEDialog {
|
public class GridsInterpolateDialog extends CaveJFACEDialog {
|
||||||
private static final int MAX_INTERVAL = 24;
|
private final int MAX_INTERVAL = 24;
|
||||||
|
|
||||||
private Composite top;
|
private Composite top;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue