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
.packaging
.common
.ui
;
19 import javax
.swing
.tree
.DefaultMutableTreeNode
;
22 The class is used to override DefaultMutableTreeNode to provides customized interfaces
23 It extends DefaultMutableTreeNode
25 @since ModuleEditor 1.0
28 public class IDefaultMutableTreeNode
extends DefaultMutableTreeNode
{
30 /// Define class Serial Version UID
32 private static final long serialVersionUID
= -1947340717458069548L;
35 //Static final definitions for all kinds of node
37 public static final int MSA_HEADER
= 0;
39 public static final int LIBRARYCLASSDEFINITIONS
= 1;
41 public static final int SOURCEFILES
= 2;
43 public static final int INCLUDES
= 3;
45 public static final int PROTOCOLS
= 4;
47 public static final int EVENTS
= 5;
49 public static final int HOBS
= 6;
51 public static final int PPIS
= 7;
53 public static final int VARIABLES
= 8;
55 public static final int BOOTMODES
= 9;
57 public static final int SYSTEMTABLES
= 10;
59 public static final int DATAHUBS
= 11;
61 public static final int FORMSETS
= 12;
63 public static final int GUIDS
= 13;
65 public static final int EXTERNS
= 14;
67 public static final int PCDS
= 15;
69 public static final int MBD_HEADER
= 20;
71 public static final int MLSA_HEADER
= 21;
73 public static final int MLBD_HEADER
= 22;
75 public static final int LIBRARIES
= 23;
77 public static final int LIBRARY_CLASS_DEFINITION
= 101;
79 public static final int SOURCEFILES_FILENAME
= 210;
81 public static final int SOURCEFILES_FILENAME_ITEM
= 211;
83 public static final int SOURCEFILES_ARCH
= 220;
85 public static final int SOURCEFILES_ARCH_ITEM
= 221;
87 public static final int INCLUDES_PACKAGENAME
= 310;
89 public static final int INCLUDES_PACKAGENAME_ITEM
= 311;
91 public static final int INCLUDES_ARCH
= 320;
93 public static final int INCLUDES_ARCH_ITEM
= 321;
95 public static final int PROTOCOLS_PROTOCOL
= 410;
97 public static final int PROTOCOLS_PROTOCOL_ITEM
= 411;
99 public static final int PROTOCOLS_PROTOCOLNOTIFY
= 420;
101 public static final int PROTOCOLS_PROTOCOLNOTIFY_ITEM
= 421;
103 public static final int EVENTS_CREATEEVENTS
= 510;
105 public static final int EVENTS_CREATEEVENTS_ITEM
= 511;
107 public static final int EVENTS_SIGNALEVENTS
= 520;
109 public static final int EVENTS_SIGNALEVENTS_ITEM
= 521;
111 public static final int HOBS_HOB_ITEM
= 611;
113 public static final int PPIS_PPI
= 710;
115 public static final int PPIS_PPI_ITEM
= 711;
117 public static final int PPIS_PPINOTIFY
= 720;
119 public static final int PPIS_PPINOTIFY_ITEM
= 721;
121 public static final int VARIABLES_VARIABLE_ITEM
= 811;
123 public static final int BOOTMODES_BOOTMODE_ITEM
= 911;
125 public static final int SYSTEMTABLES_SYSTEMTABLE_ITEM
= 1011;
127 public static final int DATAHUBS_DATAHUB_ITEM
= 1111;
129 public static final int FORMSETS_FORMSET_ITEM
= 1211;
131 public static final int GUIDS_GUIDENTRY_ITEM
= 1311;
133 public static final int EXTERNS_EXTERN_ITEM
= 1411;
135 public static final int PCDS_PCDDATA_ITEM
= 1511;
137 public static final int LIBRARIES_LIBRARY
= 2310;
139 public static final int LIBRARIES_LIBRARY_ITEM
= 2311;
141 public static final int LIBRARIES_ARCH
= 2320;
143 public static final int LIBRARIES_ARCH_ITEM
= 2321;
146 //Static final definitions for operation
148 public static final int OPERATION_NULL
= 0;
150 public static final int OPERATION_ADD
= 1;
152 public static final int OPERATION_UPDATE
= 2;
154 public static final int OPERATION_DELETE
= 4;
156 public static final int OPERATION_ADD_UPDATE
= 3;
158 public static final int OPERATION_ADD_DELETE
= 5;
160 public static final int OPERATION_UPDATE_DELETE
= 6;
162 public static final int OPERATION_ADD_UPDATE_DELETE
= 7;
165 //Define 4 node attributes
167 private int category
= 0;
169 private int operation
= 0;
171 private int location
= 0;
173 private String nodeName
= "";
176 Main class, reserved for test
181 public static void main(String
[] args
) {
182 // TODO Auto-generated method stub
187 This is the default constructor
190 public IDefaultMutableTreeNode() {
195 This is the overrided constructor
196 Init clase members with input data
198 @param strNodeName The name of node
199 @param intCategory The category of node
200 @param intOperation The operation of node
203 public IDefaultMutableTreeNode(String strNodeName
, int intCategory
, int intOperation
) {
205 this.nodeName
= strNodeName
;
206 this.category
= intCategory
;
207 this.operation
= intOperation
;
211 This is the overrided constructor
212 Init clase members with input data
214 @param strNodeName The name of node
215 @param intCategory The category of node
216 @param intOperation The operation of node
217 @param intLocation The location of node
220 public IDefaultMutableTreeNode(String strNodeName
, int intCategory
, int intOperation
, int intLocation
) {
222 this.nodeName
= strNodeName
;
223 this.category
= intCategory
;
224 this.operation
= intOperation
;
225 this.location
= intLocation
;
231 @return The category of node
234 public int getCategory() {
241 @param category The input data of node category
244 public void setCategory(int category
) {
245 this.category
= category
;
251 @return The name of node
254 public String
getNodeName() {
261 @param nodeName The input data of node name
264 public void setNodeName(String nodeName
) {
265 this.nodeName
= nodeName
;
269 Get operation of node
271 @return The operation of node
274 public int getOperation() {
279 Set operation of node
281 @param operation The input data of node operation
284 public void setOperation(int operation
) {
285 this.operation
= operation
;
291 @return The location of node
294 public int getLocation() {
301 @param location The input data of node location
304 public void setLocation(int location
) {
305 this.location
= location
;