Issue #1298 Changes for non-blocking SelectionDlg.

Change-Id: I9829945037f8f5ce268eb3731302ae77e83d837b

Former-commit-id: 3087efb2e0 [formerly 5f3fab4677] [formerly ad5b18948318d625cd56d758188258585ea3e1ae [formerly 00693d83bb]] [formerly 59181213a0 [formerly 00693d83bb [formerly cd85c4e60fd3863c39a7c61ad73848207e196a05]]]
Former-commit-id: 59181213a0
Former-commit-id: c9f30770363ef819d269136eb35a07599220439c [formerly fdfcb2ebea]
Former-commit-id: d0cdc594f8
This commit is contained in:
Roger Ferrel 2012-11-15 12:54:44 -06:00
parent 4475544f1a
commit c2ccf9dd90
3 changed files with 28 additions and 5 deletions

View file

@ -48,6 +48,7 @@ import com.raytheon.viz.gfe.ui.runtimeui.SelectionDlg;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 4, 2008 njensen Initial creation
* Nov 15, 2012 1298 rferrel Changes for non-blocking ProcedureSelectionDlg.
* </pre>
*
* @author njensen
@ -55,7 +56,7 @@ import com.raytheon.viz.gfe.ui.runtimeui.SelectionDlg;
*/
public class RunProcedureAction extends AbstractHandler {
private static final transient IUFStatusHandler statusHandler = UFStatus
private final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(RunProcedureAction.class);
/*
@ -84,10 +85,15 @@ public class RunProcedureAction extends AbstractHandler {
}
}
} else {
// The ProcedureSelectionDlg changes based on the procedure.
// Since it is non-modal several dialogs may be displayed. This
// mimics the AWIPS 1 behavior.
// make the gui, let it handle running the procedure
SelectionDlg sd = new ProcedureSelectionDlg(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell(),
procedureName, dm, varList);
sd.setBlockOnOpen(false);
sd.open();
}
} catch (JepException e) {

View file

@ -50,6 +50,7 @@ import com.raytheon.viz.gfe.ui.runtimeui.SelectionDlg;
* ------------ ---------- ----------- --------------------------
* Feb 21, 2008 njensen Initial creation
* Dec 1, 2009 1426 ryu Add time range warning
* Nov 15, 2012 1298 rferrel Changes for non-blocking prcedures.
*
* </pre>
*
@ -91,16 +92,21 @@ public class SmartUtil {
try {
varList = dm.getSmartToolInterface().getVarDictWidgets(toolName);
} catch (JepException e) {
// TODO Auto-generated catch block
e.printStackTrace();
statusHandler.handle(Priority.PROBLEM,
"Error getting VariableList for procedure: " + toolName, e);
}
if (varList == null || varList.size() == 0) {
runToolNoVarDict(dm, toolName);
} else {
// The SmartToolSelectionDlg changes based on the procedure.
// Since it is non-modal several dialogs may be displayed. This
// mimics the AWIPS 1 behavior.
// make the gui, let it handle running the tool
SelectionDlg sd = new SmartToolSelectionDlg(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell(),
toolName, dm, varList);
sd.setBlockOnOpen(false);
sd.open();
}
}
@ -150,11 +156,20 @@ public class SmartUtil {
.getSmartToolInterface().getVarDictWidgets(
toolName);
if (varList != null && varList.size() > 0) {
// The SmartToolBlockingSelectionDlg changes based
// on the procedure. Since it is non-modal several
// dialogs may be displayed. This mimics the AWIPS 1
// behavior.
// make the gui, let it handle running the procedure
SmartToolBlockingSelectionDlg sd = new SmartToolBlockingSelectionDlg(
PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getShell(), toolName, dm, varList);
// must block because this method needs the results
// to determine what to return.
sd.setBlockOnOpen(true);
sd.open();
Map<String, Object> resultMap = sd
.getVarDictResult();
@ -170,7 +185,8 @@ public class SmartUtil {
}
} catch (JepException e) {
statusHandler.handle(Priority.PROBLEM,
"Error getting VariableList", e);
"Error getting VariableList for procedure: "
+ toolName, e);
}
}
});

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* ------------ ---------- ----------- --------------------------
* Feb 9, 2010 3353 njensen Initial creation
* Jul 13,2011 9291 rferrel Convert to subclass of CaveJFACEDialog.
* Nov 15,2012 1298 rferrel Code cleanup for non-blocking dialogs.
*
* </pre>
*
@ -90,7 +91,7 @@ public abstract class SelectionDlg extends CaveJFACEDialog {
this.name = title;
this.dataMgr = dataMgr;
this.fieldDefs = fieldDefs;
this.setShellStyle(SWT.MODELESS | SWT.TITLE | SWT.RESIZE);
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS | SWT.RESIZE);
}
/*