X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fcommon%2FIdentifications%2FOpeningModuleList.java;fp=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fcommon%2FIdentifications%2FOpeningModuleList.java;h=0000000000000000000000000000000000000000;hp=c98d6f95b51d473cbe5078534a91465d31684c66;hb=808def96aa4589fba9c2d0ea55837754a3b7a4f7;hpb=9216450d1143056a50a5f916984a2d7faf590488 diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java deleted file mode 100644 index c98d6f95b5..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java +++ /dev/null @@ -1,231 +0,0 @@ -/** @file - - The file is used to define opening module list - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - **/ -package org.tianocore.frameworkwizard.common.Identifications; - -import java.util.Set; -import java.util.Vector; - -import javax.swing.tree.TreePath; - -import org.tianocore.ModuleSurfaceAreaDocument; -import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; - -public class OpeningModuleList { - private Vector vOpeningModuleList = new Vector(); - - public OpeningModuleList() { - - } - - public Vector getVOpeningModuleList() { - return vOpeningModuleList; - } - - public void setVOpeningModuleList(Vector openingModuleList) { - vOpeningModuleList = openingModuleList; - } - - public void insertToOpeningModuleList(ModuleIdentification id, ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa) { - vOpeningModuleList.addElement(new OpeningModuleType(id, xmlMsa)); - } - - public OpeningModuleType getOpeningModuleByIndex(int index) { - if (index > -1 && index < vOpeningModuleList.size()) { - return vOpeningModuleList.elementAt(index); - } - return null; - } - - public OpeningModuleType getOpeningModuleById(ModuleIdentification id) { - int index = findIndexOfListById(id); - if (index > -1) { - return vOpeningModuleList.elementAt(index); - } - return null; - } - - public int findIndexOfListById(ModuleIdentification id) { - for (int index = 0; index < vOpeningModuleList.size(); index++) { - if (vOpeningModuleList.elementAt(index).getId().equals(id)) { - return index; - } - } - return -1; - } - - public void removeFromOpeningModuleListByIndex(int index) { - if (index > -1 && index < vOpeningModuleList.size()) { - vOpeningModuleList.removeElementAt(index); - } - } - - public void removeFromOpeningModuleListById(ModuleIdentification id) { - int index = findIndexOfListById(id); - if (index > -1) { - vOpeningModuleList.removeElementAt(findIndexOfListById(id)); - } - } - - public void removeAllFromOpeningModuleList() { - vOpeningModuleList.removeAllElements(); - } - - public ModuleSurfaceAreaDocument.ModuleSurfaceArea getModuleSurfaceAreaFromId(ModuleIdentification id) { - int index = findIndexOfListById(id); - if (index > -1) { - return vOpeningModuleList.elementAt(index).getXmlMsa(); - } - return null; - } - - public boolean existsModule(ModuleIdentification id) { - int index = findIndexOfListById(id); - if (index > -1) { - return true; - } - return false; - } - - public void setModuleSaved(ModuleIdentification id, boolean isSaved) { - setModuleSaved(findIndexOfListById(id), isSaved); - } - - public void setModuleSaved(int index, boolean isSaved) { - if (index > -1) { - vOpeningModuleList.elementAt(index).setSaved(isSaved); - } - } - - public boolean getModuleSaved(ModuleIdentification id) { - return getModuleSaved(findIndexOfListById(id)); - } - - public boolean getModuleSaved(int index) { - if (index > -1) { - return vOpeningModuleList.elementAt(index).isSaved(); - } - return true; - } - - public void setModuleOpen(ModuleIdentification id, boolean isOpen) { - setModuleOpen(findIndexOfListById(id), isOpen); - } - - public void setModuleOpen(int index, boolean isOpen) { - if (index > -1) { - vOpeningModuleList.elementAt(index).setOpen(isOpen); - } - } - - public boolean getModuleOpen(ModuleIdentification id) { - return getModuleOpen(findIndexOfListById(id)); - } - - public boolean getModuleOpen(int index) { - if (index > -1) { - return vOpeningModuleList.elementAt(index).isOpen(); - } - return false; - } - - public void setTreePathById(ModuleIdentification id, Set treePath) { - int index = findIndexOfListById(id); - if (index > -1) { - vOpeningModuleList.elementAt(index).setTreePath(treePath); - } - } - - public Set getTreePathById(ModuleIdentification id) { - int index = findIndexOfListById(id); - if (index > -1) { - return vOpeningModuleList.elementAt(index).getTreePath(); - } - return null; - } - - public Set getTreePathByIndex(int index) { - if (index > -1) { - return vOpeningModuleList.elementAt(index).getTreePath(); - } - return null; - } - - public ModuleIdentification getIdByPath(String path) { - ModuleIdentification id = new ModuleIdentification(null, null, null, path); - int index = findIndexOfListById(id); - if (index > -1) { - return vOpeningModuleList.elementAt(index).getId(); - } - return null; - } - - public ModuleIdentification getIdByGuidVersion(String guid, String version) { - for (int index = 0; index < vOpeningModuleList.size(); index++) { - ModuleIdentification id = vOpeningModuleList.elementAt(index).getId(); - if (version != null) { - if (id.getGuid().equals(guid) && id.getVersion().equals(version)) { - return id; - } - } else { - if (id.getGuid().equals(guid)) { - return id; - } - } - } - return null; - } - - public void setNew(ModuleIdentification id, boolean isNew) { - int index = findIndexOfListById(id); - if (index > -1) { - vOpeningModuleList.elementAt(index).setNew(isNew); - } - } - - public void closeAll() { - for (int index = 0; index < this.size(); index++) { - this.setModuleOpen(index, false); - this.setModuleSaved(index, true); - } - } - - public int size() { - return vOpeningModuleList.size(); - } - - public boolean isSaved() { - for (int index = 0; index < this.size(); index++) { - if (!this.getModuleSaved(index)) { - return false; - } - } - return true; - } - - public boolean isOpen() { - for (int index = 0; index < this.size(); index++) { - if (this.getModuleOpen(index)) { - return true; - } - } - return false; - } - - public void reload(int index) { - if (index > -1) { - vOpeningModuleList.elementAt(index).reload(); - } - } -}