Issue #1196 Changes for ScriptOutputDlg.

Change-Id: If2b7bbd6f3a7936cc8d9536553413f3b63e65d11

Former-commit-id: c8cd5ba07fda1b8f8aa674e71f48967d02f8333a
This commit is contained in:
Roger Ferrel 2012-09-27 15:18:07 -05:00
parent 56b84c6546
commit b96eb0eafd
4 changed files with 36 additions and 28 deletions

View file

@ -291,6 +291,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 20SEP2012 1196 rferrel Refactor dialogs to prevent blocking.
* 25SEP2012 1196 lvenable Refactor dialogs to prevent blocking.
* 26SEP2012 1196 lvenable Refactor dialogs to prevent blocking.
* 27SEP2012 1196 rferrel Changes for non-blocking ScriptOutputDlg.
* </pre>
*
* @author lvenable
@ -5702,38 +5703,48 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
&& !scriptsShowOutputItem.isDisposed()) {
scriptsShowOutputItem.setSelection(true);
}
// create the script output window
if (scriptOutput == null) {
scriptOutput = new ScriptOutputDlg(shell, token);
}
// update the script editor window
if (scriptEditor != null) {
scriptEditor.setScriptOutputState(true);
}
// open the script output window
scriptOutput.open();
// update the menu following close
if (scriptsShowOutputItem != null
&& !scriptsShowOutputItem.isDisposed()) {
scriptsShowOutputItem.setSelection(false);
// create the script output window
if (scriptOutput == null || !scriptOutput.isDisposed()) {
scriptOutput = new ScriptOutputDlg(shell, token);
// open the script output window
scriptOutput.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// update the menu following close
if (scriptsShowOutputItem != null
&& !scriptsShowOutputItem.isDisposed()) {
scriptsShowOutputItem.setSelection(false);
}
// update script editor window
if (scriptEditor != null) {
scriptEditor.setScriptOutputState(false);
}
scriptOutput = null;
}
});
scriptOutput.open();
} else {
scriptOutput.bringToTop();
}
// update script editor window
if (scriptEditor != null) {
scriptEditor.setScriptOutputState(false);
}
scriptOutput = null;
} else {
if (scriptOutput != null) {
scriptOutput.close();
} else {
if (scriptsShowOutputItem != null
&& !scriptsShowOutputItem.isDisposed()) {
scriptsShowOutputItem.setSelection(false);
}
if (scriptEditor != null) {
scriptEditor.setScriptOutputState(false);
}
}
if (scriptsShowOutputItem != null
&& !scriptsShowOutputItem.isDisposed()) {
scriptsShowOutputItem.setSelection(false);
}
if (scriptEditor != null) {
scriptEditor.setScriptOutputState(false);
}
scriptOutput = null;
}
}

View file

@ -87,9 +87,6 @@ public class ScriptEditorDialog extends CaveSWTDialog implements IScriptEditor {
/** the observer to pass to results from a running script */
private final IScriptEditorObserver observer;
/** the script output window */
ScriptOutputDlg scriptOutput = null;
/** the text editor ID token */
private final String token;

View file

@ -43,6 +43,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 29, 2009 mfegan Initial creation
* Sep 27, 2012 1196 rferrel No longer blocks.
*
* </pre>
*
@ -61,7 +62,7 @@ public class ScriptOutputDlg extends CaveSWTDialog implements SelectionListener
*/
public ScriptOutputDlg(Shell parent, String token) {
super(parent, SWT.DIALOG_TRIM | SWT.RESIZE,
CAVE.PERSPECTIVE_INDEPENDENT);
CAVE.PERSPECTIVE_INDEPENDENT | CAVE.DO_NOT_BLOCK);
setText(String.format(DLG_TITLE_FMT, token));
}

View file

@ -378,7 +378,6 @@ public class ValidPeriodDialog extends CaveSWTDialog {
@Override
protected void disposed() {
timer.cancel();
super.disposed();
}
private void calculateDuration() {