1. To let MSA/SPD/FPD Header have their own sections, not are the top level of the...
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 15 Aug 2006 04:05:20 +0000 (04:05 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 15 Aug 2006 04:05:20 +0000 (04:05 +0000)
2. Change "Package Headers" of the tree to "Package Includes"

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

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java

index e916dbcd7f15ba0393b9c570b9ea89a88fe82042..68a6bc5660550d56fbb749d2bfce0507408b60bf 100644 (file)
@@ -1851,11 +1851,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
                 for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {\r
                     if (vModule.get(indexJ).isLibrary()) {\r
                         dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),\r
-                                                                                 IDefaultMutableTreeNode.MSA_HEADER,\r
+                                                                                 IDefaultMutableTreeNode.MODULE,\r
                                                                                  false, vModule.get(indexJ)));\r
                     } else {\r
                         dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),\r
-                                                                                IDefaultMutableTreeNode.MSA_HEADER,\r
+                                                                                IDefaultMutableTreeNode.MODULE,\r
                                                                                 false, vModule.get(indexJ)));\r
                     }\r
                 }\r
@@ -1877,7 +1877,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         if (this.vPackageList.size() > 0) {\r
             for (int index = 0; index < this.vPackageList.size(); index++) {\r
                 dmtnPackageDescription.add(new IDefaultMutableTreeNode(this.vPackageList.elementAt(index).getName(),\r
-                                                                       IDefaultMutableTreeNode.SPD_HEADER, false,\r
+                                                                       IDefaultMutableTreeNode.PACKAGE, false,\r
                                                                        this.vPackageList.elementAt(index)));\r
             }\r
         }\r
@@ -1890,7 +1890,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         if (this.vPlatformList.size() > 0) {\r
             for (int index = 0; index < this.vPlatformList.size(); index++) {\r
                 dmtnPlatformDescription.add(new IDefaultMutableTreeNode(this.vPlatformList.elementAt(index).getName(),\r
-                                                                        IDefaultMutableTreeNode.FPD_PLATFORMHEADER,\r
+                                                                        IDefaultMutableTreeNode.PLATFORM,\r
                                                                         false, this.vPlatformList.elementAt(index)));\r
             }\r
         }\r
@@ -2142,7 +2142,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         // Make the node selected\r
         //\r
         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
-                                                                     IDefaultMutableTreeNode.MSA_HEADER)));\r
+                                                                     IDefaultMutableTreeNode.MODULE)));\r
         //\r
         // Update opening Module list information\r
         //\r
@@ -2160,8 +2160,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             openingModuleList.setTreePathById(id, iTree.getSelectionPath());\r
         }\r
         //\r
-        // Show msa header in editor panel\r
+        // Select msa header node and show it in editor panel\r
         //\r
+        iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
+                                                                     IDefaultMutableTreeNode.MSA_HEADER)));\r
         showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id));\r
         this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);\r
     }\r
@@ -2224,7 +2226,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         // Make the node selected\r
         //\r
         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
-                                                                     IDefaultMutableTreeNode.MSA_HEADER)));\r
+                                                                     IDefaultMutableTreeNode.MODULE)));\r
         //\r
         // Update opening Module list information\r
         //\r
@@ -2242,8 +2244,10 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             openingModuleList.setTreePathById(id, iTree.getSelectionPath());\r
         }\r
         //\r
-        // Show msa header in editor panel\r
+        // Select msa header node and show it in editor panel\r
         //\r
+        iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnModuleDescription, id,\r
+                                                                     IDefaultMutableTreeNode.MSA_HEADER)));\r
         showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, openingModuleList.getOpeningModuleById(id));\r
         this.currentOpeningModuleIndex = openingModuleList.findIndexOfListById(id);\r
     }\r
@@ -2296,7 +2300,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         // Make the node selected\r
         //\r
         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,\r
-                                                                     IDefaultMutableTreeNode.SPD_HEADER)));\r
+                                                                     IDefaultMutableTreeNode.PACKAGE)));\r
         //\r
         // Update opening package list information\r
         //\r
@@ -2316,6 +2320,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         //\r
         // Show spd header in editor panel\r
         //\r
+        iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,\r
+                                                                     IDefaultMutableTreeNode.SPD_HEADER)));\r
         showPackageElement(IDefaultMutableTreeNode.SPD_HEADER, openingPackageList.getOpeningPackageById(id));\r
         this.currentOpeningPackageIndex = openingPackageList.findIndexOfListById(id);\r
     }\r
@@ -2369,7 +2375,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         // Make the node selected\r
         //\r
         iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,\r
-                                                                     IDefaultMutableTreeNode.FPD_PLATFORMHEADER)));\r
+                                                                     IDefaultMutableTreeNode.PLATFORM)));\r
         //\r
         // Update opening package list information\r
         //\r
@@ -2389,6 +2395,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         //\r
         // Show fpd header in editor panel\r
         //\r
+        iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,\r
+                                                                     IDefaultMutableTreeNode.FPD_PLATFORMHEADER)));\r
         showPlatformElement(IDefaultMutableTreeNode.FPD_PLATFORMHEADER, openingPlatformList.getOpeningPlatformById(id));\r
         this.currentOpeningPlatformIndex = openingPlatformList.findIndexOfListById(id);\r
     }\r
@@ -2506,6 +2514,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     }\r
 \r
     private void insertModuleTreeNode(Identification id) {\r
+        iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Module Definitions", IDefaultMutableTreeNode.MSA_MODULEDEFINITIONS,\r
                                                   true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions",\r
@@ -2528,12 +2537,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     }\r
 \r
     private void insertPackageTreeNode(Identification id) {\r
+        iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Package Definitions",\r
                                                   IDefaultMutableTreeNode.SPD_PACKAGEDEFINITIONS, true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations",\r
                                                   IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id));\r
-        iTree.addNode(new IDefaultMutableTreeNode("Package Headers", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,\r
+        iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,\r
                                                   id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS,\r
                                                   true, id));\r
@@ -2546,6 +2556,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     }\r
 \r
     private void insertPlatformTreeNode(Identification id) {\r
+        iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true,\r
+                                                  id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",\r
                                                   IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id));\r
         iTree.addNode(new IDefaultMutableTreeNode("Flash", IDefaultMutableTreeNode.FPD_FLASH, true, id));\r
@@ -2564,35 +2576,40 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
         Identification id = null;\r
         int intCategory = -1;\r
         String path = null;\r
+        boolean isOpen = false;\r
         try {\r
             id = iTree.getSelectNode().getId();\r
             intCategory = iTree.getSelectCategory();\r
-            //          \r
-            // If the node is not opened yet\r
-            // Insert top level elements first\r
-            //\r
-            //if (intCategory == IDefaultMutableTreeNode.MSA_HEADER || intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {\r
-            if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) {\r
+            isOpen = iTree.getSelectNode().isOpening();\r
+            \r
+            if (!isOpen) {\r
+                //              \r
+                // If the node is not opened yet\r
+                // Insert top level elements first\r
+                //\r
+                if (intCategory == IDefaultMutableTreeNode.MODULE) {\r
 \r
-                if (intCategory == IDefaultMutableTreeNode.MSA_HEADER) {\r
+                    if (intCategory == IDefaultMutableTreeNode.MODULE) {\r
+                        path = iTree.getSelectNode().getId().getPath();\r
+                    }\r
+                    if (intCategory == IDefaultMutableTreeNode.PACKAGE) {\r
+                        path = iTree.getSelectNode().getId().getPath();\r
+                    }\r
+                    openModule(path);\r
+                    return;\r
+                }\r
+                if (intCategory == IDefaultMutableTreeNode.PACKAGE) {\r
                     path = iTree.getSelectNode().getId().getPath();\r
+                    openPackage(path);\r
+                    return;\r
                 }\r
-                if (intCategory == IDefaultMutableTreeNode.SPD_MSAFILES) {\r
+                if (intCategory == IDefaultMutableTreeNode.PLATFORM) {\r
                     path = iTree.getSelectNode().getId().getPath();\r
+                    openPlatform(path);\r
+                    return;\r
                 }\r
-                openModule(path);\r
-                return;\r
-            }\r
-            if (intCategory == IDefaultMutableTreeNode.SPD_HEADER) {\r
-                path = iTree.getSelectNode().getId().getPath();\r
-                openPackage(path);\r
-                return;\r
-            }\r
-            if (intCategory == IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {\r
-                path = iTree.getSelectNode().getId().getPath();\r
-                openPlatform(path);\r
-                return;\r
             }\r
+            \r
             //\r
             // Show editor panel\r
             //\r
@@ -2611,9 +2628,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
             }\r
         } catch (RuntimeException e) {\r
             Log.log("double click category: " + intCategory);\r
-            Log.log("double click id path: " + id.getPath());\r
+            Log.log("double click id path: " + id);\r
             Log.log("double click exception: " + e.getMessage());\r
-            e.printStackTrace();\r
         }\r
     }\r
 \r