Issue #1229 Changes for non-blockig TextEditorSetupDlg.
Change-Id: Ia63762fbba6c89a60302d56158f846e3cc3e53cc Former-commit-id:329db1fa5a
[formerly5b967cd04d
] [formerly329db1fa5a
[formerly5b967cd04d
] [formerlyba6ff53d4d
[formerly 022d0f76b455d6136ee88572bf95cafc1f35863b]]] Former-commit-id:ba6ff53d4d
Former-commit-id:91e307e265
[formerly3f45b19774
] Former-commit-id:0e01f75e00
This commit is contained in:
parent
5e282b1ca8
commit
cc73d463bb
3 changed files with 39 additions and 14 deletions
|
@ -59,6 +59,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 11 Oct 2012 1229 rferrel Changes for non-blocking MonitoringCriteriaDlg.
|
||||
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafProductConfigDlg.
|
||||
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafSiteInfoEditorDlg.
|
||||
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -262,13 +263,11 @@ public class AvnconfigDlg extends CaveSWTDialog {
|
|||
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (editorDlg == null || editorDlg.getParent().isDisposed()) {
|
||||
if (mustCreate(editorDlg)) {
|
||||
editorDlg = new TextEditorSetupDlg(shell);
|
||||
editorDlg.open();
|
||||
editorDlg = null;
|
||||
} else {
|
||||
editorDlg.getParent().forceActive();
|
||||
editorDlg.getParent().forceFocus();
|
||||
editorDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.configuration.ConfigurationException;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -63,6 +64,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
|
||||
/**
|
||||
|
@ -80,6 +82,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* 9 May 2011 8856 rferrel Code cleanup
|
||||
* 12 Oct 2012 1229 rferrel Now a subclass of CaveSWTDialog
|
||||
* and made non-blocking.
|
||||
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -233,6 +236,11 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
|||
*/
|
||||
private Color correctColor;
|
||||
|
||||
/**
|
||||
* Possible to have a different dialog for each issue time.
|
||||
*/
|
||||
Map<String, TextEditorSetupDlg> editorDlgMap;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -242,6 +250,7 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
|||
public TafSiteInfoEditorDlg(Shell parent) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS TAF Site Info Editor");
|
||||
editorDlgMap = new HashMap<String, TextEditorSetupDlg>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -862,15 +871,30 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
|||
public void widgetSelected(SelectionEvent event) {
|
||||
if (isSiteIdValid()) {
|
||||
try {
|
||||
String issueTime = issueCbo.getText().substring(0, 2);
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
String siteId = siteIdTF.getText();
|
||||
LocalizationFile lFile = config.getTemplateFile(siteId,
|
||||
issueTime);
|
||||
TextEditorSetupDlg editorDlg = new TextEditorSetupDlg(
|
||||
shell, lFile);
|
||||
editorDlg.open();
|
||||
final String issueTime = issueCbo.getText().substring(
|
||||
0, 2);
|
||||
TextEditorSetupDlg editorDlg = editorDlgMap
|
||||
.get(issueTime);
|
||||
if (mustCreate(editorDlg)) {
|
||||
ITafSiteConfig config = TafSiteConfigFactory
|
||||
.getInstance();
|
||||
String siteId = siteIdTF.getText();
|
||||
LocalizationFile lFile = config.getTemplateFile(
|
||||
siteId, issueTime);
|
||||
editorDlg = new TextEditorSetupDlg(shell, lFile);
|
||||
editorDlgMap.put(issueTime, editorDlg);
|
||||
editorDlg.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
editorDlgMap.remove(issueTime);
|
||||
}
|
||||
});
|
||||
|
||||
editorDlg.open();
|
||||
} else {
|
||||
editorDlg.bringToTop();
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
||||
255, 0, 0));
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* LocalizedFile and added preOpen() to
|
||||
* open the LocalizedFile.
|
||||
* 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
|
||||
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -165,7 +166,8 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
|||
* When not null a localized file to load into the editor.
|
||||
*/
|
||||
public TextEditorSetupDlg(Shell parent, LocalizationFile lFile) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT);
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.PERSPECTIVE_INDEPENDENT
|
||||
| CAVE.DO_NOT_BLOCK);
|
||||
setText("AvnFPS Text Editor");
|
||||
|
||||
this.template = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue