3 The file is used to define opening package list
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.common
.Identifications
;
17 import java
.util
.Vector
;
19 import javax
.swing
.tree
.TreePath
;
21 import org
.tianocore
.PlatformSurfaceAreaDocument
;
23 public class OpeningPlatformList
{
25 private Vector
<OpeningPlatformType
> vOpeningPlatformList
= new Vector
<OpeningPlatformType
>();
27 public OpeningPlatformList() {
31 public Vector
<OpeningPlatformType
> getVOpeningPlatformList() {
32 return vOpeningPlatformList
;
35 public void setVOpeningPlatformList(Vector
<OpeningPlatformType
> openingPlatformList
) {
36 vOpeningPlatformList
= openingPlatformList
;
39 public void insertToOpeningPlatformList(Identification id
, PlatformSurfaceAreaDocument
.PlatformSurfaceArea xmlFpd
) {
40 vOpeningPlatformList
.addElement(new OpeningPlatformType(id
, xmlFpd
));
43 public OpeningPlatformType
getOpeningPlatformByIndex(int index
) {
44 if (index
> -1 && index
< vOpeningPlatformList
.size()) {
45 return vOpeningPlatformList
.elementAt(index
);
50 public OpeningPlatformType
getOpeningPlatformById(Identification id
) {
51 int index
= findIndexOfListById(id
);
53 return vOpeningPlatformList
.elementAt(index
);
58 public int findIndexOfListById(Identification id
) {
59 for (int index
= 0; index
< vOpeningPlatformList
.size(); index
++) {
60 if (vOpeningPlatformList
.elementAt(index
).getId().equals(id
)) {
67 public void removeFromOpeningPlatformListByIndex(int index
) {
68 if (index
> -1 && index
< vOpeningPlatformList
.size()) {
69 vOpeningPlatformList
.removeElementAt(index
);
73 public void removeFromOpeningPlatformListById(Identification id
) {
74 int index
= findIndexOfListById(id
);
76 vOpeningPlatformList
.removeElementAt(findIndexOfListById(id
));
80 public void removeAllFromOpeningPlatformList() {
81 vOpeningPlatformList
.removeAllElements();
84 public PlatformSurfaceAreaDocument
.PlatformSurfaceArea
getPlatformSurfaceAreaFromId(Identification id
) {
85 int index
= findIndexOfListById(id
);
87 return vOpeningPlatformList
.elementAt(index
).getXmlFpd();
92 public boolean existsPlatform(Identification id
) {
93 int index
= findIndexOfListById(id
);
101 public void setPlatformSaved(Identification id
, boolean isSaved
) {
102 setPlatformSaved(findIndexOfListById(id
), isSaved
);
105 public void setPlatformSaved(int index
, boolean isSaved
) {
107 vOpeningPlatformList
.elementAt(index
).setSaved(isSaved
);
111 public boolean getPlatformSaved(Identification id
) {
112 return getPlatformSaved(findIndexOfListById(id
));
115 public boolean getPlatformSaved(int index
) {
117 return vOpeningPlatformList
.elementAt(index
).isSaved();
122 public void setTreePathById(Identification id
, TreePath treePath
) {
123 int index
= findIndexOfListById(id
);
125 vOpeningPlatformList
.elementAt(index
).setTreePath(treePath
);
129 public TreePath
getTreePathById(Identification id
) {
130 int index
= findIndexOfListById(id
);
132 return vOpeningPlatformList
.elementAt(index
).getTreePath();
137 public TreePath
getTreePathByIndex(int index
) {
139 return vOpeningPlatformList
.elementAt(index
).getTreePath();
144 public void setNew(Identification id
, boolean isNew
) {
145 int index
= findIndexOfListById(id
);
147 vOpeningPlatformList
.elementAt(index
).setNew(isNew
);
152 return vOpeningPlatformList
.size();
155 public boolean isSaved() {
156 for (int index
= 0; index
< this.size(); index
++) {
157 if (!this.getPlatformSaved(index
)) {
164 public boolean isOpend() {
165 if (this.size() > 0 ) {