diff options
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications')
10 files changed, 0 insertions, 1296 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java deleted file mode 100644 index 03717b560b..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java +++ /dev/null @@ -1,113 +0,0 @@ -/** @file
-
- The file is used to save basic information
-
- 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;
-
-public class Identification {
-
- ///
- /// Define class members
- ///
- private String name;
-
- private String guid;
-
- private String version;
-
- private String path;
-
- public Identification(String name, String guid, String version) {
- this.name = name;
- this.guid = guid;
- this.version = version;
- }
-
- public Identification() {
-
- }
-
- public Identification(String name, String guid, String version, String path) {
- this.name = name;
- this.guid = guid;
- this.version = version;
- this.path = path;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof Identification) {
- Identification id = (Identification) obj;
- if (path.equals(id.path)) {
- return true;
- }
- return false;
- } else {
- return super.equals(obj);
- }
- }
-
- public boolean equalsWithGuid(Object obj) {
- if (obj instanceof Identification) {
- Identification id = (Identification) obj;
- if (guid.equalsIgnoreCase(id.guid)) {
- if (version == null || id.version == null) {
- return true;
- } else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")) {
- return true;
- } else if (version.equalsIgnoreCase(id.version)) {
- return true;
- }
- }
- return false;
- } else {
- return super.equals(obj);
- }
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public String getName() {
- return name;
- }
-
- public String getVersion() {
- return version;
- }
-
- public String getPath() {
- return path;
- }
-
- public int hashCode() {
- return guid.toLowerCase().hashCode();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java deleted file mode 100644 index 9811c19868..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java +++ /dev/null @@ -1,71 +0,0 @@ -/** @file
-
- The file is used to define common opening file type
-
- 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.LinkedHashSet;
-import java.util.Set;
-
-import javax.swing.tree.TreePath;
-
-
-public class OpeningFileType {
- //
- // Define class members
- //
- private boolean isSaved = true;
-
- private boolean isNew = false;
-
- private boolean isOpen = false;
-
- private Set<TreePath> treePath = new LinkedHashSet<TreePath>();
-
- public OpeningFileType() {
-
- }
-
- public boolean isNew() {
- return isNew;
- }
-
- public void setNew(boolean isNew) {
- this.isNew = isNew;
- }
-
- public boolean isSaved() {
- return isSaved;
- }
-
- public void setSaved(boolean isSaved) {
- this.isSaved = isSaved;
- }
-
- public boolean isOpen() {
- return isOpen;
- }
-
- public void setOpen(boolean isOpen) {
- this.isOpen = isOpen;
- }
-
- public Set<TreePath> getTreePath() {
- return treePath;
- }
-
- public void setTreePath(Set<TreePath> treePath) {
- this.treePath = treePath;
- }
-}
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<OpeningModuleType> vOpeningModuleList = new Vector<OpeningModuleType>();
-
- public OpeningModuleList() {
-
- }
-
- public Vector<OpeningModuleType> getVOpeningModuleList() {
- return vOpeningModuleList;
- }
-
- public void setVOpeningModuleList(Vector<OpeningModuleType> 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> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningModuleList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> 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();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java deleted file mode 100644 index 3ff29a94d3..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java +++ /dev/null @@ -1,75 +0,0 @@ -/** @file
-
- The file is used to define opening module type
-
- 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.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-
-public class OpeningModuleType extends OpeningFileType{
- //
- // Define class members
- //
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa = null;
-
- private ModuleIdentification id = null;
-
- public OpeningModuleType() {
-
- }
-
- public OpeningModuleType(ModuleIdentification identification, ModuleSurfaceAreaDocument.ModuleSurfaceArea msa) {
- this.id = identification;
- this.xmlMsa = msa;
- }
-
- public ModuleSurfaceAreaDocument.ModuleSurfaceArea getXmlMsa() {
- return xmlMsa;
- }
-
- public void setXmlMsa(ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa) {
- this.xmlMsa = xmlMsa;
- }
-
- public ModuleIdentification getId() {
- return id;
- }
-
- public void setId(ModuleIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlMsa = OpenFile.openMsaFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Module Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java deleted file mode 100644 index 0db75176ba..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java +++ /dev/null @@ -1,231 +0,0 @@ -/** @file
-
- The file is used to define opening package 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.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class OpeningPackageList {
- private Vector<OpeningPackageType> vOpeningPackageList = new Vector<OpeningPackageType>();
-
- public OpeningPackageList() {
-
- }
-
- public Vector<OpeningPackageType> getVOpeningPackageList() {
- return vOpeningPackageList;
- }
-
- public void setVOpeningPackageList(Vector<OpeningPackageType> openingPackageList) {
- vOpeningPackageList = openingPackageList;
- }
-
- public void insertToOpeningPackageList(PackageIdentification id, PackageSurfaceAreaDocument.PackageSurfaceArea xmlMsa) {
- vOpeningPackageList.addElement(new OpeningPackageType(id, xmlMsa));
- }
-
- public OpeningPackageType getOpeningPackageByIndex(int index) {
- if (index > -1 && index < vOpeningPackageList.size()) {
- return vOpeningPackageList.elementAt(index);
- }
- return null;
- }
-
- public OpeningPackageType getOpeningPackageById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index);
- }
- return null;
- }
-
- public int findIndexOfListById(PackageIdentification id) {
- for (int index = 0; index < vOpeningPackageList.size(); index++) {
- if (vOpeningPackageList.elementAt(index).getId().equals(id)) {
- return index;
- }
- }
- return -1;
- }
-
- public void removeFromOpeningPackageListByIndex(int index) {
- if (index > -1 && index < vOpeningPackageList.size()) {
- vOpeningPackageList.removeElementAt(index);
- }
- }
-
- public void removeFromOpeningPackageListById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.removeElementAt(findIndexOfListById(id));
- }
- }
-
- public void removeAllFromOpeningPackageList() {
- vOpeningPackageList.removeAllElements();
- }
-
- public PackageSurfaceAreaDocument.PackageSurfaceArea getPackageSurfaceAreaFromId(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getXmlSpd();
- }
- return null;
- }
-
- public boolean existsPackage(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return true;
- }
- return false;
- }
-
- public void setPackageSaved(PackageIdentification id, boolean isSaved) {
- setPackageSaved(findIndexOfListById(id), isSaved);
- }
-
- public void setPackageSaved(int index, boolean isSaved) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setSaved(isSaved);
- }
- }
-
- public boolean getPackageSaved(PackageIdentification id) {
- return getPackageSaved(findIndexOfListById(id));
- }
-
- public boolean getPackageSaved(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).isSaved();
- }
- return true;
- }
-
- public void setPackageOpen(PackageIdentification id, boolean isOpem) {
- setPackageOpen(findIndexOfListById(id), isOpem);
- }
-
- public void setPackageOpen(int index, boolean isOpem) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setOpen(isOpem);
- }
- }
-
- public boolean getPackageOpen(PackageIdentification id) {
- return getPackageOpen(findIndexOfListById(id));
- }
-
- public boolean getPackageOpen(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).isOpen();
- }
- return false;
- }
-
- public void setTreePathById(PackageIdentification id, Set<TreePath> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> getTreePathByIndex(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public PackageIdentification getIdByPath(String path) {
- PackageIdentification id = new PackageIdentification(null, null, null, path);
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getId();
- }
- return null;
- }
-
- public PackageIdentification getIdByGuidVersion(String guid, String version) {
- for (int index = 0; index < vOpeningPackageList.size(); index++) {
- PackageIdentification id = vOpeningPackageList.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(PackageIdentification id, boolean isNew) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setNew(isNew);
- }
- }
-
- public void closeAll() {
- for (int index = 0; index < this.size(); index++) {
- this.setPackageOpen(index, false);
- this.setPackageSaved(index, true);
- }
- }
-
- public int size() {
- return vOpeningPackageList.size();
- }
-
- public boolean isSaved() {
- for (int index = 0; index < this.size(); index++) {
- if (!this.getPackageSaved(index)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isOpen() {
- for (int index = 0; index < this.size(); index++) {
- if (this.getPackageOpen(index)) {
- return true;
- }
- }
- return false;
- }
-
- public void reload(int index) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).reload();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java deleted file mode 100644 index 22f3ce311d..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java +++ /dev/null @@ -1,74 +0,0 @@ -/** @file
-
- The file is used to define opening package type
-
- 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.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class OpeningPackageType extends OpeningFileType {
- //
- // Define class members
- //
- private PackageSurfaceAreaDocument.PackageSurfaceArea xmlSpd = null;
-
- private PackageIdentification id = null;
-
- public OpeningPackageType() {
-
- }
-
- public OpeningPackageType(PackageIdentification identification, PackageSurfaceAreaDocument.PackageSurfaceArea spd) {
- this.id = identification;
- this.xmlSpd = spd;
- }
-
- public PackageSurfaceAreaDocument.PackageSurfaceArea getXmlSpd() {
- return xmlSpd;
- }
-
- public void setXmlSpd(PackageSurfaceAreaDocument.PackageSurfaceArea xmlSpd) {
- this.xmlSpd = xmlSpd;
- }
-
- public PackageIdentification getId() {
- return id;
- }
-
- public void setId(PackageIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlSpd = OpenFile.openSpdFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Package Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java deleted file mode 100644 index a2ce431c0b..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java +++ /dev/null @@ -1,217 +0,0 @@ -/** @file
-
- The file is used to define opening package 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.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class OpeningPlatformList {
-
- private Vector<OpeningPlatformType> vOpeningPlatformList = new Vector<OpeningPlatformType>();
-
- public OpeningPlatformList() {
-
- }
-
- public Vector<OpeningPlatformType> getVOpeningPlatformList() {
- return vOpeningPlatformList;
- }
-
- public void setVOpeningPlatformList(Vector<OpeningPlatformType> openingPlatformList) {
- vOpeningPlatformList = openingPlatformList;
- }
-
- public void insertToOpeningPlatformList(PlatformIdentification id, PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {
- vOpeningPlatformList.addElement(new OpeningPlatformType(id, xmlFpd));
- }
-
- public OpeningPlatformType getOpeningPlatformByIndex(int index) {
- if (index > -1 && index < vOpeningPlatformList.size()) {
- return vOpeningPlatformList.elementAt(index);
- }
- return null;
- }
-
- public OpeningPlatformType getOpeningPlatformById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index);
- }
- return null;
- }
-
- public int findIndexOfListById(PlatformIdentification id) {
- for (int index = 0; index < vOpeningPlatformList.size(); index++) {
- if (vOpeningPlatformList.elementAt(index).getId().equals(id)) {
- return index;
- }
- }
- return -1;
- }
-
- public void removeFromOpeningPlatformListByIndex(int index) {
- if (index > -1 && index < vOpeningPlatformList.size()) {
- vOpeningPlatformList.removeElementAt(index);
- }
- }
-
- public void removeFromOpeningPlatformListById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.removeElementAt(findIndexOfListById(id));
- }
- }
-
- public void removeAllFromOpeningPlatformList() {
- vOpeningPlatformList.removeAllElements();
- }
-
- public PlatformSurfaceAreaDocument.PlatformSurfaceArea getPlatformSurfaceAreaFromId(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getXmlFpd();
- }
- return null;
- }
-
- public boolean existsPlatform(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return true;
- }
- return false;
- }
-
-
- public void setPlatformSaved(PlatformIdentification id, boolean isSaved) {
- setPlatformSaved(findIndexOfListById(id), isSaved);
- }
-
- public void setPlatformSaved(int index, boolean isSaved) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setSaved(isSaved);
- }
- }
-
- public boolean getPlatformSaved(PlatformIdentification id) {
- return getPlatformSaved(findIndexOfListById(id));
- }
-
- public boolean getPlatformSaved(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).isSaved();
- }
- return true;
- }
-
- public void setPlatformOpen(PlatformIdentification id, boolean isOpen) {
- setPlatformOpen(findIndexOfListById(id), isOpen);
- }
-
- public void setPlatformOpen(int index, boolean isOpen) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setOpen(isOpen);
- }
- }
-
- public boolean getPlatformOpen(PlatformIdentification id) {
- return getPlatformOpen(findIndexOfListById(id));
- }
-
- public boolean getPlatformOpen(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).isOpen();
- }
- return false;
- }
-
- public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> getTreePathByIndex(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public PlatformIdentification getIdByPath(String path) {
- PlatformIdentification id = new PlatformIdentification(null, null, null, path);
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getId();
- }
- return null;
- }
-
- public void setNew(PlatformIdentification id, boolean isNew) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setNew(isNew);
- }
- }
-
- public void closeAll() {
- for (int index = 0; index < this.size(); index++) {
- this.setPlatformOpen(index, false);
- this.setPlatformSaved(index, true);
- }
- }
-
- public int size() {
- return vOpeningPlatformList.size();
- }
-
- public boolean isSaved() {
- for (int index = 0; index < this.size(); index++) {
- if (!this.getPlatformSaved(index)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isOpen() {
- for (int index = 0; index < this.size(); index++) {
- if (this.getPlatformOpen(index)) {
- return true;
- }
- }
- return false;
- }
-
- public void reload(int index) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).reload();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java deleted file mode 100644 index 7a822c91c8..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java +++ /dev/null @@ -1,74 +0,0 @@ -/** @file
-
- The file is used to define opening platform type
-
- 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.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class OpeningPlatformType extends OpeningFileType {
- //
- // Define class members
- //
- private PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd = null;
-
- private PlatformIdentification id = null;
-
- public OpeningPlatformType() {
-
- }
-
- public OpeningPlatformType(PlatformIdentification identification, PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this.id = identification;
- this.xmlFpd = fpd;
- }
-
- public PlatformSurfaceAreaDocument.PlatformSurfaceArea getXmlFpd() {
- return xmlFpd;
- }
-
- public void setXmlFpd(PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {
- this.xmlFpd = xmlFpd;
- }
-
- public PlatformIdentification getId() {
- return id;
- }
-
- public void setId(PlatformIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlFpd = OpenFile.openFpdFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Platform Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java deleted file mode 100644 index f446693004..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java +++ /dev/null @@ -1,55 +0,0 @@ -/** @file
-
- The file is used to define Tool Chain Configuration Identification
-
- 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;
-
-public class ToolChainConfigId {
-
- public static final String COMMENTS = "#";
-
- public static final String EQUALS = "=";
-
- private String name = "";
-
- private String value = "";
-
- public ToolChainConfigId(String strName, String strValue) {
- this.name = strName;
- this.value = strValue;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public boolean equals(ToolChainConfigId id) {
- if (this.name.equals(id.name)) {
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java deleted file mode 100644 index 49aac3d074..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java +++ /dev/null @@ -1,155 +0,0 @@ -/** @file
-
- The file is used to define Tool Chain Configuration Vector
-
- 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.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Vector;
-
-public class ToolChainConfigVector {
-
- private Vector<ToolChainConfigId> vToolChainConfigs = new Vector<ToolChainConfigId>();
-
- public int findToolChainConfigs(ToolChainConfigId sfi) {
- for (int index = 0; index < vToolChainConfigs.size(); index++) {
- if (vToolChainConfigs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findToolChainConfigs(String name) {
- for (int index = 0; index < vToolChainConfigs.size(); index++) {
- if (vToolChainConfigs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public ToolChainConfigId getToolChainConfigs(int index) {
- if (index > -1) {
- return vToolChainConfigs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getToolChainConfigs(index).getName());
- v.addElement(getToolChainConfigs(index).getValue());
- return v;
- }
-
- public void addToolChainConfigs(ToolChainConfigId arg0) {
- vToolChainConfigs.addElement(arg0);
- }
-
- public void updateToolChainConfigs(ToolChainConfigId arg0, int arg1) {
- vToolChainConfigs.setElementAt(arg0, arg1);
- }
-
- public void removeToolChainConfigs(ToolChainConfigId arg0) {
- int index = findToolChainConfigs(arg0);
- if (index > -1) {
- vToolChainConfigs.removeElementAt(index);
- }
- }
-
- public void removeToolChainConfigs(int index) {
- if (index > -1 && index < this.size()) {
- vToolChainConfigs.removeElementAt(index);
- }
- }
-
- public void removeAll() {
- vToolChainConfigs = new Vector<ToolChainConfigId>();
- }
-
- public Vector<String> getToolChainConfigsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vToolChainConfigs.size(); index++) {
- v.addElement(vToolChainConfigs.get(index).getName());
- }
- return v;
- }
-
- public Vector<String> getToolChainConfigsValue() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vToolChainConfigs.size(); index++) {
- v.addElement(vToolChainConfigs.get(index).getValue());
- }
- return v;
- }
-
- public int size() {
- return this.vToolChainConfigs.size();
- }
-
- public void saveFile(String file) throws IOException {
- if (size() > 0) {
- FileWriter fw = new FileWriter(file);
- BufferedWriter bw = new BufferedWriter(fw);
- for (int index = 0; index < size(); index++) {
- String line = this.getToolChainConfigs(index).getName() + " " + ToolChainConfigId.EQUALS + " "
- + this.getToolChainConfigs(index).getValue();
- bw.write(line);
- bw.newLine();
- }
- bw.flush();
- bw.close();
- fw.close();
- }
- }
-
- /**
-
- @param file
- @throws IOException
- @throws FileNotFoundException
-
- **/
- public void parseFile(String file) throws IOException {
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- String line = br.readLine();
- while (line != null) {
- parseLine(line);
- line = br.readLine();
- }
- }
-
- /**
- Parse the input string and add name, value to vector
-
- @param line
-
- **/
- private void parseLine(String line) {
- String name = "";
- String value = "";
- if (line.indexOf(ToolChainConfigId.COMMENTS) != 0 && line.indexOf(ToolChainConfigId.EQUALS) > -1) {
- name = line.substring(0, line.indexOf(ToolChainConfigId.EQUALS)).trim();
- value = line.substring(line.indexOf(ToolChainConfigId.EQUALS) + 1).trim();
- this.addToolChainConfigs(new ToolChainConfigId(name, value));
- }
- }
-}
|