]>
Commit | Line | Data |
---|---|---|
a13899c5 | 1 | /** @file\r |
2 | \r | |
3 | \r | |
4 | The file is used to override DefaultMutableTreeNode to provides customized interfaces \r | |
5 | \r | |
6 | Copyright (c) 2006, Intel Corporation\r | |
7 | All rights reserved. This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | package org.tianocore.frameworkwizard.common.ui;\r | |
18 | \r | |
19 | import javax.swing.tree.DefaultMutableTreeNode;\r | |
20 | \r | |
21 | import org.tianocore.frameworkwizard.common.Identification;\r | |
22 | \r | |
23 | /**\r | |
24 | The class is used to override DefaultMutableTreeNode to provides customized interfaces\r | |
25 | It extends DefaultMutableTreeNode\r | |
26 | \r | |
27 | \r | |
28 | \r | |
29 | **/\r | |
30 | public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {\r | |
31 | ///\r | |
32 | /// Define class Serial Version UID\r | |
33 | ///\r | |
34 | private static final long serialVersionUID = -1947340717458069548L;\r | |
35 | \r | |
36 | //\r | |
37 | // Static final definitions for all kinds of node\r | |
38 | //\r | |
39 | public static final int MSA_HEADER = 100;\r | |
40 | \r | |
41 | public static final int MSA_LIBRARYCLASSDEFINITIONS = 101;\r | |
42 | \r | |
43 | public static final int MSA_PACKAGEDEPENDENCIES = 102;\r | |
44 | \r | |
45 | public static final int MSA_SOURCEFILES = 103;\r | |
46 | \r | |
47 | public static final int MSA_PROTOCOLS = 104;\r | |
48 | \r | |
49 | public static final int MSA_EVENTS = 105;\r | |
50 | \r | |
51 | public static final int MSA_HOBS = 106;\r | |
52 | \r | |
53 | public static final int MSA_PPIS = 107;\r | |
54 | \r | |
55 | public static final int MSA_VARIABLES = 108;\r | |
56 | \r | |
57 | public static final int MSA_BOOTMODES = 109;\r | |
58 | \r | |
59 | public static final int MSA_SYSTEMTABLES = 110;\r | |
60 | \r | |
61 | public static final int MSA_DATAHUBS = 111;\r | |
62 | \r | |
63 | //public static final int MSA_FORMSETS = 112;\r | |
64 | \r | |
65 | public static final int MSA_HIIPACKAGES = 112;\r | |
66 | \r | |
67 | public static final int MSA_GUIDS = 113;\r | |
68 | \r | |
69 | public static final int MSA_EXTERNS = 114;\r | |
70 | \r | |
71 | public static final int MSA_PCDS = 115;\r | |
72 | \r | |
73 | public static final int MSA_BUILDOPTIONS = 117;\r | |
74 | \r | |
75 | public static final int MSA_USEREXTENSIONS = 118;\r | |
76 | \r | |
77 | public static final int MSA_MODULEDEFINITIONS = 119;\r | |
78 | \r | |
79 | public static final int SPD_HEADER = 200;\r | |
80 | \r | |
81 | public static final int SPD_LIBRARYCLASSDECLARATIONS = 201;\r | |
82 | \r | |
83 | public static final int SPD_MSAFILES = 202;\r | |
84 | \r | |
85 | public static final int SPD_PACKAGEHEADERS = 203;\r | |
86 | \r | |
87 | public static final int SPD_GUIDDECLARATIONS = 204;\r | |
88 | \r | |
89 | public static final int SPD_PROTOCOLDECLARATIONS = 205;\r | |
90 | \r | |
91 | public static final int SPD_PPIDECLARATIONS = 206;\r | |
92 | \r | |
93 | public static final int SPD_PCDDECLARATIONS = 207;\r | |
94 | \r | |
95 | public static final int SPD_PACKAGEDEFINITIONS = 208;\r | |
96 | \r | |
97 | public static final int SPD_INDUSTRYSTDINCLUDES = 209;\r | |
98 | \r | |
99 | public static final int FPD_PLATFORMHEADER = 300;\r | |
100 | \r | |
101 | public static final int FPD_FLASH = 301;\r | |
102 | \r | |
103 | public static final int FPD_FRAMEWORKMODULES = 302;\r | |
104 | \r | |
105 | public static final int FPD_PCDDYNAMICBUILDDECLARATIONS = 303;\r | |
106 | \r | |
107 | public static final int FPD_BUILDOPTIONS = 304;\r | |
108 | \r | |
109 | public static final int FPD_PLATFORMDEFINITIONS = 305;\r | |
110 | \r | |
111 | public static final int WORKSPACE = 0;\r | |
112 | \r | |
113 | public static final int MODULE = 1;\r | |
114 | \r | |
115 | public static final int PACKAGE = 2;\r | |
116 | \r | |
117 | public static final int PLATFORM = 3;\r | |
118 | \r | |
119 | //\r | |
120 | //Static final definitions for operation\r | |
121 | //\r | |
122 | public static final int OPERATION_NULL = 0;\r | |
123 | \r | |
124 | public static final int OPERATION_ADD = 1;\r | |
125 | \r | |
126 | public static final int OPERATION_UPDATE = 2;\r | |
127 | \r | |
128 | public static final int OPERATION_DELETE = 4;\r | |
129 | \r | |
130 | public static final int OPERATION_ADD_UPDATE = 3;\r | |
131 | \r | |
132 | public static final int OPERATION_ADD_DELETE = 5;\r | |
133 | \r | |
134 | public static final int OPERATION_UPDATE_DELETE = 6;\r | |
135 | \r | |
136 | public static final int OPERATION_ADD_UPDATE_DELETE = 7;\r | |
137 | \r | |
138 | //\r | |
139 | //Define 4 node attributes\r | |
140 | //\r | |
141 | private int category = 0;\r | |
142 | \r | |
143 | private int operation = 0;\r | |
144 | \r | |
145 | private int location = 0;\r | |
146 | \r | |
147 | private String nodeName = "";\r | |
148 | \r | |
149 | private boolean isOpening = false;\r | |
150 | \r | |
151 | private Identification id = null;\r | |
152 | \r | |
153 | /**\r | |
154 | Main class, reserved for test\r | |
155 | \r | |
156 | @param args\r | |
157 | \r | |
158 | **/\r | |
159 | public static void main(String[] args) {\r | |
160 | // TODO Auto-generated method stub\r | |
161 | \r | |
162 | }\r | |
163 | \r | |
164 | /**\r | |
165 | This is the default constructor\r | |
166 | \r | |
167 | **/\r | |
168 | public IDefaultMutableTreeNode() {\r | |
169 | super();\r | |
170 | }\r | |
171 | \r | |
172 | /**\r | |
173 | This is the overrided constructor\r | |
174 | Init clase members with input data\r | |
175 | \r | |
176 | @param strNodeName The name of node\r | |
177 | @param intCategory The category of node\r | |
178 | @param bolIsOpened to identify if the node is opening or not\r | |
179 | @param identification The Identification of node\r | |
180 | \r | |
181 | **/\r | |
182 | public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,\r | |
183 | Identification identification) {\r | |
184 | super(strNodeName);\r | |
185 | this.nodeName = strNodeName;\r | |
186 | this.category = intCategory;\r | |
187 | this.isOpening = bolIsOpening;\r | |
188 | this.id = identification;\r | |
189 | }\r | |
190 | \r | |
191 | /**\r | |
192 | This is the overrided constructor\r | |
193 | Init clase members with input data\r | |
194 | \r | |
195 | @param strNodeName The name of node\r | |
196 | @param intCategory The category of node\r | |
197 | @param intOperation The operation of node\r | |
198 | \r | |
199 | **/\r | |
200 | public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation) {\r | |
201 | super(strNodeName);\r | |
202 | this.nodeName = strNodeName;\r | |
203 | this.category = intCategory;\r | |
204 | this.operation = intOperation;\r | |
205 | }\r | |
206 | \r | |
207 | /**\r | |
208 | This is the overrided constructor\r | |
209 | Init clase members with input data\r | |
210 | \r | |
211 | @param strNodeName The name of node\r | |
212 | @param intCategory The category of node\r | |
213 | @param intOperation The operation of node\r | |
214 | @param intLocation The location of node\r | |
215 | \r | |
216 | **/\r | |
217 | public IDefaultMutableTreeNode(String strNodeName, int intCategory, int intOperation, int intLocation) {\r | |
218 | super(strNodeName);\r | |
219 | this.nodeName = strNodeName;\r | |
220 | this.category = intCategory;\r | |
221 | this.operation = intOperation;\r | |
222 | this.location = intLocation;\r | |
223 | }\r | |
224 | \r | |
225 | /**\r | |
226 | Get category of node \r | |
227 | \r | |
228 | @return The category of node\r | |
229 | \r | |
230 | **/\r | |
231 | public int getCategory() {\r | |
232 | return category;\r | |
233 | }\r | |
234 | \r | |
235 | /**\r | |
236 | Set category of node\r | |
237 | \r | |
238 | @param category The input data of node category\r | |
239 | \r | |
240 | **/\r | |
241 | public void setCategory(int category) {\r | |
242 | this.category = category;\r | |
243 | }\r | |
244 | \r | |
245 | /**\r | |
246 | Get name of node\r | |
247 | \r | |
248 | @return The name of node\r | |
249 | \r | |
250 | **/\r | |
251 | public String getNodeName() {\r | |
252 | return nodeName;\r | |
253 | }\r | |
254 | \r | |
255 | /**\r | |
256 | Set name of node\r | |
257 | \r | |
258 | @param nodeName The input data of node name\r | |
259 | \r | |
260 | **/\r | |
261 | public void setNodeName(String nodeName) {\r | |
262 | this.nodeName = nodeName;\r | |
263 | }\r | |
264 | \r | |
265 | /**\r | |
266 | Get operation of node\r | |
267 | \r | |
268 | @return The operation of node\r | |
269 | \r | |
270 | **/\r | |
271 | public int getOperation() {\r | |
272 | return operation;\r | |
273 | }\r | |
274 | \r | |
275 | /**\r | |
276 | Set operation of node\r | |
277 | \r | |
278 | @param operation The input data of node operation\r | |
279 | \r | |
280 | **/\r | |
281 | public void setOperation(int operation) {\r | |
282 | this.operation = operation;\r | |
283 | }\r | |
284 | \r | |
285 | /**\r | |
286 | Get location of node\r | |
287 | \r | |
288 | @return The location of node\r | |
289 | \r | |
290 | **/\r | |
291 | public int getLocation() {\r | |
292 | return location;\r | |
293 | }\r | |
294 | \r | |
295 | /**\r | |
296 | Set location of node\r | |
297 | \r | |
298 | @param location The input data of node location\r | |
299 | \r | |
300 | **/\r | |
301 | public void setLocation(int location) {\r | |
302 | this.location = location;\r | |
303 | }\r | |
304 | \r | |
305 | /**\r | |
306 | Get identification of node\r | |
307 | \r | |
308 | @return\r | |
309 | \r | |
310 | **/\r | |
311 | public Identification getId() {\r | |
312 | return id;\r | |
313 | }\r | |
314 | \r | |
315 | /**\r | |
316 | Set identification of node\r | |
317 | \r | |
318 | @param id\r | |
319 | \r | |
320 | **/\r | |
321 | public void setId(Identification id) {\r | |
322 | this.id = id;\r | |
323 | }\r | |
324 | \r | |
325 | /**\r | |
326 | get isOpening of node\r | |
327 | \r | |
328 | @return\r | |
329 | \r | |
330 | **/\r | |
331 | public boolean isOpening() {\r | |
332 | return isOpening;\r | |
333 | }\r | |
334 | \r | |
335 | /**\r | |
336 | Set isOpening of node\r | |
337 | \r | |
338 | @param isOpening\r | |
339 | \r | |
340 | **/\r | |
341 | public void setOpening(boolean isOpening) {\r | |
342 | this.isOpening = isOpening;\r | |
343 | }\r | |
344 | }\r |