]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
Changed spelling to manifest
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / common / Identifications / OpeningPlatformList.java
index 3389d7081a35823658cbcdb62b7cbf051d4ac917..40275e9eb3bfbbb1ffecce74405130296e525f55 100644 (file)
  **/\r
 package org.tianocore.frameworkwizard.common.Identifications;\r
 \r
+import java.util.Set;\r
 import java.util.Vector;\r
 \r
 import javax.swing.tree.TreePath;\r
 \r
 import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
 \r
 public class OpeningPlatformList {\r
     \r
@@ -36,7 +38,7 @@ public class OpeningPlatformList {
         vOpeningPlatformList = openingPlatformList;\r
     }\r
     \r
-    public void insertToOpeningPlatformList(Identification id, PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {\r
+    public void insertToOpeningPlatformList(PlatformIdentification id, PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {\r
         vOpeningPlatformList.addElement(new OpeningPlatformType(id, xmlFpd));\r
     }\r
     \r
@@ -47,7 +49,7 @@ public class OpeningPlatformList {
         return null;\r
     }\r
     \r
-    public OpeningPlatformType getOpeningPlatformById(Identification id) {\r
+    public OpeningPlatformType getOpeningPlatformById(PlatformIdentification id) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             return vOpeningPlatformList.elementAt(index);\r
@@ -55,7 +57,7 @@ public class OpeningPlatformList {
         return null;\r
     }\r
     \r
-    public int findIndexOfListById(Identification id) {\r
+    public int findIndexOfListById(PlatformIdentification id) {\r
         for (int index = 0; index < vOpeningPlatformList.size(); index++) {\r
             if (vOpeningPlatformList.elementAt(index).getId().equals(id)) {\r
                 return index;\r
@@ -70,7 +72,7 @@ public class OpeningPlatformList {
         }\r
     }\r
     \r
-    public void removeFromOpeningPlatformListById(Identification id) {\r
+    public void removeFromOpeningPlatformListById(PlatformIdentification id) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             vOpeningPlatformList.removeElementAt(findIndexOfListById(id));\r
@@ -81,7 +83,7 @@ public class OpeningPlatformList {
         vOpeningPlatformList.removeAllElements();\r
     }\r
     \r
-    public PlatformSurfaceAreaDocument.PlatformSurfaceArea getPlatformSurfaceAreaFromId(Identification id) {\r
+    public PlatformSurfaceAreaDocument.PlatformSurfaceArea getPlatformSurfaceAreaFromId(PlatformIdentification id) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             return vOpeningPlatformList.elementAt(index).getXmlFpd();\r
@@ -89,7 +91,7 @@ public class OpeningPlatformList {
         return null;\r
     }\r
     \r
-    public boolean existsPlatform(Identification id) {\r
+    public boolean existsPlatform(PlatformIdentification id) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             return true;\r
@@ -98,7 +100,7 @@ public class OpeningPlatformList {
     }\r
     \r
     \r
-    public void setPlatformSaved(Identification id, boolean isSaved) {\r
+    public void setPlatformSaved(PlatformIdentification id, boolean isSaved) {\r
         setPlatformSaved(findIndexOfListById(id), isSaved);\r
     }\r
     \r
@@ -108,7 +110,7 @@ public class OpeningPlatformList {
         }\r
     }\r
     \r
-    public boolean getPlatformSaved(Identification id) {\r
+    public boolean getPlatformSaved(PlatformIdentification id) {\r
         return getPlatformSaved(findIndexOfListById(id));\r
     }\r
     \r
@@ -119,14 +121,35 @@ public class OpeningPlatformList {
         return true;\r
     }\r
     \r
-    public void setTreePathById(Identification id, TreePath treePath) {\r
+    public void setPlatformOpen(PlatformIdentification id, boolean isOpen) {\r
+        setPlatformOpen(findIndexOfListById(id), isOpen);\r
+    }\r
+    \r
+    public void setPlatformOpen(int index, boolean isOpen) {\r
+        if (index > -1) {\r
+            vOpeningPlatformList.elementAt(index).setOpen(isOpen);\r
+        }\r
+    }\r
+    \r
+    public boolean getPlatformOpen(PlatformIdentification id) {\r
+        return getPlatformOpen(findIndexOfListById(id));\r
+    }\r
+    \r
+    public boolean getPlatformOpen(int index) {\r
+        if (index > -1) {\r
+            return vOpeningPlatformList.elementAt(index).isOpen();\r
+        }\r
+        return true;\r
+    }\r
+    \r
+    public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             vOpeningPlatformList.elementAt(index).setTreePath(treePath);\r
         }\r
     }\r
     \r
-    public TreePath getTreePathById(Identification id) {\r
+    public Set<TreePath> getTreePathById(PlatformIdentification id) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             return vOpeningPlatformList.elementAt(index).getTreePath();\r
@@ -134,20 +157,35 @@ public class OpeningPlatformList {
         return null;\r
     }\r
     \r
-    public TreePath getTreePathByIndex(int index) {\r
+    public Set<TreePath> getTreePathByIndex(int index) {\r
         if (index > -1) {\r
             return vOpeningPlatformList.elementAt(index).getTreePath();\r
         }\r
         return null;\r
     }\r
     \r
-    public void setNew(Identification id, boolean isNew) {\r
+    public PlatformIdentification getIdByPath(String path) {\r
+        PlatformIdentification id = new PlatformIdentification(null, null, null, path);\r
+        int index = findIndexOfListById(id);\r
+        if (index > -1) {\r
+            return vOpeningPlatformList.elementAt(index).getId();\r
+        }\r
+        return null;\r
+    }\r
+    \r
+    public void setNew(PlatformIdentification id, boolean isNew) {\r
         int index = findIndexOfListById(id);\r
         if (index > -1) {\r
             vOpeningPlatformList.elementAt(index).setNew(isNew);\r
         }\r
     }\r
     \r
+    public void closeAll() {\r
+        for (int index = 0; index < this.size(); index++) {\r
+           this.setPlatformOpen(index, false);\r
+        }\r
+    }\r
+    \r
     public int size() {\r
         return vOpeningPlatformList.size();\r
     }\r
@@ -161,9 +199,11 @@ public class OpeningPlatformList {
         return true;\r
     }\r
     \r
-    public boolean isOpend() {\r
-        if (this.size() > 0 ) {\r
-            return true;\r
+    public boolean isOpen() {\r
+        for (int index = 0; index < this.size(); index++) {\r
+            if (this.getPlatformOpen(index)) {\r
+                return true;\r
+            }\r
         }\r
         return false;\r
     }\r