1. Fix EDKT463: When wizard new or clone a msa/spd/fpd, should follow these rules
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 08:42:47 +0000 (08:42 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 3 Nov 2006 08:42:47 +0000 (08:42 +0000)
2. Fix EDKT465: The content in memory should be reloaded when a modified msa/fpd/spd is closed without saving

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1896 6f19259b-4bc3-4df7-8a09-765794883524

12 files changed:
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java

index d8030f775ac5cbe6803718133d4aae2564595271..6264a409e42be58166e275b3d680883452336e49 100644 (file)
@@ -621,21 +621,21 @@ public class Clone extends IDialog {
         if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
             String packageGuid = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getGuid();\r
             String packageVersion = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getVersion();\r
-            if (GlobalData.findModuleIdByGuidVersion(guid, version, packageGuid, packageVersion) != null) {\r
+            if (GlobalData.findModuleId(guid, version, packageGuid, packageVersion) != null) {\r
                 Log.wrn("Clone", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");\r
                 return false;\r
             }\r
         }\r
 \r
         if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-            if (GlobalData.findPackageIdByGuidVersion(guid, version) != null) {\r
+            if (GlobalData.findPackageId(guid, version) != null) {\r
                 Log.wrn("Clone", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");\r
                 return false;\r
             }\r
         }\r
 \r
         if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-            if (GlobalData.findPlatformIdByGuidVersion(guid, version) != null) {\r
+            if (GlobalData.findPlatformId(guid, version) != null) {\r
                 Log.wrn("Clone", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");\r
                 return false;\r
             }\r
@@ -709,6 +709,11 @@ public class Clone extends IDialog {
                 Log.wrn("Clone", "The target module already exists!");\r
                 return false;\r
             }\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
+                Log.wrn("Clone", "There already exists a same directory with a module");\r
+                return false;\r
+            }\r
+            \r
             return checkId(mode);\r
         }\r
 \r
@@ -730,6 +735,11 @@ public class Clone extends IDialog {
                 Log.wrn("Clone", "The target package already exists!");\r
                 return false;\r
             }\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
+                Log.wrn("Clone", "There already exists a same directory with a package");\r
+                return false;\r
+            }\r
+            \r
             return checkId(mode);\r
         }\r
 \r
@@ -750,6 +760,11 @@ public class Clone extends IDialog {
                 Log.wrn("Clone", "The target platform already exists.");\r
                 return false;\r
             }\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
+                Log.wrn("Clone", "There already exists a same directory with a platform");\r
+                return false;\r
+            }\r
+            \r
             return checkId(mode);\r
         }\r
 \r
index 651222d8537d851d06762b2dd4d488f131e52ad9..5eef420fdc4e6a8285383b93e3ba884d578a4634 100644 (file)
@@ -1887,6 +1887,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
 \r
         if (arg0.getSource() == this.jMenuItemFileCloseAll) {\r
             this.closeAll();\r
+            this.refresh();\r
             this.makeEmptyTree();\r
         }\r
 \r
@@ -3108,8 +3109,10 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                     iTree.removeNodeChildrenByPath(item);\r
                 }\r
 \r
+                GlobalData.openingModuleList.reload(this.currentOpeningModuleIndex);\r
                 GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false);\r
                 GlobalData.openingModuleList.setModuleSaved(this.currentOpeningModuleIndex, true);\r
+                \r
                 this.cleanDesktopPaneModule();\r
                 this.currentOpeningModuleIndex = -1;\r
             }\r
@@ -3144,6 +3147,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                     iTree.removeNodeChildrenByPath(item);\r
                 }\r
 \r
+                GlobalData.openingPackageList.reload(this.currentOpeningPackageIndex);\r
                 GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false);\r
                 GlobalData.openingPackageList.setPackageSaved(this.currentOpeningPackageIndex, true);\r
                 this.cleanDesktopPanePackage();\r
@@ -3180,6 +3184,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                     iTree.removeNodeChildrenByPath(item);\r
                 }\r
 \r
+                GlobalData.openingPlatformList.reload(this.currentOpeningPlatformIndex);\r
                 GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false);\r
                 GlobalData.openingPlatformList.setPlatformSaved(this.currentOpeningPlatformIndex, true);\r
                 this.cleanDesktopPanePlatform();\r
index da971b9fa67a95a263eb7c418b03a468ca95887b..a052b74d3e70d002d45cbe2fbd2c956a7be30fe4 100644 (file)
@@ -37,6 +37,7 @@ import org.tianocore.PlatformHeaderDocument.PlatformHeader;
 import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
 import org.tianocore.frameworkwizard.common.DataType;\r
 import org.tianocore.frameworkwizard.common.DataValidation;\r
+import org.tianocore.frameworkwizard.common.GlobalData;\r
 import org.tianocore.frameworkwizard.common.IFileFilter;\r
 import org.tianocore.frameworkwizard.common.Log;\r
 import org.tianocore.frameworkwizard.common.SaveFile;\r
@@ -475,10 +476,14 @@ public class SelectModuleBelong extends IDialog {
      \r
      **/\r
     public boolean check() {\r
+        String path = this.jTextFieldFilePath.getText();\r
+        String guid = this.jTextFieldGuid.getText();\r
+        String version = this.jTextFieldVersion.getText();\r
+        \r
         //\r
         // Check if all required fields are not empty\r
         //\r
-        if (isEmpty(this.jTextFieldFilePath.getText())) {\r
+        if (isEmpty(path)) {\r
             Log.wrn("New File", "A File Path must be entered!");\r
             return false;\r
         }\r
@@ -486,11 +491,11 @@ public class SelectModuleBelong extends IDialog {
             Log.wrn("New File", "A Name must be entered");\r
             return false;\r
         }\r
-        if (isEmpty(this.jTextFieldGuid.getText())) {\r
+        if (isEmpty(guid)) {\r
             Log.wrn("New File", "The Guid must be entered!");\r
             return false;\r
         }\r
-        if (isEmpty(this.jTextFieldVersion.getText())) {\r
+        if (isEmpty(version)) {\r
             Log.wrn("New File", "A Version number must be entered!");\r
             return false;\r
         }\r
@@ -502,17 +507,19 @@ public class SelectModuleBelong extends IDialog {
             Log.wrn("New File", "Incorrect data type for the Name!");\r
             return false;\r
         }\r
-        if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {\r
+        if (!DataValidation.isGuid((guid))) {\r
             Log.wrn("New File", "Incorrect data type for Guid, which must be in registry format! (8-4-4-4-12)");\r
             return false;\r
         }\r
+        \r
+\r
 \r
         if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
             //\r
             // Check if the module is already existed in current package\r
             //\r
             String packagePath = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath();\r
-            String modulePath = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());\r
+            String modulePath = Tools.convertPathToCurrentOsType(path);\r
             Vector<String> msaFile = wt.getAllModulesOfPackage(packagePath);\r
 \r
             for (int index = 0; index < msaFile.size(); index++) {\r
@@ -521,13 +528,31 @@ public class SelectModuleBelong extends IDialog {
                     return false;\r
                 }\r
             }\r
+            \r
+            //\r
+            // Check if path already exists\r
+            //\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(modulePath), mode)) {\r
+                Log.wrn("New File", "There already exists a same directory with a module");\r
+                return false;\r
+            }\r
+            \r
+            //\r
+            // Check if Guid+Version is unique\r
+            //\r
+            String packageGuid = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getGuid();\r
+            String packageVersion = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getVersion();\r
+            if (GlobalData.findModuleId(guid, version, packageGuid, packageVersion) != null) {\r
+                Log.wrn("New File", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");\r
+                return false;\r
+            }\r
         }\r
 \r
         if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
             //\r
             // Check if the package is already existed in database\r
             //\r
-            String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());\r
+            path = Tools.convertPathToCurrentOsType(path);\r
             Vector<PackageIdentification> vPackageList = wt.getAllPackages();\r
             if (vPackageList != null && vPackageList.size() > 0) {\r
                 for (int index = 0; index < vPackageList.size(); index++) {\r
@@ -537,13 +562,29 @@ public class SelectModuleBelong extends IDialog {
                     }\r
                 }\r
             }\r
+            \r
+            //\r
+            // Check if path already exists\r
+            //\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(path), mode)) {\r
+                Log.wrn("New File", "There already exists a same directory with a package");\r
+                return false;\r
+            }\r
+            \r
+            //\r
+            // Check if Guid+Version is unique\r
+            //\r
+            if (GlobalData.findPackageId(guid, version) != null) {\r
+                Log.wrn("New File", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");\r
+                return false;\r
+            }\r
         }\r
 \r
         if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
             //\r
             // Check if the platform is already existed in database\r
             //\r
-            String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());\r
+            path = Tools.convertPathToCurrentOsType(path);\r
             Vector<PlatformIdentification> vPlatfromList = wt.getAllPlatforms();\r
             if (vPlatfromList != null && vPlatfromList.size() > 0) {\r
                 for (int index = 0; index < vPlatfromList.size(); index++) {\r
@@ -553,6 +594,22 @@ public class SelectModuleBelong extends IDialog {
                     }\r
                 }\r
             }\r
+            \r
+            //\r
+            // Check if path already exists\r
+            //\r
+            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(path), mode)) {\r
+                Log.wrn("New File", "There already exists a same directory with a platform");\r
+                return false;\r
+            }\r
+            \r
+            //\r
+            // Check if Guid+Version is unique\r
+            //\r
+            if (GlobalData.findPlatformId(guid, version) != null) {\r
+                Log.wrn("New File", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");\r
+                return false;\r
+            }\r
         }\r
 \r
         return true;\r
index 83a6dd052aac7ef57eafc6cfa6e1565e81808a0d..ed175e53430a01af51227f21f748707651dbe338 100644 (file)
@@ -210,8 +210,8 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static ModuleIdentification findModuleIdByGuidVersion(String moduleGuid, String moduleVersion,\r
-                                                                 String packageGuid, String packageVersion) {\r
+    public static ModuleIdentification findModuleId(String moduleGuid, String moduleVersion, String packageGuid,\r
+                                                    String packageVersion) {\r
         ModuleIdentification mid = null;\r
         for (int index = 0; index < vModuleList.size(); index++) {\r
             if (vModuleList.elementAt(index).equals(moduleGuid, moduleVersion, packageGuid, packageVersion)) {\r
@@ -230,7 +230,7 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static PackageIdentification findPackageIdByGuidVersion(String packageGuid, String packageVersion) {\r
+    public static PackageIdentification findPackageId(String packageGuid, String packageVersion) {\r
         PackageIdentification pid = null;\r
         for (int index = 0; index < vPackageList.size(); index++) {\r
             if (vPackageList.elementAt(index).equals(packageGuid, packageVersion)) {\r
@@ -249,7 +249,7 @@ public class GlobalData {
      @return\r
      \r
      **/\r
-    public static PlatformIdentification findPlatformIdByGuidVersion(String platformGuid, String platformVersion) {\r
+    public static PlatformIdentification findPlatformId(String platformGuid, String platformVersion) {\r
         PlatformIdentification pid = null;\r
         for (int index = 0; index < vPlatformList.size(); index++) {\r
             if (vPlatformList.elementAt(index).equals(platformGuid, platformVersion)) {\r
@@ -259,4 +259,42 @@ public class GlobalData {
         }\r
         return pid;\r
     }\r
+\r
+    /**\r
+    \r
+     @param relativePath\r
+     @param mode\r
+     @return\r
+    \r
+    **/\r
+    public static boolean isDuplicateRelativePath(String relativePath, int mode) {\r
+        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
+            for (int index = 0; index < vModuleList.size(); index++) {\r
+                String path = vModuleList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
+            for (int index = 0; index < vPackageList.size(); index++) {\r
+                String path = vPackageList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
+            for (int index = 0; index < vPlatformList.size(); index++) {\r
+                String path = vPlatformList.elementAt(index).getPath();\r
+                if (Tools.getFilePathOnly(path).equals(relativePath)) {\r
+                    return true;\r
+                }\r
+            }\r
+        }\r
+\r
+        return false;\r
+    }\r
 }\r
index d12291c70c1f485817d885b6f214abb36c819efd..c98d6f95b51d473cbe5078534a91465d31684c66 100644 (file)
@@ -222,4 +222,10 @@ public class OpeningModuleList {
         }\r
         return false;\r
     }\r
+    \r
+    public void reload(int index) {\r
+        if (index > -1) {\r
+            vOpeningModuleList.elementAt(index).reload();\r
+        }\r
+    }\r
 }\r
index 427549ade7b4afa2ce2022a90f35a1166ecba072..3ff29a94d3bc36c876ce7514b2bc43639ea5308e 100644 (file)
 \r
 package org.tianocore.frameworkwizard.common.Identifications;\r
 \r
+import java.io.IOException;\r
+\r
+import org.apache.xmlbeans.XmlException;\r
 import org.tianocore.ModuleSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.Log;\r
+import org.tianocore.frameworkwizard.common.OpenFile;\r
 import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
 \r
 public class OpeningModuleType extends OpeningFileType{\r
@@ -50,4 +55,21 @@ public class OpeningModuleType extends OpeningFileType{
     public void setId(ModuleIdentification id) {\r
         this.id = id;\r
     }\r
+    \r
+    public void reload() {\r
+        if (this.id != null) {\r
+            String path = id.getPath();\r
+            if (path.length() > 0) {\r
+                try {\r
+                    this.xmlMsa = OpenFile.openMsaFile(id.getPath());\r
+                } catch (IOException e) {\r
+                    Log.err("Open Module Surface Area " + path, e.getMessage());\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Module Surface Area " + path, e.getMessage());\r
+                } catch (Exception e) {\r
+                    Log.err("Open Module Surface Area " + path, "Invalid file type");\r
+                }\r
+            }\r
+        }\r
+    }\r
 }\r
index 10d3732cc6afa1869a4582f8f47584db3a99dbb8..0db75176ba7dde241ef7af5fea6902bd5b4b813d 100644 (file)
@@ -222,4 +222,10 @@ public class OpeningPackageList {
         }\r
         return false;\r
     }\r
+    \r
+    public void reload(int index) {\r
+        if (index > -1) {\r
+            vOpeningPackageList.elementAt(index).reload();\r
+        }\r
+    }\r
 }\r
index 66d749e266ae797c87d1a1f935e643dfd916020e..22f3ce311d0ffc56fc88f71abfce0097ec0ee968 100644 (file)
  **/\r
 package org.tianocore.frameworkwizard.common.Identifications;\r
 \r
+import java.io.IOException;\r
+\r
+import org.apache.xmlbeans.XmlException;\r
 import org.tianocore.PackageSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.Log;\r
+import org.tianocore.frameworkwizard.common.OpenFile;\r
 import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 \r
 public class OpeningPackageType extends OpeningFileType {\r
@@ -49,4 +54,21 @@ public class OpeningPackageType extends OpeningFileType {
     public void setId(PackageIdentification id) {\r
         this.id = id;\r
     }\r
+    \r
+    public void reload() {\r
+        if (this.id != null) {\r
+            String path = id.getPath();\r
+            if (path.length() > 0) {\r
+                try {\r
+                    this.xmlSpd = OpenFile.openSpdFile(id.getPath());\r
+                } catch (IOException e) {\r
+                    Log.err("Open Package Surface Area " + path, e.getMessage());\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Package Surface Area " + path, e.getMessage());\r
+                } catch (Exception e) {\r
+                    Log.err("Open Package Surface Area " + path, "Invalid file type");\r
+                }\r
+            }\r
+        }\r
+    }\r
 }\r
index 97c5a5034b5ec69874e94286601dbcab4873adc2..a2ce431c0b5da77bf7e5a0ea2ca60176c250560b 100644 (file)
@@ -208,4 +208,10 @@ public class OpeningPlatformList {
         }\r
         return false;\r
     }\r
+    \r
+    public void reload(int index) {\r
+        if (index > -1) {\r
+            vOpeningPlatformList.elementAt(index).reload();\r
+        }\r
+    }\r
 }\r
index 34c847eb0eb4a04e96472f177c20031ba223c088..7a822c91c854cc53ef5f62a40e4f1f30526e0c94 100644 (file)
  **/\r
 package org.tianocore.frameworkwizard.common.Identifications;\r
 \r
+import java.io.IOException;\r
+\r
+import org.apache.xmlbeans.XmlException;\r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.common.Log;\r
+import org.tianocore.frameworkwizard.common.OpenFile;\r
 import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
 \r
 public class OpeningPlatformType extends OpeningFileType {\r
@@ -49,4 +54,21 @@ public class OpeningPlatformType extends OpeningFileType {
     public void setId(PlatformIdentification id) {\r
         this.id = id;\r
     }\r
+    \r
+    public void reload() {\r
+        if (this.id != null) {\r
+            String path = id.getPath();\r
+            if (path.length() > 0) {\r
+                try {\r
+                    this.xmlFpd = OpenFile.openFpdFile(id.getPath());\r
+                } catch (IOException e) {\r
+                    Log.err("Open Platform Surface Area " + path, e.getMessage());\r
+                } catch (XmlException e) {\r
+                    Log.err("Open Platform Surface Area " + path, e.getMessage());\r
+                } catch (Exception e) {\r
+                    Log.err("Open Platform Surface Area " + path, "Invalid file type");\r
+                }\r
+            }\r
+        }\r
+    }\r
 }\r
index 1b58b674115a7074ad5161a8c3224ae91cb0740e..278ac1d9646dc95356f761f2fc5178894feb8d3e 100644 (file)
@@ -286,15 +286,13 @@ public class FindResultDetailInfo extends IFrame {
                                         // Write Module Sa Info\r
                                         //\r
                                         ModuleIdentification moduleSaId = GlobalData\r
-                                                                                    .findModuleIdByGuidVersion(\r
-                                                                                                               msa\r
-                                                                                                                  .getModuleGuid(),\r
-                                                                                                               msa\r
-                                                                                                                  .getModuleVersion(),\r
-                                                                                                               msa\r
-                                                                                                                  .getPackageGuid(),\r
-                                                                                                               msa\r
-                                                                                                                  .getPackageVersion());\r
+                                                                                    .findModuleId(\r
+                                                                                                  msa.getModuleGuid(),\r
+                                                                                                  msa\r
+                                                                                                     .getModuleVersion(),\r
+                                                                                                  msa.getPackageGuid(),\r
+                                                                                                  msa\r
+                                                                                                     .getPackageVersion());\r
                                         tmp = tmp\r
                                               + TAB\r
                                               + TAB\r
@@ -539,15 +537,15 @@ public class FindResultDetailInfo extends IFrame {
                                             if (mid.equals(i.getModuleGuid(), i.getModuleVersion(), i.getPackageGuid(),\r
                                                            i.getPackageVersion())) {\r
                                                 ModuleIdentification moduleSaId = GlobalData\r
-                                                                                            .findModuleIdByGuidVersion(\r
-                                                                                                                       msa\r
-                                                                                                                          .getModuleGuid(),\r
-                                                                                                                       msa\r
-                                                                                                                          .getModuleVersion(),\r
-                                                                                                                       msa\r
-                                                                                                                          .getPackageGuid(),\r
-                                                                                                                       msa\r
-                                                                                                                          .getPackageVersion());\r
+                                                                                            .findModuleId(\r
+                                                                                                          msa\r
+                                                                                                             .getModuleGuid(),\r
+                                                                                                          msa\r
+                                                                                                             .getModuleVersion(),\r
+                                                                                                          msa\r
+                                                                                                             .getPackageGuid(),\r
+                                                                                                          msa\r
+                                                                                                             .getPackageVersion());\r
                                                 if (moduleSaId != null) {\r
                                                     vModuleSa.addElement(moduleSaId);\r
                                                 }\r
index 3135eef0f44edce211994141d989eda9e07a02ec..1302f665f7ffa600845669ebf6e042bacf7f6c9c 100644 (file)
@@ -15,7 +15,6 @@
 \r
 package org.tianocore.frameworkwizard.module.Identifications;\r
 \r
-\r
 import java.io.IOException;\r
 \r
 import org.apache.xmlbeans.XmlException;\r
@@ -29,63 +28,64 @@ import org.tianocore.frameworkwizard.common.Identifications.Identification;
 import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
 \r
 public class ModuleIdentification extends Identification {\r
-    \r
+\r
     private PackageIdentification packageId;\r
-    \r
+\r
     private String moduleType;\r
-    \r
+\r
     private boolean isLibrary;\r
-    \r
+\r
     public ModuleIdentification(String name, String guid, String version, String path) {\r
-       super(name, guid, version, path);\r
+        super(name, guid, version, path);\r
         setModuleType();\r
     }\r
-    \r
+\r
     public ModuleIdentification(String name, String guid, String version, String path, boolean library) {\r
         super(name, guid, version, path);\r
         this.isLibrary = library;\r
     }\r
-    \r
+\r
     public ModuleIdentification(Identification id) {\r
         super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
     }\r
-    \r
+\r
     public ModuleIdentification(Identification id, boolean library) {\r
         super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
         this.isLibrary = library;\r
     }\r
-    \r
-    public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId){\r
+\r
+    public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId) {\r
         super(name, guid, version, path);\r
         this.packageId = packageId;\r
         setModuleType();\r
     }\r
-    \r
-    public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId, String type){\r
+\r
+    public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId,\r
+                                String type) {\r
         super(name, guid, version, path);\r
         this.packageId = packageId;\r
         this.moduleType = type;\r
     }\r
-    \r
+\r
     public ModuleIdentification(Identification id, PackageIdentification packageId) {\r
         super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
         this.packageId = packageId;\r
         setModuleType();\r
     }\r
-    \r
+\r
     public ModuleIdentification(Identification id, PackageIdentification packageId, boolean library) {\r
         super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
         this.packageId = packageId;\r
         this.isLibrary = library;\r
     }\r
-    \r
+\r
     public ModuleIdentification(Identification id, PackageIdentification packageId, String type) {\r
         super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());\r
         this.packageId = packageId;\r
         this.moduleType = type;\r
     }\r
-    \r
-    public String toString(){\r
+\r
+    public String toString() {\r
         return "Module " + this.getName() + "[" + this.getGuid() + "] in package " + packageId;\r
     }\r
 \r
@@ -104,20 +104,20 @@ public class ModuleIdentification extends Identification {
     public void setModuleType(String moduleType) {\r
         this.moduleType = moduleType;\r
     }\r
-    \r
+\r
     private void setModuleType() {\r
         ModuleSurfaceArea msa = null;\r
         try {\r
             msa = OpenFile.openMsaFile(this.getPath());\r
         } catch (IOException e) {\r
             // TODO Auto-generated catch block\r
-            \r
+\r
         } catch (XmlException e) {\r
             // TODO Auto-generated catch block\r
-            \r
+\r
         } catch (Exception e) {\r
             // TODO Auto-generated catch block\r
-            \r
+\r
         }\r
         setModuleType(DataType.MODULE_TYPE_MODULE);\r
         setLibrary(false);\r
@@ -134,7 +134,7 @@ public class ModuleIdentification extends Identification {
             }\r
         }\r
     }\r
-    \r
+\r
     public boolean equals(String moduleGuid, String moduleVersion, String packageGuid, String packageVersion) {\r
         boolean b = false;\r
         if (this.getGuid().equals(moduleGuid) && this.getPackageId().getGuid().equals(packageGuid)) {\r