**/\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
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
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
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
}\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
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
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
}\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
}\r
}\r
\r
- public boolean getPlatformSaved(Identification id) {\r
+ public boolean getPlatformSaved(PlatformIdentification id) {\r
return getPlatformSaved(findIndexOfListById(id));\r
}\r
\r
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
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
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