]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Update release note to use jdk1.5.0_06 to take place of jdk1.5.0_04
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 12:13:23 +0000 (12:13 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 13 Jul 2006 12:13:23 +0000 (12:13 +0000)
2. Support "Update Far" function
3. Fix bugs in Far operations

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

ReleaseNotes.txt
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/DistributeRule.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Far.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPackage.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Mainfest.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java

index caa335f3149e9f866dccdc723c75496a13a82233..3d2c9739c2ccd4eac50c4a40021cdf33f5f99000 100644 (file)
@@ -64,7 +64,7 @@ Assembler Tool Chain
       GNU binutils 2.16.1 or later\r
 \r
 Java Development Kit ( Java 5.0 or later)\r
-      Sun* jdk-1.5.0_04 or later (http://java.sun.com)\r
+      Sun* jdk-1.5.0_06 or later (http://java.sun.com)\r
     or\r
       Bea Systems* jrockit-25.2.0-jdk1.5.0_03 or later (http://www.bea.com)\r
 \r
index 092d7d10b42b6895e0595a97602cfa5ba7140586..1da3259e9ace3e9879cc39275263426716ebe72f 100644 (file)
@@ -1637,7 +1637,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             jMenuItemProjectUpdateFar.setMnemonic('U');\r
             jMenuItemProjectUpdateFar.setEnabled(true);\r
             jMenuItemProjectUpdateFar.addActionListener(this);\r
-            jMenuItemProjectUpdateFar.setVisible(false);\r
+            jMenuItemProjectUpdateFar.setVisible(true);\r
         }\r
         return jMenuItemProjectUpdateFar;\r
     }\r
index 801cea6b3f0400e720e5f8865e58c2e88ce9dea9..16faf4e40842c46df1f68884b66c2b4f7adc3118 100644 (file)
@@ -59,8 +59,8 @@ public class DistributeRule {
                                                                             AggregationOperation.union(farPkgList,\r
                                                                                                        dbPkgList));\r
 \r
-        return resultList; \r
-        \r
+        return resultList;\r
+\r
     }\r
 \r
     //    public void installPackgCheck (PackageIdentification pkgId, String pkgPath){\r
@@ -86,5 +86,4 @@ public class DistributeRule {
         }\r
         return set;\r
     }\r
-\r
 }\r
index d550d220ac0b200719a4d007047d5b2dc497c261..57116334f2fd9a1ded4082b49da10ba0ffb2cc86 100644 (file)
@@ -62,10 +62,9 @@ public class Far {
         jf = farFile;\r
         this.mainfest = new Mainfest(getMainfestFile());\r
     }\r
-    \r
-    public void creatFar (List<PackageIdentification> pkgList,\r
-            List<PlatformIdentification> plfList, Set<String> fileFilter,\r
-            FarHeader fHeader) throws Exception{\r
+\r
+    public void creatFar(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,\r
+                         Set<String> fileFilter, FarHeader fHeader) throws Exception {\r
         jos = new JarOutputStream(new FileOutputStream(jarFile));\r
 \r
         //\r
@@ -94,23 +93,28 @@ public class Far {
         }\r
         jos.close();\r
     }\r
-    \r
-    private void writeToJar(File file, JarOutputStream jos) throws Exception{\r
-      byte[] buffer = new byte[(int)file.length()];\r
-      FileInputStream fInput = new FileInputStream(file);\r
-      JarEntry entry = new JarEntry(Tools.convertPathToUnixType(Tools.getRelativePath(file.getPath(),Workspace.getCurrentWorkspace())));\r
-      jos.putNextEntry(entry);\r
-      fInput.read(buffer);\r
-      jos.write(buffer);\r
-      fInput.close();\r
+\r
+    private void writeToJar(File file, JarOutputStream jos) throws Exception {\r
+        byte[] buffer = new byte[(int) file.length()];\r
+        FileInputStream fInput = new FileInputStream(file);\r
+        JarEntry entry = new JarEntry(\r
+                                      Tools\r
+                                           .convertPathToUnixType(Tools\r
+                                                                       .getRelativePath(file.getPath(),\r
+                                                                                        Workspace.getCurrentWorkspace())));\r
+        jos.putNextEntry(entry);\r
+        fInput.read(buffer);\r
+        jos.write(buffer);\r
+        fInput.close();\r
     }\r
 \r
     public void InstallFar(String dir) throws Exception {\r
         List<FarFileItem> allFile = mainfest.getAllFileItem();\r
         extract(allFile, dir);\r
     }\r
-    \r
-    public void InstallFar (Map<PlatformIdentification, File> plfMap, Map<PackageIdentification, File> pkgMap) throws Exception{\r
+\r
+    public void InstallFar(Map<PlatformIdentification, File> plfMap, Map<PackageIdentification, File> pkgMap)\r
+                                                                                                             throws Exception {\r
         Set<PlatformIdentification> plfKeys = plfMap.keySet();\r
         Iterator<PlatformIdentification> plfIter = plfKeys.iterator();\r
         while (plfIter.hasNext()) {\r
@@ -149,39 +153,40 @@ public class Far {
     public boolean hibernateToFile() {\r
         return true;\r
     }\r
-//    public static void main(String[] args){\r
-//        try {\r
-//            JarFile jarFile = new JarFile(new File("C:\\cvswork\\newEdk\\jar.jar.far"));\r
-//            JarEntry je= jarFile.getJarEntry("MdePkg/MdePkg.spd");\r
-//            InputStream is = jarFile.getInputStream(je);\r
-//            byte[] buffer = new byte[1];      \r
-//            File tempFile = new File("C:\\cvswork\\newEdk\\tempFile");\r
-//            File tfile2 = new File("C:\\cvswork\\newEdk\\tempFile1");\r
-//            FileOutputStream fos1 = new FileOutputStream(tfile2);\r
-//            FileOutputStream fos = new FileOutputStream(tempFile);\r
-//            int size = is.read(buffer);\r
-//            int totoalSize = size;\r
-//            while ( size >=  0) {\r
-//                fos.write(buffer);\r
-//                size = is.read(buffer);\r
-//                totoalSize = totoalSize + size;\r
-//            }\r
-//            \r
-//            \r
-////            is = jarFile.getInputStream(je);\r
-////            is.read(totalbuffer);\r
-////            fos.write(totalbuffer);\r
-//            fos.close();\r
-//            byte[] totalbuffer = new byte[(int)tempFile.length()];\r
-//            FileInputStream fis = new FileInputStream(tempFile);\r
-//            fis.read(totalbuffer);\r
-//            fos1.write(totalbuffer);\r
-//            fos1.close();\r
-//        }catch(Exception e){\r
-//            \r
-//        }\r
-//    }\r
-    \r
+\r
+    //    public static void main(String[] args){\r
+    //        try {\r
+    //            JarFile jarFile = new JarFile(new File("C:\\cvswork\\newEdk\\jar.jar.far"));\r
+    //            JarEntry je= jarFile.getJarEntry("MdePkg/MdePkg.spd");\r
+    //            InputStream is = jarFile.getInputStream(je);\r
+    //            byte[] buffer = new byte[1];      \r
+    //            File tempFile = new File("C:\\cvswork\\newEdk\\tempFile");\r
+    //            File tfile2 = new File("C:\\cvswork\\newEdk\\tempFile1");\r
+    //            FileOutputStream fos1 = new FileOutputStream(tfile2);\r
+    //            FileOutputStream fos = new FileOutputStream(tempFile);\r
+    //            int size = is.read(buffer);\r
+    //            int totoalSize = size;\r
+    //            while ( size >=  0) {\r
+    //                fos.write(buffer);\r
+    //                size = is.read(buffer);\r
+    //                totoalSize = totoalSize + size;\r
+    //            }\r
+    //            \r
+    //            \r
+    ////            is = jarFile.getInputStream(je);\r
+    ////            is.read(totalbuffer);\r
+    ////            fos.write(totalbuffer);\r
+    //            fos.close();\r
+    //            byte[] totalbuffer = new byte[(int)tempFile.length()];\r
+    //            FileInputStream fis = new FileInputStream(tempFile);\r
+    //            fis.read(totalbuffer);\r
+    //            fos1.write(totalbuffer);\r
+    //            fos1.close();\r
+    //        }catch(Exception e){\r
+    //            \r
+    //        }\r
+    //    }\r
+\r
     public void extract(List<FarFileItem> allFile, String dir) throws Exception {\r
 \r
         Iterator filesItem = allFile.iterator();\r
@@ -191,7 +196,7 @@ public class Far {
         dir += File.separatorChar;\r
         while (filesItem.hasNext()) {\r
             try {\r
-                ffItem = (FarFileItem)filesItem.next();\r
+                ffItem = (FarFileItem) filesItem.next();\r
                 je = jf.getJarEntry(Tools.convertPathToUnixType(ffItem.getDefaultPath()));\r
                 InputStream entryStream = jf.getInputStream(je);\r
                 File file = new File(dir + ffItem.getRelativeFilename());\r
@@ -202,24 +207,23 @@ public class Far {
                     // exists).\r
                     //\r
                     FileOutputStream outputStream = new FileOutputStream(file);\r
-                    \r
 \r
                     try {\r
                         //\r
                         // Read the entry data and write it to the output\r
                         // file.\r
                         //\r
-                        byte[] buffer = new byte[1];      \r
+                        byte[] buffer = new byte[1];\r
                         File tempFile = new File("tempFile");\r
                         FileOutputStream fos = new FileOutputStream(tempFile);\r
                         int size = entryStream.read(buffer);\r
-                        while ( size >=  0) {\r
+                        while (size >= 0) {\r
                             fos.write(buffer);\r
                             size = entryStream.read(buffer);\r
                         }\r
-                        \r
+\r
                         fos.close();\r
-                        byte[] totalBuffer = new byte[(int)tempFile.length()];\r
+                        byte[] totalBuffer = new byte[(int) tempFile.length()];\r
                         FileInputStream fis = new FileInputStream(tempFile);\r
                         fis.read(totalBuffer);\r
                         outputStream.write(totalBuffer);\r
@@ -235,12 +239,11 @@ public class Far {
             } finally {\r
             }\r
         }\r
-                        \r
-     }\r
-    \r
-    \r
-    public void addFileToFar (File file, JarOutputStream farOuputStream, String workDir){\r
-        \r
+\r
+    }\r
+\r
+    public void addFileToFar(File file, JarOutputStream farOuputStream, String workDir) {\r
+\r
     }\r
 \r
     /**\r
@@ -254,6 +257,9 @@ public class Far {
         List<PackageIdentification> result = new ArrayList<PackageIdentification>();\r
 \r
         entry = this.mainfest.getPackgeSpd(pkgId);\r
+        if (entry == null) {\r
+            return result;\r
+        }\r
         if (entry[0] != null) {\r
             try {\r
                 JarEntry je;\r
index 0eaa0df326518455361a4ea0d873e916ae3e9a80..aca9041c78b875730134f67fb980d3e282bb0768 100644 (file)
@@ -14,7 +14,6 @@
  **/\r
 package org.tianocore.frameworkwizard.far;\r
 \r
-import java.io.File;\r
 import java.util.List;\r
 \r
 import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
@@ -84,8 +83,8 @@ public class FarPackage {
     }\r
 \r
     public boolean isIdentityPkg(PackageIdentification pkgId) {\r
-        File file = new File(farFile.getRelativeFilename());\r
-        if (pkgId.getName() == file.getName() && pkgId.getGuid() == guidValue && pkgId.getVersion() == version) {\r
+        //File file = new File(farFile.getRelativeFilename());\r
+        if (pkgId.getGuid().equalsIgnoreCase(guidValue) && pkgId.getVersion().equalsIgnoreCase(version)) {\r
             return true;\r
         }\r
         return false;\r
index 04dbf407193bc3a22be798d6cff4b43c45cac6df..459530763b0d617085cbba2af0bc4033c904fb73 100644 (file)
@@ -57,6 +57,7 @@ public class Mainfest implements ManifestInterface {
     // / Mainfest file element name\r
     // /\r
     final static String mfFileName = "FarMainfest.MF";\r
+\r
     //\r
     // Header\r
     //\r
@@ -131,9 +132,9 @@ public class Mainfest implements ManifestInterface {
     File mfFile = null;\r
 \r
     public FarHeader getHeader() {\r
-      return fhInfo;\r
+        return fhInfo;\r
     }\r
-    \r
+\r
     public Mainfest() throws Exception {\r
         DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();\r
         DocumentBuilder dombuilder = domfac.newDocumentBuilder();\r
@@ -163,8 +164,8 @@ public class Mainfest implements ManifestInterface {
         this.fhInfo = fHeader;\r
     }\r
 \r
-    public void createManifest(List<PackageIdentification> pkgList,\r
-            List<PlatformIdentification> plfList, Set<String> fileFilter) throws Exception {\r
+    public void createManifest(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,\r
+                               Set<String> fileFilter) throws Exception {\r
 \r
         //\r
         // Add Package and it's contents to FarPackageList.\r
@@ -202,7 +203,7 @@ public class Mainfest implements ManifestInterface {
 \r
     public void addPkgToPkgList(PackageIdentification packageId, Set<String> fileFilter) throws Exception {\r
         files.add(packageId.getSpdFile());\r
-        \r
+\r
         FarPackage farPackage = new FarPackage();\r
         //\r
         // Add SPD file to FarPackage\r
@@ -211,17 +212,17 @@ public class Mainfest implements ManifestInterface {
 \r
         FarFileItem ffItem = new FarFileItem(spdFile.getName(), FarMd5.md5(spdFile));\r
         farPackage.setFarFile(ffItem);\r
-        \r
+\r
         //\r
         // Add package guid value.\r
         //\r
         farPackage.setGuidValue(packageId.getGuid());\r
-        \r
+\r
         //\r
         // Add package version\r
         //\r
         farPackage.setVersion(packageId.getVersion());\r
-        \r
+\r
         //\r
         // Add DefaultPat: Package absoulte path - Workspace absolut\r
         // path.\r
@@ -245,7 +246,7 @@ public class Mainfest implements ManifestInterface {
         // Remove current package's SPD file\r
         //\r
         fileSet.remove(packageId.getSpdFile());\r
-        \r
+\r
         files.addAll(fileSet);\r
 \r
         Iterator<File> iter = fileSet.iterator();\r
@@ -256,26 +257,25 @@ public class Mainfest implements ManifestInterface {
             ffItem = new FarFileItem(fileRelativePath, FarMd5.md5(normalFile));\r
             contents.add(ffItem);\r
         }\r
-        \r
+\r
         farPackage.setContentList(contents);\r
-        \r
-//        List<FarPlatformItem> fpfList = new ArrayList<FarPlatformItem>();\r
-//\r
-//        iter = fpdFileSet.iterator();\r
-//\r
-//        while (iter.hasNext()) {\r
-//            File fpdFile = iter.next();\r
-//            PlatformIdentification platformId = new PlatformIdentification(wsTool\r
-//                    .getId(fpdFile.getPath(), OpenFile.openFpdFile(fpdFile\r
-//                            .getPath())));\r
-//            addPlatformIdToFarPlatformItemList(fpfList, platformId);\r
-//        }\r
-//        farPackage.setFarPlatformList(fpfList);\r
+\r
+        //        List<FarPlatformItem> fpfList = new ArrayList<FarPlatformItem>();\r
+        //\r
+        //        iter = fpdFileSet.iterator();\r
+        //\r
+        //        while (iter.hasNext()) {\r
+        //            File fpdFile = iter.next();\r
+        //            PlatformIdentification platformId = new PlatformIdentification(wsTool\r
+        //                    .getId(fpdFile.getPath(), OpenFile.openFpdFile(fpdFile\r
+        //                            .getPath())));\r
+        //            addPlatformIdToFarPlatformItemList(fpfList, platformId);\r
+        //        }\r
+        //        farPackage.setFarPlatformList(fpfList);\r
         fPkgList.add(farPackage);\r
     }\r
 \r
-    private void recursiveDirectory(Set<File> files, Set<File> fpds, File dir,\r
-            Set<String> fileFilter) {\r
+    private void recursiveDirectory(Set<File> files, Set<File> fpds, File dir, Set<String> fileFilter) {\r
         if (isFilter(dir, fileFilter)) {\r
             return;\r
         }\r
@@ -285,11 +285,11 @@ public class Mainfest implements ManifestInterface {
                 if (isFilter(allFilesInDir[i], fileFilter)) {\r
                     continue;\r
                 }\r
-//                if (allFilesInDir[i].getPath().toLowerCase().endsWith(".fpd")) {\r
-//                    fpds.add(allFilesInDir[i]);\r
-//                } else {\r
-                    files.add(allFilesInDir[i]);\r
-//                }\r
+                //                if (allFilesInDir[i].getPath().toLowerCase().endsWith(".fpd")) {\r
+                //                    fpds.add(allFilesInDir[i]);\r
+                //                } else {\r
+                files.add(allFilesInDir[i]);\r
+                //                }\r
             } else {\r
                 recursiveDirectory(files, fpds, allFilesInDir[i], fileFilter);\r
             }\r
@@ -298,7 +298,7 @@ public class Mainfest implements ManifestInterface {
 \r
     public void addPlatformIdToFarPlatformItemList(PlatformIdentification platformId) throws Exception {\r
         files.add(platformId.getFpdFile());\r
-        \r
+\r
         FarPlatformItem fpfItem = new FarPlatformItem();\r
         FarFileItem ffItem;\r
         String fpfPath = platformId.getPath();\r
@@ -306,7 +306,8 @@ public class Mainfest implements ManifestInterface {
         //\r
         // Add farFileName\r
         //\r
-        ffItem = new FarFileItem(Tools.getRelativePath(fpfFile.getPath(),Workspace.getCurrentWorkspace()), FarMd5.md5(fpfFile));\r
+        ffItem = new FarFileItem(Tools.getRelativePath(fpfFile.getPath(), Workspace.getCurrentWorkspace()),\r
+                                 FarMd5.md5(fpfFile));\r
         fpfItem.setFarFile(ffItem);\r
 \r
         //\r
@@ -343,16 +344,18 @@ public class Mainfest implements ManifestInterface {
             // identification.\r
             //\r
 \r
-            PackageIdentification pkgId = new PackageIdentification(fPkg.getFarFile().getRelativeFilename(), fPkg.getGuidValue(), fPkg.getVersion());\r
-            pkgId.setPath(Workspace.getCurrentWorkspace() + File.separatorChar + fPkg.getDefaultPath() + File.separatorChar + fPkg.getFarFile().getRelativeFilename());\r
-//            wsTool.getId(\r
-//                    Workspace.getCurrentWorkspace() + File.separatorChar\r
-//                            + fPkg.getDefaultPath(), OpenFile\r
-//                            .openFpdFile(Workspace.getCurrentWorkspace()\r
-//                                    + File.separatorChar\r
-//                                    + fPkg.getDefaultPath()\r
-//                                    + File.separatorChar\r
-//                                    + fPkg.getFarFile().getRelativeFilename()));\r
+            PackageIdentification pkgId = new PackageIdentification(fPkg.getFarFile().getRelativeFilename(),\r
+                                                                    fPkg.getGuidValue(), fPkg.getVersion());\r
+            pkgId.setPath(Workspace.getCurrentWorkspace() + File.separatorChar + fPkg.getDefaultPath()\r
+                          + File.separatorChar + fPkg.getFarFile().getRelativeFilename());\r
+            //            wsTool.getId(\r
+            //                    Workspace.getCurrentWorkspace() + File.separatorChar\r
+            //                            + fPkg.getDefaultPath(), OpenFile\r
+            //                            .openFpdFile(Workspace.getCurrentWorkspace()\r
+            //                                    + File.separatorChar\r
+            //                                    + fPkg.getDefaultPath()\r
+            //                                    + File.separatorChar\r
+            //                                    + fPkg.getFarFile().getRelativeFilename()));\r
             pkgList.add(pkgId);\r
         }\r
         return pkgList;\r
@@ -361,8 +364,7 @@ public class Mainfest implements ManifestInterface {
     /**\r
      * \r
      */\r
-    public List<PlatformIdentification> getPlatformList() throws Exception,\r
-            IOException, XmlException {\r
+    public List<PlatformIdentification> getPlatformList() throws Exception, IOException, XmlException {\r
         //\r
         // PlatformIdentification set.\r
         //\r
@@ -370,21 +372,21 @@ public class Mainfest implements ManifestInterface {
         Iterator plfItem = this.fPlfList.iterator();\r
         while (plfItem.hasNext()) {\r
             FarPlatformItem fpfItem = (FarPlatformItem) plfItem.next();\r
-            File file = new File(Workspace.getCurrentWorkspace()\r
-                    + File.separatorChar \r
-                    + fpfItem.getFarFile().getRelativeFilename());\r
+            File file = new File(Workspace.getCurrentWorkspace() + File.separatorChar\r
+                                 + fpfItem.getFarFile().getRelativeFilename());\r
             //\r
             // Set platformIdentificaiton's path as absolutly path (include\r
             // workspace and FPD relatively path)\r
             //\r
-            PlatformIdentification plfId = new PlatformIdentification (fpfItem.getFarFile().getRelativeFilename(), fpfItem.getGuidValue(),fpfItem.getVersion(),\r
-                    file.getPath());\r
-            \r
-//                (PlatformIdentification) wsTool\r
-//                    .getId(file.getParent(), OpenFile.openFpdFile(Workspace\r
-//                            .getCurrentWorkspace()\r
-//                            + File.separatorChar\r
-//                            + fpfItem.getFarFile().getRelativeFilename()));\r
+            PlatformIdentification plfId = new PlatformIdentification(fpfItem.getFarFile().getRelativeFilename(),\r
+                                                                      fpfItem.getGuidValue(), fpfItem.getVersion(),\r
+                                                                      file.getPath());\r
+\r
+            //                (PlatformIdentification) wsTool\r
+            //                    .getId(file.getParent(), OpenFile.openFpdFile(Workspace\r
+            //                            .getCurrentWorkspace()\r
+            //                            + File.separatorChar\r
+            //                            + fpfItem.getFarFile().getRelativeFilename()));\r
             plfList.add(plfId);\r
         }\r
         return plfList;\r
@@ -393,7 +395,7 @@ public class Mainfest implements ManifestInterface {
     public List<FarFileItem> getPlatformContents(PlatformIdentification platformId) {\r
         List<FarFileItem> result = new ArrayList<FarFileItem>();\r
         Iterator<FarPlatformItem> iter = this.fPlfList.iterator();\r
-        \r
+\r
         while (iter.hasNext()) {\r
             FarPlatformItem item = iter.next();\r
             if (item.isIdentityPlf(platformId)) {\r
@@ -401,12 +403,12 @@ public class Mainfest implements ManifestInterface {
                 farFileItem.setDefaultPath(farFileItem.getRelativeFilename());\r
                 farFileItem.setRelativeFilename(Tools.getFileNameOnly(farFileItem.getRelativeFilename()));\r
                 result.add(farFileItem);\r
-                break ;\r
+                break;\r
             }\r
         }\r
         return result;\r
     }\r
-    \r
+\r
     public List<FarFileItem> getPackageContents(PackageIdentification packageId) {\r
         List<FarFileItem> farFileList = new ArrayList<FarFileItem>();\r
         Iterator pkgItem = this.fPkgList.iterator();\r
@@ -424,23 +426,22 @@ public class Mainfest implements ManifestInterface {
                 //\r
                 // Add all farfiles in <FarPlatformList> to list.\r
                 //\r
-//                List<FarPlatformItem> plfList = pkg.getFarPlatformList();\r
-//                Iterator plfItem = plfList.iterator();\r
-//                while (plfItem.hasNext()) {\r
-//                    farFileList.add(((FarPlatformItem) plfItem.next())\r
-//                            .getFarFile());\r
-//                }\r
-                \r
+                //                List<FarPlatformItem> plfList = pkg.getFarPlatformList();\r
+                //                Iterator plfItem = plfList.iterator();\r
+                //                while (plfItem.hasNext()) {\r
+                //                    farFileList.add(((FarPlatformItem) plfItem.next())\r
+                //                            .getFarFile());\r
+                //                }\r
+\r
                 Iterator<FarFileItem> ffIter = farFileList.iterator();\r
-                while(ffIter.hasNext()){\r
-                    FarFileItem  ffItem = ffIter.next();\r
+                while (ffIter.hasNext()) {\r
+                    FarFileItem ffItem = ffIter.next();\r
                     ffItem.setDefaultPath(pkg.getDefaultPath() + File.separatorChar + ffItem.getRelativeFilename());\r
                 }\r
                 break;\r
             }\r
         }\r
 \r
-        \r
         return farFileList;\r
     }\r
 \r
@@ -449,20 +450,20 @@ public class Mainfest implements ManifestInterface {
      * @param pkgId\r
      * @return String: return string represent jar file entry; \r
      */\r
-    public String[] getPackgeSpd(PackageIdentification pkgId){\r
+    public String[] getPackgeSpd(PackageIdentification pkgId) {\r
         Iterator pkgItem = this.fPkgList.iterator();\r
         String[] entryStr = new String[2];\r
         while (pkgItem.hasNext()) {\r
             FarPackage pkg = (FarPackage) pkgItem.next();\r
             if (pkg.isIdentityPkg(pkgId)) {\r
-                entryStr[0] =  pkg.getFarFile().getRelativeFilename();\r
-                entryStr[1] = pkg.getDefaultPath() ;\r
+                entryStr[0] = pkg.getFarFile().getRelativeFilename();\r
+                entryStr[1] = pkg.getDefaultPath();\r
                 return entryStr;\r
             }\r
         }\r
         return null;\r
-    } \r
-    \r
+    }\r
+\r
     public List<FarFileItem> getPackageContents() {\r
         //\r
         // In this farFilelist,all FarFileItem's relativeFileName should be\r
@@ -482,18 +483,16 @@ public class Mainfest implements ManifestInterface {
             //\r
             // Set farFileItem relativeFileName = absolutePath + file Name.\r
             //\r
-            farFileList.add(new FarFileItem(pkg.getDefaultPath()\r
-                    + File.separatorChar + ffItem.getRelativeFilename(), ffItem\r
-                    .getMd5Value()));\r
+            farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separatorChar + ffItem.getRelativeFilename(),\r
+                                            ffItem.getMd5Value()));\r
             //\r
             // Add all files in contents to list.\r
             //\r
             Iterator contentsItem = pkg.getContentList().iterator();\r
             while (contentsItem.hasNext()) {\r
                 ffItem = (FarFileItem) contentsItem.next();\r
-                farFileList.add(new FarFileItem(pkg.getDefaultPath()\r
-                        + File.separator + ffItem.getRelativeFilename(), ffItem\r
-                        .getMd5Value()));\r
+                farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),\r
+                                                ffItem.getMd5Value()));\r
             }\r
             //\r
             // Add all farfiles in <FarPlatformList> to list.\r
@@ -502,9 +501,8 @@ public class Mainfest implements ManifestInterface {
             Iterator plfItem = plfList.iterator();\r
             while (plfItem.hasNext()) {\r
                 ffItem = ((FarPlatformItem) plfItem.next()).getFarFile();\r
-                farFileList.add(new FarFileItem(pkg.getDefaultPath()\r
-                        + File.separator + ffItem.getRelativeFilename(), ffItem\r
-                        .getMd5Value()));\r
+                farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),\r
+                                                ffItem.getMd5Value()));\r
             }\r
         }\r
         return farFileList;\r
@@ -520,29 +518,29 @@ public class Mainfest implements ManifestInterface {
         }\r
         return null;\r
     }\r
-    \r
-//    public void setPackageInstallPath(PackageIdentification packageId, String path) {\r
-//        Iterator<FarPackage> pkgItr = this.fPkgList.iterator();\r
-//        while (pkgItr.hasNext()) {\r
-//            FarPackage farPackage = pkgItr.next();\r
-//            if (farPackage.isIdentityPkg(packageId)) {\r
-//                farPackage.setDefaultPath(path);\r
-//                return ;\r
-//            }\r
-//        }\r
-//    }\r
-//\r
-//    public void setPlatformInstallPath(PlatformIdentification platformId, String path) {\r
-//        Iterator<FarPlatformItem> plfItr = this.fPlfList.iterator();\r
-//        while (plfItr.hasNext()) {\r
-//            FarPlatformItem farPlatform = plfItr.next();\r
-//            if (farPlatform.i.isIdentity(platformId)) {\r
-//                farPackage.setDefaultPath(path);\r
-//                return ;\r
-//            }\r
-//        }\r
-//    }\r
-    \r
+\r
+    //    public void setPackageInstallPath(PackageIdentification packageId, String path) {\r
+    //        Iterator<FarPackage> pkgItr = this.fPkgList.iterator();\r
+    //        while (pkgItr.hasNext()) {\r
+    //            FarPackage farPackage = pkgItr.next();\r
+    //            if (farPackage.isIdentityPkg(packageId)) {\r
+    //                farPackage.setDefaultPath(path);\r
+    //                return ;\r
+    //            }\r
+    //        }\r
+    //    }\r
+    //\r
+    //    public void setPlatformInstallPath(PlatformIdentification platformId, String path) {\r
+    //        Iterator<FarPlatformItem> plfItr = this.fPlfList.iterator();\r
+    //        while (plfItr.hasNext()) {\r
+    //            FarPlatformItem farPlatform = plfItr.next();\r
+    //            if (farPlatform.i.isIdentity(platformId)) {\r
+    //                farPackage.setDefaultPath(path);\r
+    //                return ;\r
+    //            }\r
+    //        }\r
+    //    }\r
+\r
     public List<FarFileItem> getAllFileItem() {\r
         //\r
         // The farFileName in this list are all abosulte path.\r
@@ -556,8 +554,7 @@ public class Mainfest implements ManifestInterface {
         //\r
         // Add far files in <FarPlatformList> to list\r
         //\r
-        NodeList elementList = this.mainfestDoc\r
-                .getElementsByTagName(farPlatformList);\r
+        NodeList elementList = this.mainfestDoc.getElementsByTagName(farPlatformList);\r
         for (int i = 0; i < elementList.getLength(); i++) {\r
             //\r
             // Get <farPlatform> node list.\r
@@ -575,15 +572,13 @@ public class Mainfest implements ManifestInterface {
                     //\r
                     // Get child node value and set to platformIdentification.\r
                     //\r
-                    if (tempNode.getNodeName().equalsIgnoreCase(\r
-                            farPackage_FarfileName)) {\r
+                    if (tempNode.getNodeName().equalsIgnoreCase(farPackage_FarfileName)) {\r
                         NamedNodeMap farAttr = tempNode.getAttributes();\r
                         //\r
                         // Change relative path to absolute one\r
                         //\r
-                        FarFileItem farFile = new FarFileItem(tempNode\r
-                                .getTextContent(), farAttr.getNamedItem(\r
-                                farFileName_Md5sum).getTextContent());\r
+                        FarFileItem farFile = new FarFileItem(tempNode.getTextContent(),\r
+                                                              farAttr.getNamedItem(farFileName_Md5sum).getTextContent());\r
                         ffiList.add(farFile);\r
                     }\r
                 }\r
@@ -596,8 +591,7 @@ public class Mainfest implements ManifestInterface {
         //\r
         // create mainfest root node\r
         //\r
-        Element rootNode = this.mainfestDoc\r
-                .createElement("FrameworkArchiveManifest");\r
+        Element rootNode = this.mainfestDoc.createElement("FrameworkArchiveManifest");\r
         this.mainfestDoc.appendChild(rootNode);\r
 \r
         //\r
@@ -675,8 +669,7 @@ public class Mainfest implements ManifestInterface {
         // Write the DOM document to the file\r
         //\r
         Transformer xformer = TransformerFactory.newInstance().newTransformer();\r
-        xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",\r
-                "2");\r
+        xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");\r
         xformer.setOutputProperty(OutputKeys.INDENT, "yes");\r
 \r
         //\r
@@ -687,8 +680,7 @@ public class Mainfest implements ManifestInterface {
         // Prepare the output file, get the Mainifest file name from <FarHeader>\r
         // /<FarName>.\r
         //\r
-        this.mfFile = new File(Workspace.getCurrentWorkspace()\r
-                + File.separatorChar + mfFileName);\r
+        this.mfFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar + mfFileName);\r
         //\r
         // generate all directory path\r
         //\r
@@ -697,8 +689,7 @@ public class Mainfest implements ManifestInterface {
     }\r
 \r
     public void pkgToFarPkgNode(Element parentNode, FarPackage pkgItem) {\r
-        Element pkgNode = this.mainfestDoc\r
-                .createElement(farPackageList_FarPackage);\r
+        Element pkgNode = this.mainfestDoc.createElement(farPackageList_FarPackage);\r
         //\r
         // Add <FarFileName>\r
         //\r
@@ -714,8 +705,7 @@ public class Mainfest implements ManifestInterface {
         //\r
         // Add <DefaultPath>\r
         //\r
-        setStrItemToNode(pkgNode, pkgItem.getDefaultPath(),\r
-                farPackage_DefaultPath);\r
+        setStrItemToNode(pkgNode, pkgItem.getDefaultPath(), farPackage_DefaultPath);\r
 \r
         //\r
         // Add <Contents>\r
@@ -730,8 +720,7 @@ public class Mainfest implements ManifestInterface {
     }\r
 \r
     public void PlfToPlatformNode(Element parentNode, FarPlatformItem fplItem) {\r
-        Element fplNode = this.mainfestDoc\r
-                .createElement(farPlatformList_FarPlatform);\r
+        Element fplNode = this.mainfestDoc.createElement(farPlatformList_FarPlatform);\r
         //\r
         // Add <FarFileName>\r
         //\r
@@ -752,17 +741,15 @@ public class Mainfest implements ManifestInterface {
     }\r
 \r
     public void ffiToFfNode(Element parentNode, FarFileItem ffi) {\r
-        Element farFileName = this.mainfestDoc\r
-                .createElement(farPackage_FarfileName);\r
+        Element farFileName = this.mainfestDoc.createElement(farPackage_FarfileName);\r
         farFileName.setTextContent(ffi.getRelativeFilename());\r
         System.out.println(farFileName.getTextContent());\r
-        System.out.println(ffi.getRelativeFilename()); \r
+        System.out.println(ffi.getRelativeFilename());\r
         farFileName.setAttribute(farFileName_Md5sum, ffi.getMd5Value());\r
         parentNode.appendChild(farFileName);\r
     }\r
 \r
-    public void setStrItemToNode(Element parentNode, String strValue,\r
-            String strName) {\r
+    public void setStrItemToNode(Element parentNode, String strValue, String strName) {\r
         Element node = this.mainfestDoc.createElement(strName);\r
         node.setTextContent(strValue);\r
         parentNode.appendChild(node);\r
@@ -804,13 +791,13 @@ public class Mainfest implements ManifestInterface {
         } else {\r
             return;\r
         }\r
-               NodeList childList = headerNode.getChildNodes();\r
+        NodeList childList = headerNode.getChildNodes();\r
         Node node = null;\r
         String nodeName = null;\r
         for (int i = 0; i < childList.getLength(); i++) {\r
             node = childList.item(i);\r
             nodeName = node.getNodeName();\r
-          if (nodeName.equalsIgnoreCase(farHeader_FarName)) {\r
+            if (nodeName.equalsIgnoreCase(farHeader_FarName)) {\r
                 String nodeValue = node.getTextContent();\r
                 this.fhInfo.setFarName(nodeValue);\r
             } else if (nodeName.equalsIgnoreCase(guidValue)) {\r
@@ -844,7 +831,7 @@ public class Mainfest implements ManifestInterface {
         }\r
         NodeList fpnList = farPkgNode.getChildNodes();\r
         for (int i = 0; i < fpnList.getLength(); i++) {\r
-            if (fpnList.item(i).getNodeType()== Node.TEXT_NODE){\r
+            if (fpnList.item(i).getNodeType() == Node.TEXT_NODE) {\r
                 continue;\r
             }\r
             FarPackage fpItem = new FarPackage();\r
@@ -885,15 +872,14 @@ public class Mainfest implements ManifestInterface {
      * @param fpfListNode\r
      * @param plfList\r
      */\r
-    public void parseFarPlatformList(Node fpfListNode,\r
-            List<FarPlatformItem> plfList) {\r
+    public void parseFarPlatformList(Node fpfListNode, List<FarPlatformItem> plfList) {\r
         //\r
         // Get <FarPlatform> list.\r
         //\r
         NodeList child = fpfListNode.getChildNodes();\r
         Node farPlfNode;\r
         for (int i = 0; i < child.getLength(); i++) {\r
-            if (child.item(i).getNodeType()== Node.TEXT_NODE){\r
+            if (child.item(i).getNodeType() == Node.TEXT_NODE) {\r
                 continue;\r
             }\r
             farPlfNode = child.item(i);\r
@@ -936,7 +922,7 @@ public class Mainfest implements ManifestInterface {
         NodeList contentList = contentsNode.getChildNodes();\r
         Node contentNode;\r
         for (int i = 0; i < contentList.getLength(); i++) {\r
-            if (contentList.item(i).getNodeType()== Node.TEXT_NODE){\r
+            if (contentList.item(i).getNodeType() == Node.TEXT_NODE) {\r
                 continue;\r
             }\r
             contentNode = contentList.item(i);\r
@@ -950,21 +936,20 @@ public class Mainfest implements ManifestInterface {
     public FarFileItem parseFarFile(Node farFileNode) {\r
         String ffName = farFileNode.getTextContent();\r
         NamedNodeMap attr = farFileNode.getAttributes();\r
-        FarFileItem ffItem = new FarFileItem(ffName, attr.getNamedItem(\r
-                farFileName_Md5sum).getTextContent());\r
+        FarFileItem ffItem = new FarFileItem(ffName, attr.getNamedItem(farFileName_Md5sum).getTextContent());\r
         return ffItem;\r
     }\r
 \r
     public boolean isFilter(File file, Set<String> fileter) {\r
-      Iterator<String> iter = fileter.iterator();\r
-      while (iter.hasNext()) {\r
-        Pattern pattern = Pattern.compile(iter.next());\r
-        Matcher matcher = pattern.matcher(file.getName());\r
-        \r
-        if(matcher.find()) {\r
-                    return true;\r
-                }\r
+        Iterator<String> iter = fileter.iterator();\r
+        while (iter.hasNext()) {\r
+            Pattern pattern = Pattern.compile(iter.next());\r
+            Matcher matcher = pattern.matcher(file.getName());\r
+\r
+            if (matcher.find()) {\r
+                return true;\r
             }\r
+        }\r
         return false;\r
     }\r
 \r
index 347824cc018205ce1409d7f2fdcfd5c0f37492a4..ac919cbcbe95106b9aaedd6164e5b345400d2a92 100644 (file)
@@ -324,6 +324,15 @@ public class InstallStepTwo extends IDialog implements MouseListener {
             this.setVisible(false);\r
             this.dispose();\r
         } else if (e.getSource() == jButtonFinish) {\r
+\r
+            if (jTablePackage.isEditing()) {\r
+                jTablePackage.getCellEditor().stopCellEditing();\r
+            }\r
+\r
+            if (jTablePlatform.isEditing()) {\r
+                jTablePlatform.getCellEditor().stopCellEditing();\r
+            }\r
+\r
             List<String> packageList = new ArrayList<String>();\r
             List<String> platformList = new ArrayList<String>();\r
             //\r
@@ -419,11 +428,17 @@ public class InstallStepTwo extends IDialog implements MouseListener {
     }\r
 \r
     private boolean isPathContainMutual(File path1, File path2) {\r
-        if (path1.getPath().startsWith(path2.getParent())) {\r
-            return true;\r
-        }\r
-        if (path2.getPath().startsWith(path1.getPath())) {\r
-            return true;\r
+        String s1 = Tools.addFileSeparator(path1.getPath());\r
+        String s2 = Tools.addFileSeparator(path2.getParent());\r
+\r
+        if (s1.length() > s2.length()) {\r
+            if (s1.substring(0, s2.length()).equalsIgnoreCase(s2)) {\r
+                return true;\r
+            }\r
+        } else {\r
+            if (s2.substring(0, s1.length()).equalsIgnoreCase(s1)) {\r
+                return true;\r
+            }\r
         }\r
         return false;\r
     }\r
index afe0fbe9e8971ec8a08185540c835eff37bb2e32..ae36591d58055f8486a3cfe36111fc97e28fa9ed 100644 (file)
@@ -134,7 +134,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
     private JTextField getJTextFieldFarFile() {\r
         if (jTextFieldFarFile == null) {\r
             jTextFieldFarFile = new JTextField();\r
-            jTextFieldFarFile.setBounds(new java.awt.Rectangle(130,80,436,20));\r
+            jTextFieldFarFile.setBounds(new java.awt.Rectangle(130, 80, 436, 20));\r
         }\r
         return jTextFieldFarFile;\r
     }\r
@@ -179,6 +179,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
             WorkspaceTools wt = new WorkspaceTools();\r
             farVector = wt.getAllFars();\r
             jListFarFromDb.setListData(farVector);\r
+            jListFarFromDb.setSelectionMode(0);\r
         }\r
         return jListFarFromDb;\r
     }\r
@@ -215,7 +216,7 @@ public class UpdateStepOne extends IDialog implements MouseListener {
             jLabel1.setBounds(new java.awt.Rectangle(30, 110, 355, 18));\r
             jLabel1.setText("Choose FAR from current framework database");\r
             jLabel = new JLabel();\r
-            jLabel.setBounds(new java.awt.Rectangle(30,80,97,20));\r
+            jLabel.setBounds(new java.awt.Rectangle(30, 80, 97, 20));\r
             jLabel.setText("Choose FAR file: ");\r
             jContentPane = new JPanel();\r
             jContentPane.setLayout(null);\r
@@ -231,51 +232,48 @@ public class UpdateStepOne extends IDialog implements MouseListener {
         return jContentPane;\r
     }\r
 \r
-  public void mouseClicked(MouseEvent e) {\r
-    if (e.getSource() == jButtonCancel) {\r
-      this.setVisible(false);\r
-    }\r
-    else if (e.getSource() == jButtonNext) {\r
-      //\r
-      // Judge if FAR file is existed\r
-      //\r
-      farFile = new File(jTextFieldFarFile.getText());\r
-      if ( ! farFile.exists() || ! farFile.isFile()) {\r
-        Log.err("Please choose a FAR file already exists. ");\r
-        return ;\r
-      } \r
-      \r
-      //\r
-      // Judge FAR is valid\r
-      //\r
-      try{\r
-          JarFile file = new JarFile(farFile);\r
-          this.far  = new Far(file);\r
-      } catch (Exception ex){\r
-          Log.err(ex.getMessage());\r
-      }\r
-      \r
-      \r
-      //\r
-      // Add more logic process here\r
-      //\r
-      if (jListFarFromDb.getSelectedValue() == null) {\r
-        Log.err("Please choose a FAR from framework database. ");\r
-        return ;\r
-      }\r
-      \r
-      if (stepTwo == null) {\r
+    public void mouseClicked(MouseEvent e) {\r
+        if (e.getSource() == jButtonCancel) {\r
+            this.setVisible(false);\r
+        } else if (e.getSource() == jButtonNext) {\r
+            //\r
+            // Judge if FAR file is existed\r
+            //\r
+            farFile = new File(jTextFieldFarFile.getText());\r
+            if (!farFile.exists() || !farFile.isFile()) {\r
+                Log.err("Please choose a FAR file already exists. ");\r
+                return;\r
+            }\r
+\r
+            //\r
+            // Judge FAR is valid\r
+            //\r
+            try {\r
+                JarFile file = new JarFile(farFile);\r
+                this.far = new Far(file);\r
+            } catch (Exception ex) {\r
+                Log.err(ex.getMessage());\r
+            }\r
+\r
+            //\r
+            // Add more logic process here\r
+            //\r
+            if (jListFarFromDb.getSelectedValue() == null) {\r
+                Log.err("Please choose a FAR from framework database. ");\r
+                return;\r
+            }\r
+\r
+            if (stepTwo == null) {\r
                 stepTwo = new UpdateStepTwo(this, true, this);\r
-      }\r
-      this.setVisible(false);\r
-      stepTwo.prepareTable();\r
-      stepTwo.setVisible(true);\r
-    }\r
-    else if (e.getSource() == jButtonBrowser) {\r
-      JFileChooser fc = new JFileChooser();\r
-      fc.setAcceptAllFileFilterUsed(false);\r
-      fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));\r
-      fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));\r
+            }\r
+            this.setVisible(false);\r
+            stepTwo.prepareTable();\r
+            stepTwo.setVisible(true);\r
+        } else if (e.getSource() == jButtonBrowser) {\r
+            JFileChooser fc = new JFileChooser();\r
+            fc.setAcceptAllFileFilterUsed(false);\r
+            fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));\r
+            fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));\r
 \r
             int result = fc.showSaveDialog(new JPanel());\r
             if (result == JFileChooser.APPROVE_OPTION) {\r
index 77c8d370ce00f7c73a5e3cd48ba3542e83b8093a..34c5a42d96778a6cab83b755dfddfd2c8c405a05 100644 (file)
@@ -34,6 +34,7 @@ import javax.swing.JTable;
 import javax.swing.ListSelectionModel;\r
 import javax.swing.table.DefaultTableModel;\r
 \r
+import org.tianocore.frameworkwizard.common.DataType;\r
 import org.tianocore.frameworkwizard.common.Log;\r
 import org.tianocore.frameworkwizard.common.Tools;\r
 import org.tianocore.frameworkwizard.common.ui.IDialog;\r
@@ -71,7 +72,8 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
     private JTable jTablePackage = null;\r
 \r
     private PartialTableModel model = null;\r
-  List<PackageIdentification> updatPkgList = new ArrayList<PackageIdentification>();\r
+\r
+    List<PackageIdentification> updatPkgList = new ArrayList<PackageIdentification>();\r
 \r
     public UpdateStepTwo(IDialog iDialog, boolean modal, UpdateStepOne stepOne) {\r
         this(iDialog, modal);\r
@@ -183,25 +185,24 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
             WorkspaceTools wt = new WorkspaceTools();\r
             List<PackageIdentification> packagesInDb = wt.getAllPackages();\r
 \r
-      updatPkgList = AggregationOperation.intersection(packagesInDb, packagesInFar);\r
+            updatPkgList = AggregationOperation.intersection(packagesInDb, packagesInFar);\r
             //\r
             // Change here to get packages and platforms from FAR\r
             //\r
-      Iterator<PackageIdentification> iter = updatPkgList.iterator() ;//packageList.iterator();\r
-      while (iter.hasNext()) {\r
-        String[] str = new String[4];\r
-        PackageIdentification item = iter.next();\r
-        str[0] = item.getName();\r
-        str[1] = item.getVersion();\r
-        str[2] = item.getGuid();\r
-        str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));\r
-        model.addRow(str);\r
-      } \r
-    }\r
-    catch (Exception ex) {\r
-      ex.printStackTrace();\r
+            Iterator<PackageIdentification> iter = updatPkgList.iterator();//packageList.iterator();\r
+            while (iter.hasNext()) {\r
+                String[] str = new String[4];\r
+                PackageIdentification item = iter.next();\r
+                str[0] = item.getName();\r
+                str[1] = item.getVersion();\r
+                str[2] = item.getGuid();\r
+                str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));\r
+                model.addRow(str);\r
+            }\r
+        } catch (Exception ex) {\r
+            ex.printStackTrace();\r
+        }\r
     }\r
-  }\r
 \r
     /**\r
      * This is the default constructor\r
@@ -224,184 +225,191 @@ public class UpdateStepTwo extends IDialog implements MouseListener {
         this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);\r
     }\r
 \r
-  /**\r
-   * This method initializes jContentPane\r
-   * \r
-   * @return javax.swing.JPanel\r
-   */\r
-  private JPanel getJContentPane() {\r
-    if (jContentPane == null) {\r
-      jLabel = new JLabel();\r
-      jLabel.setBounds(new java.awt.Rectangle(30,70,281,20));\r
-      jLabel.setText("Following packages will be updated: ");\r
-      jContentPane = new JPanel();\r
-      jContentPane.setLayout(null);\r
-      jContentPane.add(getJTextArea(), null);\r
-      jContentPane.add(getJButtonCancel(), null);\r
-      jContentPane.add(getJButtonFinish(), null);\r
-      jContentPane.add(getJButtonPrevious(), null);\r
-      jContentPane.add(getJScrollPane(), null);\r
-      jContentPane.add(jLabel, null);\r
-    }\r
-    return jContentPane;\r
-  }\r
-  public void mouseClicked(MouseEvent e) {\r
-    if (e.getSource() == jButtonCancel) {\r
-      this.setVisible(false);\r
-    }\r
-    else if (e.getSource() == jButtonFinish) {\r
-      //\r
-      // Check depedency ?\r
-      //\r
-      WorkspaceTools wsTools = new WorkspaceTools();\r
-      \r
-      Iterator<PackageIdentification> iter = updatPkgList.iterator();\r
-      List<PackageIdentification> depResultList = new ArrayList<PackageIdentification>();\r
-      while (iter.hasNext()){\r
-          List<PackageIdentification> depPkgList = stepOne.getFar().getPackageDependencies(iter.next());\r
-          depResultList = AggregationOperation.union(depResultList, depPkgList);\r
-      }\r
-      \r
-      List<PackageIdentification> dbPkgList = DistributeRule.vectorToList(wsTools.getAllPackages());\r
-      List<PackageIdentification> resultList = AggregationOperation.minus(depResultList, AggregationOperation.union(\r
-              this.updatPkgList, dbPkgList));\r
-      Iterator resultIter = resultList.iterator();\r
-      while (resultIter.hasNext()){\r
-          Log.err("Missing dependency package " + ((PackageIdentification)resultIter.next()).toString() + "in workspace!");\r
-          return;\r
-      }\r
-      \r
-      //\r
-      // Remove all update packages\r
-      //\r
-      //\r
-      // For all packages, remove all files. \r
-      // Exception FPD file still in DB\r
-      //\r
-      Vector<PlatformIdentification> allPlatforms = wsTools.getAllPlatforms();\r
-      Set<File> allPlatformFiles = new LinkedHashSet<File>();\r
-      \r
-      Iterator<PlatformIdentification> allPlfIter = allPlatforms.iterator();\r
-      while (iter.hasNext()) {\r
-        allPlatformFiles.add(allPlfIter.next().getFpdFile());\r
-      }\r
-      \r
-      Iterator<PackageIdentification> packageIter = this.updatPkgList.iterator();\r
-      while (packageIter.hasNext()) {\r
-        PackageIdentification item = packageIter.next();\r
-        Set<File> deleteFiles = new LinkedHashSet<File>();\r
-        recursiveDir(deleteFiles, item.getSpdFile().getParentFile(), allPlatformFiles);\r
-        Iterator<File> iterDeleteFile = deleteFiles.iterator();\r
-        while (iterDeleteFile.hasNext()){\r
-          deleteFiles(iterDeleteFile.next());\r
+    /**\r
+     * This method initializes jContentPane\r
+     * \r
+     * @return javax.swing.JPanel\r
+     */\r
+    private JPanel getJContentPane() {\r
+        if (jContentPane == null) {\r
+            jLabel = new JLabel();\r
+            jLabel.setBounds(new java.awt.Rectangle(30, 70, 281, 20));\r
+            jLabel.setText("Following packages will be updated: ");\r
+            jContentPane = new JPanel();\r
+            jContentPane.setLayout(null);\r
+            jContentPane.add(getJTextArea(), null);\r
+            jContentPane.add(getJButtonCancel(), null);\r
+            jContentPane.add(getJButtonFinish(), null);\r
+            jContentPane.add(getJButtonPrevious(), null);\r
+            jContentPane.add(getJScrollPane(), null);\r
+            jContentPane.add(jLabel, null);\r
         }\r
-        //\r
-        // Remove all empty parent dir\r
-        //\r
-        File parentDir = item.getSpdFile().getParentFile();\r
-        while (parentDir.listFiles().length == 0) {\r
-          File tempFile = parentDir;\r
-          parentDir = parentDir.getParentFile();\r
-          tempFile.delete();\r
+        return jContentPane;\r
+    }\r
+\r
+    public void mouseClicked(MouseEvent e) {\r
+        if (e.getSource() == jButtonCancel) {\r
+            this.setVisible(false);\r
+        } else if (e.getSource() == jButtonFinish) {\r
+            //\r
+            // Check depedency ?\r
+            //\r
+            WorkspaceTools wsTools = new WorkspaceTools();\r
+\r
+            Iterator<PackageIdentification> iter = updatPkgList.iterator();\r
+            List<PackageIdentification> depResultList = new ArrayList<PackageIdentification>();\r
+            while (iter.hasNext()) {\r
+                List<PackageIdentification> depPkgList = stepOne.getFar().getPackageDependencies(iter.next());\r
+                depResultList = AggregationOperation.union(depResultList, depPkgList);\r
+            }\r
+\r
+            List<PackageIdentification> dbPkgList = DistributeRule.vectorToList(wsTools.getAllPackages());\r
+            List<PackageIdentification> resultList = AggregationOperation\r
+                                                                         .minus(\r
+                                                                                depResultList,\r
+                                                                                AggregationOperation\r
+                                                                                                    .union(\r
+                                                                                                           this.updatPkgList,\r
+                                                                                                           dbPkgList));\r
+            Iterator resultIter = resultList.iterator();\r
+            while (resultIter.hasNext()) {\r
+                Log.err("Missing dependency package " + ((PackageIdentification) resultIter.next()).toString()\r
+                        + "in workspace!");\r
+                return;\r
+            }\r
+\r
+            //\r
+            // Remove all update packages\r
+            //\r
+            //\r
+            // For all packages, remove all files. \r
+            // Exception FPD file still in DB\r
+            //\r
+            Vector<PlatformIdentification> allPlatforms = wsTools.getAllPlatforms();\r
+            Set<File> allPlatformFiles = new LinkedHashSet<File>();\r
+\r
+            Iterator<PlatformIdentification> allPlfIter = allPlatforms.iterator();\r
+            while (iter.hasNext()) {\r
+                allPlatformFiles.add(allPlfIter.next().getFpdFile());\r
+            }\r
+\r
+            Iterator<PackageIdentification> packageIter = this.updatPkgList.iterator();\r
+            while (packageIter.hasNext()) {\r
+                PackageIdentification item = packageIter.next();\r
+                Set<File> deleteFiles = new LinkedHashSet<File>();\r
+                recursiveDir(deleteFiles, item.getSpdFile().getParentFile(), allPlatformFiles);\r
+                Iterator<File> iterDeleteFile = deleteFiles.iterator();\r
+                while (iterDeleteFile.hasNext()) {\r
+                    deleteFiles(iterDeleteFile.next());\r
+                }\r
+                //\r
+                // Remove all empty parent dir\r
+                //\r
+                File parentDir = item.getSpdFile().getParentFile();\r
+                while (parentDir.listFiles().length == 0) {\r
+                    File tempFile = parentDir;\r
+                    parentDir = parentDir.getParentFile();\r
+                    tempFile.delete();\r
+                }\r
+            }\r
+\r
+            //\r
+            // Install all update packages\r
+            //\r
+            Iterator<PackageIdentification> updataIter = this.updatPkgList.iterator();\r
+            while (updataIter.hasNext()) {\r
+                PackageIdentification pkgId = updataIter.next();\r
+                try {\r
+                    stepOne.getFar().installPackage(pkgId, new File(pkgId.getSpdFile().getParent()));\r
+                } catch (Exception ex) {\r
+                    Log.err("Can install " + pkgId.toString() + " pakcage, please check it!");\r
+                }\r
+\r
+            }\r
+            this.stepOne.returnType = DataType.RETURN_TYPE_OK;\r
+\r
+            this.setVisible(false);\r
+            this.dispose();\r
+        } else if (e.getSource() == jButtonPrevious) {\r
+            this.setVisible(false);\r
+            stepOne.setVisible(true);\r
         }\r
-      }\r
-      \r
-      //\r
-      // Install all update packages\r
-      //\r
-      Iterator<PackageIdentification> updataIter = this.updatPkgList.iterator();\r
-      while (updataIter.hasNext()){\r
-          PackageIdentification pkgId = updataIter.next();\r
-          try{\r
-              stepOne.getFar().installPackage(pkgId, pkgId.getSpdFile());\r
-          }catch (Exception ex){\r
-              Log.err("Can install " + pkgId.toString() + " pakcage, please check it!");\r
-          }\r
-          \r
-      }\r
-      \r
-      \r
-      this.setVisible(false);\r
     }\r
-    else if (e.getSource() == jButtonPrevious) {\r
-      this.setVisible(false);\r
-      stepOne.setVisible(true);\r
+\r
+    public void mousePressed(MouseEvent e) {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    public void mouseReleased(MouseEvent e) {\r
+        // TODO Auto-generated method stub\r
+\r
     }\r
-  }\r
-  public void mousePressed(MouseEvent e) {\r
-    // TODO Auto-generated method stub\r
-    \r
-  }\r
-  public void mouseReleased(MouseEvent e) {\r
-    // TODO Auto-generated method stub\r
-    \r
-  }\r
-  public void mouseEntered(MouseEvent e) {\r
-    // TODO Auto-generated method stub\r
-    \r
-  }\r
-  public void mouseExited(MouseEvent e) {\r
-    // TODO Auto-generated method stub\r
-    \r
-  }\r
-\r
-  private void recursiveDir(Set<File> files, File dir, Set<File> platformFiles) {\r
-      File[] fileList = dir.listFiles();\r
-      for (int i = 0; i < fileList.length; i ++) {\r
-        if (fileList[i].isFile()) {\r
-          if( ! platformFiles.contains(fileList[i])) {\r
-            files.add(fileList[i]);\r
-          }\r
-        }\r
-        else {\r
-          if (isContain(fileList[i], platformFiles)) {\r
-            recursiveDir(files, fileList[i], platformFiles);\r
-          }\r
-          else {\r
-            files.add(fileList[i]);\r
-          }\r
+\r
+    public void mouseEntered(MouseEvent e) {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    public void mouseExited(MouseEvent e) {\r
+        // TODO Auto-generated method stub\r
+\r
+    }\r
+\r
+    private void recursiveDir(Set<File> files, File dir, Set<File> platformFiles) {\r
+        File[] fileList = dir.listFiles();\r
+        for (int i = 0; i < fileList.length; i++) {\r
+            if (fileList[i].isFile()) {\r
+                if (!platformFiles.contains(fileList[i])) {\r
+                    files.add(fileList[i]);\r
+                }\r
+            } else {\r
+                if (isContain(fileList[i], platformFiles)) {\r
+                    recursiveDir(files, fileList[i], platformFiles);\r
+                } else {\r
+                    files.add(fileList[i]);\r
+                }\r
+            }\r
         }\r
-      }\r
     }\r
-    \r
+\r
     private void deleteFiles(File file) {\r
-      if (file.isDirectory()) {\r
-        File[] files = file.listFiles();\r
-        for (int i = 0; i < files.length; i ++) {\r
-          deleteFiles(files[i]);\r
+        if (file.isDirectory()) {\r
+            File[] files = file.listFiles();\r
+            for (int i = 0; i < files.length; i++) {\r
+                deleteFiles(files[i]);\r
+            }\r
         }\r
-      }\r
-      file.delete();\r
+        file.delete();\r
     }\r
-    \r
+\r
     private boolean isContain(File dir, Set<File> platformFiles) {\r
-      Iterator<File> iter = platformFiles.iterator();\r
-      while (iter.hasNext()) {\r
-        File file = iter.next();\r
-        if (file.getPath().startsWith(dir.getPath())) {\r
-          //\r
-          // continue this FPD file\r
-          //\r
-          return true;\r
+        Iterator<File> iter = platformFiles.iterator();\r
+        while (iter.hasNext()) {\r
+            File file = iter.next();\r
+            if (file.getPath().startsWith(dir.getPath())) {\r
+                //\r
+                // continue this FPD file\r
+                //\r
+                return true;\r
+            }\r
         }\r
-      }\r
-      return false;\r
+        return false;\r
     }\r
-  }\r
-\r
+}\r
 \r
 class PartialTableModel extends DefaultTableModel {\r
-  /**\r
-   * \r
-   */\r
-  private static final long serialVersionUID = 1L;\r
-\r
-  public boolean isCellEditable(int row, int col) {\r
-      switch (col){\r
-      case 3:\r
-          return false;\r
-      default:\r
-          return false; \r
-      }\r
-  }\r
+    /**\r
+     \r
+     */\r
+    private static final long serialVersionUID = 1L;\r
+\r
+    public boolean isCellEditable(int row, int col) {\r
+        switch (col) {\r
+        case 3:\r
+            return false;\r
+        default:\r
+            return false;\r
+        }\r
+    }\r
 }\r