]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
1. Add function "Refresh" in main UI
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / Clone.java
index 97f16ce40c2b65f39762b84ce1540388e0b42f4d..3395434efda5ceef6da95a1f79772f14b5633990 100644 (file)
@@ -376,7 +376,7 @@ public class Clone extends IDialog {
             this.jLabelBelong.setEnabled(false);\r
             this.jComboBoxExistingPackage.setEnabled(false);\r
             this.jButtonBrowse.setVisible(false);\r
-            this.jTextFieldFilePath.setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.fpd</html>");\r
+            this.jTextFieldFilePath.setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");\r
             this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);\r
             this.jLabelDestinationFile.setText("New Package Path and Filename");\r
         }\r
@@ -845,6 +845,33 @@ public class Clone extends IDialog {
             GlobalData.vPackageList.addElement(pid);\r
             GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);\r
             \r
+            //\r
+            // Add all cloned modules\r
+            //\r
+            Vector<String> modulePaths = GlobalData.getAllModulesOfPackage(pid.getPath());\r
+            String modulePath = null;\r
+            ModuleSurfaceArea msa = null;\r
+            \r
+            for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {\r
+                try {\r
+                    modulePath = modulePaths.get(indexJ);\r
+                    msa = OpenFile.openMsaFile(modulePath);\r
+                } catch (IOException e) {\r
+                    Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
+                    continue;\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
+                    continue;\r
+                } catch (Exception e) {\r
+                    Log.err("Open Module Surface Area " + modulePath, "Invalid file type");\r
+                    continue;\r
+                }\r
+                Identification id = Tools.getId(modulePath, msa);\r
+                mid = new ModuleIdentification(id, pid);\r
+                GlobalData.vModuleList.addElement(mid);\r
+                GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);\r
+            }\r
+            \r
             this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;\r
         }\r
 \r