summaryrefslogtreecommitdiff
path: root/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java
blob: 4708191ac9d26c4694d9be84e9e59e05310f5344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/** @file
 
 
 The file is used to override DefaultMutableTreeNode to provides customized interfaces 
 
 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.ui;

import javax.swing.tree.DefaultMutableTreeNode;

import org.tianocore.frameworkwizard.common.Identifications.Identification;

/**
 The class is used to override DefaultMutableTreeNode to provides customized interfaces
 It extends DefaultMutableTreeNode
 

 
 **/
public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
    ///
    /// Define class Serial Version UID
    ///
    private static final long serialVersionUID = -1947340717458069548L;

    //
    // Static final definitions for all kinds of node
    //
    public static final int MSA_HEADER = 100;

    public static final int MSA_LIBRARYCLASSDEFINITIONS = 101;

    public static final int MSA_PACKAGEDEPENDENCIES = 102;

    public static final int MSA_SOURCEFILES = 103;

    public static final int MSA_PROTOCOLS = 104;

    public static final int MSA_EVENTS = 105;

    public static final int MSA_HOBS = 106;

    public static final int MSA_PPIS = 107;

    public static final int MSA_VARIABLES = 108;

    public static final int MSA_BOOTMODES = 109;

    public static final int MSA_SYSTEMTABLES = 110;

    public static final int MSA_DATAHUBS = 111;

    public static final int MSA_HIIPACKAGES = 112;

    public static final int MSA_GUIDS = 113;

    public static final int MSA_EXTERNS = 114;

    public static final int MSA_PCDS = 115;

    public static final int MSA_BUILDOPTIONS = 117;

    public static final int MSA_USEREXTENSIONS = 118;

    public static final int MSA_MODULEDEFINITIONS = 119;

    public static final int SPD_HEADER = 200;

    public static final int SPD_LIBRARYCLASSDECLARATIONS = 201;

    public static final int SPD_MSAFILES = 202;

    public static final int SPD_PACKAGEHEADERS = 203;

    public static final int SPD_GUIDDECLARATIONS = 204;

    public static final int SPD_PROTOCOLDECLARATIONS = 205;

    public static final int SPD_PPIDECLARATIONS = 206;

    public static final int SPD_PCDDECLARATIONS = 207;

    public static final int SPD_PACKAGEDEFINITIONS = 208;

    public static final int SPD_INDUSTRYSTDINCLUDES = 209;

    public static final int FPD_PLATFORMHEADER = 300;

    public static final int FPD_FLASH = 301;

    public static final int FPD_FRAMEWORKMODULES = 302;

    public static final int FPD_PCDDYNAMICBUILDDECLARATIONS = 303;

    public static final int FPD_BUILDOPTIONS = 304;

    public static final int FPD_PLATFORMDEFINITIONS = 305;

    public static final int WORKSPACE = 0;

    public static final int MODULE_DESCRIPTION = 1;

    public static final int PACKAGE_DESCRIPTION = 2;

    public static final int PLATFORM_DESCRIPTION = 3;

    public static final int MODULE = 4;

    public static final int PACKAGE = 5;

    public static final int PLATFORM = 6;

    public static final int MODULE_PACKAGE = 7;

    public static final int MODULE_PACKAGE_LIBRARY = 8;

    public static final int MODULE_PACKAGE_MODULE = 9;

    //
    //Static final definitions for operation
    //
    public static final int OPERATION_NULL = 0;

    public static final int OPERATION_ADD = 1;

    public static final int OPERATION_UPDATE = 2;

    public static final int OPERATION_DELETE = 4;

    public static final int OPERATION_ADD_UPDATE = 3;

    public static final int OPERATION_ADD_DELETE = 5;

    public static final int OPERATION_UPDATE_DELETE = 6;

    public static final int OPERATION_ADD_UPDATE_DELETE = 7;

    //
    //Define 4 node attributes
    //
    private int category = 0;

    private String nodeName = "";

    private boolean isOpening = false;

    private Identification id = null;
    
    private IDefaultMutableTreeNode belongNode = null;

    /**
     This is the default constructor
     
     **/
    public IDefaultMutableTreeNode() {
        super();
    }

    /**
     This is the overrided constructor
     Init clase members with input data
     
     @param strNodeName The name of node
     @param intCategory The category of node
     @param bolIsOpened to identify if the node is opening or not
     @param identification The Identification of node
     
     **/
    public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
                                   Identification identification, IDefaultMutableTreeNode idmtBelongNode) {
        super(strNodeName);
        this.nodeName = strNodeName;
        this.category = intCategory;
        this.isOpening = bolIsOpening;
        this.id = identification;
        this.belongNode = idmtBelongNode;
    }

    /**
     Get category of node 
     
     @return The category of node
     
     **/
    public int getCategory() {
        return category;
    }

    /**
     Set category of node
     
     @param category The input data of node category
     
     **/
    public void setCategory(int category) {
        this.category = category;
    }

    /**
     Get name of node
     
     @return The name of node
     
     **/
    public String getNodeName() {
        return nodeName;
    }

    /**
     Set name of node
     
     @param nodeName The input data of node name
     
     **/
    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    /**
     Get identification of node
     
     @return
     
     **/
    public Identification getId() {
        return id;
    }

    /**
     Set identification of node
     
     @param id
     
     **/
    public void setId(Identification id) {
        this.id = id;
    }

    /**
     get isOpening of node
     
     @return
     
     **/
    public boolean isOpening() {
        return isOpening;
    }

    /**
     Set isOpening of node
     
     @param isOpening
     
     **/
    public void setOpening(boolean isOpening) {
        this.isOpening = isOpening;
    }
    
    public String toString() {
        return this.nodeName;
    }

    public IDefaultMutableTreeNode getBelongNode() {
        return belongNode;
    }

    public void setBelongNode(IDefaultMutableTreeNode belongNode) {
        this.belongNode = belongNode;
    }
}