]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
1. Enhance Source Files selection in msa:
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / dialog / SourceFilesDlg.java
index 53ac9a591cebdbcd9aa1824db298acb86d87dcda..d11c979e25cdb8c315f09ee51afc9dd494948817 100644 (file)
@@ -91,7 +91,7 @@ public class SourceFilesDlg extends IDialog {
     //\r
     // Not used by UI\r
     //\r
-    private SourceFilesIdentification sfid = null;\r
+    private SourceFilesIdentification sfid[] = null;\r
 \r
     private String msaFileName = "";\r
 \r
@@ -268,16 +268,16 @@ public class SourceFilesDlg extends IDialog {
      **/\r
     private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) {\r
         init();\r
-        this.sfid = inSourceFilesIdentifications;\r
+        //this.sfid = inSourceFilesIdentifications;\r
         this.msaFileName = fileName;\r
 \r
-        if (this.sfid != null) {\r
-            this.jTextFieldFileName.setText(sfid.getFilename());\r
-            this.jTextFieldTagName.setText(sfid.getTagName());\r
-            this.jTextFieldToolCode.setText(sfid.getToolCode());\r
-            this.jTextFieldToolChainFamily.setText(sfid.getToolChainFamily());\r
-            jTextFieldFeatureFlag.setText(sfid.getFeatureFlag());\r
-            this.jArchCheckBox.setSelectedItems(sfid.getSupArchList());\r
+        if (inSourceFilesIdentifications != null) {\r
+            this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename());\r
+            this.jTextFieldTagName.setText(inSourceFilesIdentifications.getTagName());\r
+            this.jTextFieldToolCode.setText(inSourceFilesIdentifications.getToolCode());\r
+            this.jTextFieldToolChainFamily.setText(inSourceFilesIdentifications.getToolChainFamily());\r
+            jTextFieldFeatureFlag.setText(inSourceFilesIdentifications.getFeatureFlag());\r
+            this.jArchCheckBox.setSelectedItems(inSourceFilesIdentifications.getSupArchList());\r
         }\r
     }\r
 \r
@@ -376,14 +376,18 @@ public class SourceFilesDlg extends IDialog {
         }\r
     }\r
 \r
-    private SourceFilesIdentification getCurrentSourceFiles() {\r
+    private SourceFilesIdentification[] getCurrentSourceFiles() {\r
         String name = this.jTextFieldFileName.getText();\r
+        String s[] = name.split(";");\r
         String tagName = this.jTextFieldTagName.getText();\r
         String toolCode = this.jTextFieldToolCode.getText();\r
         String tcf = this.jTextFieldToolChainFamily.getText();\r
         String featureFlag = this.jTextFieldFeatureFlag.getText();\r
         Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();\r
-        sfid = new SourceFilesIdentification(name, tagName, toolCode, tcf, featureFlag, arch);\r
+        sfid = new SourceFilesIdentification[s.length];\r
+        for (int index = 0; index < s.length; index++) {\r
+            sfid[index] =  new SourceFilesIdentification(s[index], tagName, toolCode, tcf, featureFlag, arch);\r
+        }\r
         return sfid;\r
     }\r
 \r
@@ -457,17 +461,23 @@ public class SourceFilesDlg extends IDialog {
     private void selectFile() {\r
         JFileChooser fc = new JFileChooser();\r
         fc.setCurrentDirectory(new File(Tools.getFilePathOnly(msaFileName)));\r
+        fc.setMultiSelectionEnabled(true);\r
         int result = fc.showOpenDialog(new JPanel());\r
         if (result == JFileChooser.APPROVE_OPTION) {\r
-            this.jTextFieldFileName.setText(fc.getSelectedFile().getName());\r
+            File f[] = fc.getSelectedFiles();\r
+            String s = "";\r
+            for (int index = 0; index < f.length; index++) {\r
+                s = s + f[index].getName() + ";";\r
+            }\r
+            this.jTextFieldFileName.setText(s);\r
         }\r
     }\r
 \r
-    public SourceFilesIdentification getSfid() {\r
+    public SourceFilesIdentification[] getSfid() {\r
         return sfid;\r
     }\r
 \r
-    public void setSfid(SourceFilesIdentification sfid) {\r
+    public void setSfid(SourceFilesIdentification[] sfid) {\r
         this.sfid = sfid;\r
     }\r
 }\r