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
cave
com.raytheon.viz.aviation/src/com/raytheon/viz/aviation
com.raytheon.viz.avnconfig/src/com/raytheon/viz/avnconfig
|
@ -59,6 +59,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* 11 Oct 2012 1229 rferrel Changes for non-blocking MonitoringCriteriaDlg.
|
* 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 TafProductConfigDlg.
|
||||||
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafSiteInfoEditorDlg.
|
* 12 Oct 2012 1229 rferrel Changes for non-blocking TafSiteInfoEditorDlg.
|
||||||
|
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -262,13 +263,11 @@ public class AvnconfigDlg extends CaveSWTDialog {
|
||||||
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
textEditorBtn.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (editorDlg == null || editorDlg.getParent().isDisposed()) {
|
if (mustCreate(editorDlg)) {
|
||||||
editorDlg = new TextEditorSetupDlg(shell);
|
editorDlg = new TextEditorSetupDlg(shell);
|
||||||
editorDlg.open();
|
editorDlg.open();
|
||||||
editorDlg = null;
|
|
||||||
} else {
|
} else {
|
||||||
editorDlg.getParent().forceActive();
|
editorDlg.bringToTop();
|
||||||
editorDlg.getParent().forceFocus();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.commons.configuration.ConfigurationException;
|
import org.apache.commons.configuration.ConfigurationException;
|
||||||
import org.eclipse.swt.SWT;
|
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.uf.viz.core.requests.ThriftClient;
|
||||||
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
import com.raytheon.viz.avncommon.AvnMessageMgr.StatusMessageType;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.vividsolutions.jts.geom.Point;
|
import com.vividsolutions.jts.geom.Point;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,6 +82,7 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* 9 May 2011 8856 rferrel Code cleanup
|
* 9 May 2011 8856 rferrel Code cleanup
|
||||||
* 12 Oct 2012 1229 rferrel Now a subclass of CaveSWTDialog
|
* 12 Oct 2012 1229 rferrel Now a subclass of CaveSWTDialog
|
||||||
* and made non-blocking.
|
* and made non-blocking.
|
||||||
|
* 15 Oct 2012 1229 rferrel Changes for non-blocking TextEditorSetupDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -233,6 +236,11 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
private Color correctColor;
|
private Color correctColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible to have a different dialog for each issue time.
|
||||||
|
*/
|
||||||
|
Map<String, TextEditorSetupDlg> editorDlgMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -242,6 +250,7 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
||||||
public TafSiteInfoEditorDlg(Shell parent) {
|
public TafSiteInfoEditorDlg(Shell parent) {
|
||||||
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
setText("AvnFPS TAF Site Info Editor");
|
setText("AvnFPS TAF Site Info Editor");
|
||||||
|
editorDlgMap = new HashMap<String, TextEditorSetupDlg>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -862,15 +871,30 @@ public class TafSiteInfoEditorDlg extends CaveSWTDialog {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
if (isSiteIdValid()) {
|
if (isSiteIdValid()) {
|
||||||
try {
|
try {
|
||||||
String issueTime = issueCbo.getText().substring(0, 2);
|
final String issueTime = issueCbo.getText().substring(
|
||||||
ITafSiteConfig config = TafSiteConfigFactory
|
0, 2);
|
||||||
.getInstance();
|
TextEditorSetupDlg editorDlg = editorDlgMap
|
||||||
String siteId = siteIdTF.getText();
|
.get(issueTime);
|
||||||
LocalizationFile lFile = config.getTemplateFile(siteId,
|
if (mustCreate(editorDlg)) {
|
||||||
issueTime);
|
ITafSiteConfig config = TafSiteConfigFactory
|
||||||
TextEditorSetupDlg editorDlg = new TextEditorSetupDlg(
|
.getInstance();
|
||||||
shell, lFile);
|
String siteId = siteIdTF.getText();
|
||||||
editorDlg.open();
|
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) {
|
} catch (FileNotFoundException e) {
|
||||||
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
msgStatusComp.setMessageText(e.getMessage(), new RGB(
|
||||||
255, 0, 0));
|
255, 0, 0));
|
||||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* LocalizedFile and added preOpen() to
|
* LocalizedFile and added preOpen() to
|
||||||
* open the LocalizedFile.
|
* open the LocalizedFile.
|
||||||
* 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
|
* 11 OCT 2012 1229 rferrel Changes for non-blocking FindReplaceDlg.
|
||||||
|
* 15 OCT 2012 1229 rferrel Made dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -165,7 +166,8 @@ public class TextEditorSetupDlg extends CaveSWTDialog {
|
||||||
* When not null a localized file to load into the editor.
|
* When not null a localized file to load into the editor.
|
||||||
*/
|
*/
|
||||||
public TextEditorSetupDlg(Shell parent, LocalizationFile lFile) {
|
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");
|
setText("AvnFPS Text Editor");
|
||||||
|
|
||||||
this.template = null;
|
this.template = null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue