Merge "ASM #14775 - Fix NPE and restructure code" into asm_16.2.2

Former-commit-id: 80470c86d72a2d8f92fd93e2913b817c2215efb4
This commit is contained in:
Matthew Howard 2016-03-01 11:17:57 -05:00 committed by Gerrit Code Review
commit 036bb65ea9

View file

@ -182,6 +182,8 @@ import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
* match the current time
* 01/21/2016 18505 lshi Resent product should have same WMO, MND, and segment times
* as original product.
* 03/01/2016 14775 ryu Initialize product definition for product correction;
* modified saveFile() and getDir().
* </pre>
*
* @author lvenable
@ -449,7 +451,11 @@ public class ProductEditorComp extends Composite implements
super(parent, SWT.BORDER);
this.parent = parent;
this.productDefinition = productDefinition;
if (productDefinition != null) {
this.productDefinition = productDefinition;
} else {
this.productDefinition = new ProductDefinition();
}
this.productName = productName;
this.editorCorrectionMode = editorCorrectionMode;
this.transmissionCB = transmissionCB;
@ -2277,21 +2283,11 @@ public class ProductEditorComp extends Composite implements
*/
private void saveFile() {
String fname = null;
if (productDefinition.get("outputFile") != null) {
fname = getDefString("outputFile");
if (fname.equals(EMPTY)) {
return;
}
} else {
return;
}
fname = fixfname(fname);
String fname = getDir();
FileDialog fd = new FileDialog(parent.getShell(), SWT.SAVE);
fd.setText("Save As");
String filePath = (new File(fname)).getParentFile().getPath();
fd.setFilterPath(filePath);
fd.setFilterPath(fname);
fd.setFileName(guessFilename());
fname = fd.open();
@ -2395,10 +2391,18 @@ public class ProductEditorComp extends Composite implements
if (testVTEC) {
fname = prdDir + "/PRACTICE";
} else {
fname = prodEditorDirectory;
File f = new File(fname);
if (f.isDirectory()) {
fname.concat("/");
if (productDefinition.get("outputFile") != null) {
fname = getDefString("outputFile");
if (fname != null) {
fname = fixfname(fname);
if (!(new File(fname)).isDirectory()) {
fname = new File(fname).getParent();
}
}
}
if (fname == null) {
fname = prodEditorDirectory;
}
}