package org.tianocore.frameworkwizard.module.ui.dialog;\r
\r
import java.awt.event.ActionEvent;\r
+import java.io.File;\r
import java.util.Vector;\r
\r
import javax.swing.JButton;\r
import org.tianocore.frameworkwizard.common.DataType;\r
import org.tianocore.frameworkwizard.common.DataValidation;\r
import org.tianocore.frameworkwizard.common.Log;\r
+import org.tianocore.frameworkwizard.common.Tools;\r
import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;\r
import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;\r
-import org.tianocore.frameworkwizard.workspace.Workspace;\r
\r
/**\r
The class is used to create, update SourceFile of MSA/MBD file\r
private JTextField jTextFieldFeatureFlag = null;\r
\r
private ArchCheckBox jArchCheckBox = null;\r
+ \r
+ private JButton jButtonOk = null;\r
+\r
+ private JButton jButtonCancel = null;\r
\r
//\r
// Not used by UI\r
//\r
private SourceFilesIdentification sfid = null;\r
\r
- private JButton jButtonOk = null;\r
-\r
- private JButton jButtonCancel = null;\r
+ private String msaFileName = "";\r
\r
/**\r
This method initializes jTextFieldFileName \r
This is the default constructor\r
\r
**/\r
- public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame) {\r
+ public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, String fileName) {\r
super(iFrame, true);\r
- init(inSourceFilesIdentification);\r
+ init(inSourceFilesIdentification, fileName);\r
}\r
\r
/**\r
@param inSourceFiles The input data of SourceFilesDocument.SourceFiles\r
\r
**/\r
- private void init(SourceFilesIdentification inSourceFilesIdentifications) {\r
+ private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) {\r
init();\r
this.sfid = inSourceFilesIdentifications;\r
+ this.msaFileName = fileName;\r
\r
if (this.sfid != null) {\r
this.jTextFieldFileName.setText(sfid.getFilename());\r
\r
**/\r
private void selectFile() {\r
- JFileChooser fc = new JFileChooser(Workspace.getCurrentWorkspace());\r
-\r
+ JFileChooser fc = new JFileChooser();\r
+ fc.setCurrentDirectory(new File(Tools.getFilePathOnly(msaFileName)));\r
int result = fc.showOpenDialog(new JPanel());\r
if (result == JFileChooser.APPROVE_OPTION) {\r
this.jTextFieldFileName.setText(fc.getSelectedFile().getName());\r