]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
1. Fix bug in get industry std headers
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / SourceFilesDlg.java
index 3c868494ef468381338d5624682722ef4ee8886e..53ac9a591cebdbcd9aa1824db298acb86d87dcda 100644 (file)
@@ -15,6 +15,7 @@
 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
@@ -27,12 +28,12 @@ import javax.swing.JTextField;
 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
@@ -82,15 +83,17 @@ public class SourceFilesDlg extends IDialog {
     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
@@ -238,9 +241,9 @@ public class SourceFilesDlg extends IDialog {
      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
@@ -263,9 +266,10 @@ public class SourceFilesDlg extends IDialog {
      @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
@@ -451,8 +455,8 @@ public class SourceFilesDlg extends IDialog {
      \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