4 The file is used to override DefaultMutableTreeNode to provides customized interfaces
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 package org
.tianocore
.frameworkwizard
.common
.ui
;
19 import javax
.swing
.tree
.DefaultMutableTreeNode
;
21 import org
.tianocore
.frameworkwizard
.common
.Identifications
.Identification
;
24 The class is used to override DefaultMutableTreeNode to provides customized interfaces
25 It extends DefaultMutableTreeNode
30 public class IDefaultMutableTreeNode
extends DefaultMutableTreeNode
{
32 /// Define class Serial Version UID
34 private static final long serialVersionUID
= -1947340717458069548L;
37 // Static final definitions for all kinds of node
39 public static final int MSA_HEADER
= 100;
41 public static final int MSA_LIBRARYCLASSDEFINITIONS
= 101;
43 public static final int MSA_PACKAGEDEPENDENCIES
= 102;
45 public static final int MSA_SOURCEFILES
= 103;
47 public static final int MSA_PROTOCOLS
= 104;
49 public static final int MSA_EVENTS
= 105;
51 public static final int MSA_HOBS
= 106;
53 public static final int MSA_PPIS
= 107;
55 public static final int MSA_VARIABLES
= 108;
57 public static final int MSA_BOOTMODES
= 109;
59 public static final int MSA_SYSTEMTABLES
= 110;
61 public static final int MSA_DATAHUBS
= 111;
63 //public static final int MSA_FORMSETS = 112;
65 public static final int MSA_HIIPACKAGES
= 112;
67 public static final int MSA_GUIDS
= 113;
69 public static final int MSA_EXTERNS
= 114;
71 public static final int MSA_PCDS
= 115;
73 public static final int MSA_BUILDOPTIONS
= 117;
75 public static final int MSA_USEREXTENSIONS
= 118;
77 public static final int MSA_MODULEDEFINITIONS
= 119;
79 public static final int SPD_HEADER
= 200;
81 public static final int SPD_LIBRARYCLASSDECLARATIONS
= 201;
83 public static final int SPD_MSAFILES
= 202;
85 public static final int SPD_PACKAGEHEADERS
= 203;
87 public static final int SPD_GUIDDECLARATIONS
= 204;
89 public static final int SPD_PROTOCOLDECLARATIONS
= 205;
91 public static final int SPD_PPIDECLARATIONS
= 206;
93 public static final int SPD_PCDDECLARATIONS
= 207;
95 public static final int SPD_PACKAGEDEFINITIONS
= 208;
97 public static final int SPD_INDUSTRYSTDINCLUDES
= 209;
99 public static final int FPD_PLATFORMHEADER
= 300;
101 public static final int FPD_FLASH
= 301;
103 public static final int FPD_FRAMEWORKMODULES
= 302;
105 public static final int FPD_PCDDYNAMICBUILDDECLARATIONS
= 303;
107 public static final int FPD_BUILDOPTIONS
= 304;
109 public static final int FPD_PLATFORMDEFINITIONS
= 305;
111 public static final int WORKSPACE
= 0;
113 public static final int MODULE
= 1;
115 public static final int PACKAGE
= 2;
117 public static final int PLATFORM
= 3;
119 public static final int MODULE_PACKAGE
= 4;
121 public static final int MODULE_PACKAGE_LIBRARY
= 5;
123 public static final int MODULE_PACKAGE_MODULE
= 6;
126 //Static final definitions for operation
128 public static final int OPERATION_NULL
= 0;
130 public static final int OPERATION_ADD
= 1;
132 public static final int OPERATION_UPDATE
= 2;
134 public static final int OPERATION_DELETE
= 4;
136 public static final int OPERATION_ADD_UPDATE
= 3;
138 public static final int OPERATION_ADD_DELETE
= 5;
140 public static final int OPERATION_UPDATE_DELETE
= 6;
142 public static final int OPERATION_ADD_UPDATE_DELETE
= 7;
145 //Define 4 node attributes
147 private int category
= 0;
149 private int operation
= 0;
151 private int location
= 0;
153 private String nodeName
= "";
155 private boolean isOpening
= false;
157 private Identification id
= null;
160 Main class, reserved for test
165 public static void main(String
[] args
) {
166 // TODO Auto-generated method stub
171 This is the default constructor
174 public IDefaultMutableTreeNode() {
179 This is the overrided constructor
180 Init clase members with input data
182 @param strNodeName The name of node
183 @param intCategory The category of node
184 @param bolIsOpened to identify if the node is opening or not
185 @param identification The Identification of node
188 public IDefaultMutableTreeNode(String strNodeName
, int intCategory
, boolean bolIsOpening
,
189 Identification identification
) {
191 this.nodeName
= strNodeName
;
192 this.category
= intCategory
;
193 this.isOpening
= bolIsOpening
;
194 this.id
= identification
;
198 This is the overrided constructor
199 Init clase members with input data
201 @param strNodeName The name of node
202 @param intCategory The category of node
203 @param intOperation The operation of node
206 public IDefaultMutableTreeNode(String strNodeName
, int intCategory
, int intOperation
) {
208 this.nodeName
= strNodeName
;
209 this.category
= intCategory
;
210 this.operation
= intOperation
;
214 This is the overrided constructor
215 Init clase members with input data
217 @param strNodeName The name of node
218 @param intCategory The category of node
219 @param intOperation The operation of node
220 @param intLocation The location of node
223 public IDefaultMutableTreeNode(String strNodeName
, int intCategory
, int intOperation
, int intLocation
) {
225 this.nodeName
= strNodeName
;
226 this.category
= intCategory
;
227 this.operation
= intOperation
;
228 this.location
= intLocation
;
234 @return The category of node
237 public int getCategory() {
244 @param category The input data of node category
247 public void setCategory(int category
) {
248 this.category
= category
;
254 @return The name of node
257 public String
getNodeName() {
264 @param nodeName The input data of node name
267 public void setNodeName(String nodeName
) {
268 this.nodeName
= nodeName
;
272 Get operation of node
274 @return The operation of node
277 public int getOperation() {
282 Set operation of node
284 @param operation The input data of node operation
287 public void setOperation(int operation
) {
288 this.operation
= operation
;
294 @return The location of node
297 public int getLocation() {
304 @param location The input data of node location
307 public void setLocation(int location
) {
308 this.location
= location
;
312 Get identification of node
317 public Identification
getId() {
322 Set identification of node
327 public void setId(Identification id
) {
332 get isOpening of node
337 public boolean isOpening() {
342 Set isOpening of node
347 public void setOpening(boolean isOpening
) {
348 this.isOpening
= isOpening
;