]>
Commit | Line | Data |
---|---|---|
419558bb | 1 | /** @file\r |
2 | \r | |
3 | The file is used to show detailed information of one of find results\r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation\r | |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | package org.tianocore.frameworkwizard.common.find;\r | |
16 | \r | |
17 | import java.awt.event.ActionEvent;\r | |
18 | import java.awt.event.ComponentEvent;\r | |
19 | import java.awt.event.WindowEvent;\r | |
20 | import java.util.Vector;\r | |
21 | \r | |
22 | import javax.swing.JButton;\r | |
23 | import javax.swing.JFrame;\r | |
24 | import javax.swing.JPanel;\r | |
25 | import javax.swing.JScrollPane;\r | |
26 | import javax.swing.JTextArea;\r | |
27 | \r | |
d12f87d3 | 28 | import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;\r |
29 | import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;\r | |
30 | import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData;\r | |
419558bb | 31 | import org.tianocore.FrameworkModulesDocument.FrameworkModules;\r |
32 | import org.tianocore.LibrariesDocument.Libraries;\r | |
33 | import org.tianocore.LibrariesDocument.Libraries.Instance;\r | |
34 | import org.tianocore.LibraryClassDocument.LibraryClass;\r | |
35 | import org.tianocore.ModuleSADocument.ModuleSA;\r | |
36 | import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r | |
37 | import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r | |
d12f87d3 | 38 | import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;\r |
39 | import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData;\r | |
40 | import org.tianocore.PcdCodedDocument.PcdCoded;\r | |
419558bb | 41 | import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r |
42 | import org.tianocore.frameworkwizard.common.DataType;\r | |
43 | import org.tianocore.frameworkwizard.common.GlobalData;\r | |
44 | import org.tianocore.frameworkwizard.common.Tools;\r | |
45 | import org.tianocore.frameworkwizard.common.ui.IFrame;\r | |
46 | import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r | |
47 | import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r | |
48 | import org.tianocore.frameworkwizard.workspace.Workspace;\r | |
49 | import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r | |
50 | \r | |
51 | public class FindResultDetailInfo extends IFrame {\r | |
52 | \r | |
53 | ///\r | |
54 | /// Define class Serial Version UID\r | |
55 | ///\r | |
56 | private static final long serialVersionUID = -4888295869041881282L;\r | |
57 | \r | |
58 | private JPanel jContentPane = null;\r | |
59 | \r | |
60 | private JScrollPane jScrollPane = null;\r | |
61 | \r | |
62 | private JTextArea jTextArea = null;\r | |
63 | \r | |
64 | private JButton jButtonClose = null;\r | |
65 | \r | |
66 | //\r | |
67 | // Not for UI\r | |
68 | //\r | |
69 | private static String TAB = " ";\r | |
70 | \r | |
71 | private String reportContent = "";\r | |
72 | \r | |
73 | private WorkspaceTools wt = new WorkspaceTools();\r | |
74 | \r | |
75 | /**\r | |
76 | * This method initializes jScrollPane \r | |
77 | * \r | |
78 | * @return javax.swing.JScrollPane \r | |
79 | */\r | |
80 | private JScrollPane getJScrollPane() {\r | |
81 | if (jScrollPane == null) {\r | |
82 | jScrollPane = new JScrollPane();\r | |
83 | jScrollPane.setBounds(new java.awt.Rectangle(5, 5, 535, 280));\r | |
84 | jScrollPane.setPreferredSize(new java.awt.Dimension(535, 280));\r | |
85 | jScrollPane.setViewportView(getJTextArea());\r | |
86 | }\r | |
87 | return jScrollPane;\r | |
88 | }\r | |
89 | \r | |
90 | /**\r | |
91 | * This method initializes jTextArea \r | |
92 | * \r | |
93 | * @return javax.swing.JTextArea \r | |
94 | */\r | |
95 | private JTextArea getJTextArea() {\r | |
96 | if (jTextArea == null) {\r | |
97 | jTextArea = new JTextArea();\r | |
98 | jTextArea.setEditable(false);\r | |
99 | }\r | |
100 | return jTextArea;\r | |
101 | }\r | |
102 | \r | |
103 | /**\r | |
104 | * This method initializes jButtonClose \r | |
105 | * \r | |
106 | * @return javax.swing.JButton \r | |
107 | */\r | |
108 | private JButton getJButtonClose() {\r | |
109 | if (jButtonClose == null) {\r | |
110 | jButtonClose = new JButton();\r | |
111 | jButtonClose.setBounds(new java.awt.Rectangle(240, 290, 80, 20));\r | |
112 | jButtonClose.setPreferredSize(new java.awt.Dimension(80, 20));\r | |
113 | jButtonClose.addActionListener(this);\r | |
114 | jButtonClose.setText("Close");\r | |
115 | }\r | |
116 | return jButtonClose;\r | |
117 | }\r | |
118 | \r | |
119 | /**\r | |
120 | \r | |
121 | @param lci\r | |
122 | \r | |
123 | **/\r | |
124 | public FindResultDetailInfo(FindResultId frid) {\r | |
125 | super();\r | |
126 | init();\r | |
127 | this.setTitle(frid.getName());\r | |
128 | this.jTextArea.setText(createReport(frid));\r | |
129 | this.jTextArea.setSelectionStart(0);\r | |
130 | this.jTextArea.setSelectionEnd(0);\r | |
131 | }\r | |
132 | \r | |
d12f87d3 | 133 | /**\r |
134 | \r | |
135 | @param lci\r | |
136 | \r | |
137 | **/\r | |
138 | public FindResultDetailInfo(PcdFindResultId frid) {\r | |
139 | super();\r | |
140 | init();\r | |
141 | this.setTitle(frid.getName());\r | |
142 | this.jTextArea.setText(createReport(frid));\r | |
143 | this.jTextArea.setSelectionStart(0);\r | |
144 | this.jTextArea.setSelectionEnd(0);\r | |
145 | }\r | |
146 | \r | |
147 | /**\r | |
148 | Create detailed information report for pcd\r | |
149 | \r | |
150 | @param frid\r | |
151 | @return\r | |
152 | \r | |
153 | **/\r | |
154 | private String createReport(PcdFindResultId frid) {\r | |
155 | String name = frid.getName();\r | |
156 | \r | |
157 | //\r | |
158 | // Write Pcd Name\r | |
159 | //\r | |
160 | writeReportLn("PCD C Name: " + name);\r | |
161 | \r | |
162 | //\r | |
163 | // Wrtie Declared package\r | |
164 | //\r | |
165 | writeReportLn("Declared in Package: " + frid.getDeclaredBy().getName() + " ("\r | |
166 | + Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace()) + ")");\r | |
167 | \r | |
168 | //\r | |
169 | // Write Token Space\r | |
170 | //\r | |
171 | writeReportLn("Token Space: " + frid.getTokenSpaceGuidCName());\r | |
172 | \r | |
173 | //\r | |
174 | // Write Token\r | |
175 | //\r | |
176 | writeReportLn("Token: " + frid.getToken());\r | |
177 | \r | |
178 | //\r | |
179 | // Write Datum Type\r | |
180 | //\r | |
181 | writeReportLn("Datum Type: " + frid.getDatumType());\r | |
182 | \r | |
183 | //\r | |
184 | // Write Default Value\r | |
185 | //\r | |
186 | writeReportLn("Default Value: " + frid.getValue());\r | |
187 | \r | |
188 | //\r | |
189 | // Write Usages\r | |
190 | //\r | |
191 | writeReportLn("Valid Usages: " + frid.getUsage());\r | |
192 | \r | |
193 | //\r | |
194 | // Write Help Text\r | |
195 | //\r | |
196 | writeReportLn("Help Text: ");\r | |
197 | writeReportLn(TAB + frid.getHelp());\r | |
198 | \r | |
199 | //\r | |
200 | // Write an Empty Line\r | |
201 | //\r | |
202 | writeReportLn("");\r | |
203 | \r | |
204 | //\r | |
205 | // Wriet all modules which use this PCD:\r | |
206 | //\r | |
207 | writeReportLn("Modules Coded to Use This PCD: ");\r | |
208 | \r | |
209 | Vector<ModuleIdentification> vModules = frid.getConsumedModules();\r | |
210 | if (vModules != null) {\r | |
211 | for (int index = 0; index < vModules.size(); index++) {\r | |
212 | //\r | |
213 | // Write Module Name and Path\r | |
214 | //\r | |
215 | writeReportLn(TAB + vModules.get(index).getName() + " ("\r | |
216 | + Tools.getRelativePath(vModules.get(index).getPath(), Workspace.getCurrentWorkspace())\r | |
217 | + ")");\r | |
218 | \r | |
219 | //\r | |
220 | // Write Module Pcd Info\r | |
221 | //\r | |
222 | ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(vModules.get(index));\r | |
223 | if (msa != null) {\r | |
224 | PcdCoded pcdCoded = msa.getPcdCoded();\r | |
225 | if (pcdCoded != null) {\r | |
226 | for (int indexOfPcd = 0; indexOfPcd < pcdCoded.getPcdEntryList().size(); indexOfPcd++) {\r | |
227 | if (pcdCoded.getPcdEntryList().get(indexOfPcd).getCName().equals(name)) {\r | |
228 | //\r | |
229 | // Write Pcd Item Type\r | |
230 | //\r | |
231 | writeReportLn(TAB + TAB + "PcdItemType: "\r | |
232 | + pcdCoded.getPcdEntryList().get(indexOfPcd).getPcdItemType().toString());\r | |
233 | \r | |
234 | //\r | |
235 | // Write Help Text\r | |
236 | //\r | |
237 | writeReportLn(TAB + TAB + "Help Text: ");\r | |
238 | writeReportLn(TAB + TAB + TAB\r | |
239 | + pcdCoded.getPcdEntryList().get(indexOfPcd).getHelpText());\r | |
240 | }\r | |
241 | }\r | |
242 | }\r | |
243 | }\r | |
244 | \r | |
245 | //\r | |
246 | // Write an Empty Line\r | |
247 | //\r | |
248 | writeReportLn("");\r | |
249 | }\r | |
250 | }\r | |
251 | \r | |
252 | //\r | |
253 | // Write an Empty Line\r | |
254 | //\r | |
255 | writeReportLn("");\r | |
256 | \r | |
257 | //\r | |
258 | // Write All Platforms Specifing this PCD\r | |
259 | //\r | |
260 | writeReportLn("Platforms Specifing this PCD: ");\r | |
261 | \r | |
262 | for (int index = 0; index < GlobalData.openingPlatformList.size(); index++) {\r | |
263 | PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index).getXmlFpd();\r | |
264 | PlatformIdentification pid = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index).getId();\r | |
265 | \r | |
266 | String tmp = "";\r | |
267 | //\r | |
268 | // Get Non-Dynamic Pcd\r | |
269 | //\r | |
270 | FrameworkModules fm = fpd.getFrameworkModules();\r | |
271 | if (fm != null) {\r | |
272 | for (int indexOfModuleSa = 0; indexOfModuleSa < fm.getModuleSAList().size(); indexOfModuleSa++) {\r | |
273 | ModuleSA msa = fm.getModuleSAList().get(indexOfModuleSa);\r | |
274 | if (msa != null) {\r | |
275 | PcdBuildDefinition p = msa.getPcdBuildDefinition();\r | |
276 | if (p != null) {\r | |
277 | if (p.getPcdDataList() != null) {\r | |
278 | \r | |
279 | for (int indexOfPcd = 0; indexOfPcd < p.getPcdDataList().size(); indexOfPcd++) {\r | |
280 | PcdData pd = p.getPcdDataList().get(indexOfPcd);\r | |
281 | //\r | |
282 | // Find this PCD\r | |
283 | //\r | |
284 | if (pd.getCName().equals(name)) {\r | |
285 | //\r | |
286 | // Write Module Sa Info\r | |
287 | //\r | |
288 | ModuleIdentification moduleSaId = GlobalData\r | |
289 | .findIdByGuidVersion(\r | |
290 | msa\r | |
291 | .getModuleGuid(),\r | |
292 | msa\r | |
293 | .getModuleVersion(),\r | |
294 | msa\r | |
295 | .getPackageGuid(),\r | |
296 | msa\r | |
297 | .getPackageVersion());\r | |
298 | tmp = tmp\r | |
299 | + TAB\r | |
300 | + TAB\r | |
301 | + "Module: "\r | |
302 | + moduleSaId.getName()\r | |
303 | + " ("\r | |
304 | + Tools.getRelativePath(moduleSaId.getPath(),\r | |
305 | Workspace.getCurrentWorkspace()) + ")"\r | |
306 | + DataType.UNIX_LINE_SEPARATOR;\r | |
307 | tmp = tmp + TAB + TAB + TAB + "Implementation: " + pd.getItemType().toString()\r | |
308 | + DataType.UNIX_LINE_SEPARATOR;\r | |
309 | tmp = tmp + TAB + TAB + TAB + "Specified / Implementation Value: "\r | |
310 | + pd.getValue() + DataType.UNIX_LINE_SEPARATOR;\r | |
311 | tmp = tmp + DataType.UNIX_LINE_SEPARATOR;\r | |
312 | }\r | |
313 | }\r | |
314 | }\r | |
315 | }\r | |
316 | }\r | |
317 | }\r | |
318 | }\r | |
319 | \r | |
320 | //\r | |
321 | // Get Dynamic Pcd\r | |
322 | //\r | |
323 | DynamicPcdBuildDefinitions dpbd = fpd.getDynamicPcdBuildDefinitions();\r | |
324 | if (dpbd != null) {\r | |
325 | for (int indexOfDpbd = 0; indexOfDpbd < dpbd.getPcdBuildDataList().size(); indexOfDpbd++) {\r | |
326 | PcdBuildData pbd = dpbd.getPcdBuildDataList().get(indexOfDpbd);\r | |
327 | if (pbd != null) {\r | |
328 | if (pbd.getCName().equals(name)) {\r | |
329 | //\r | |
330 | // Write Dynamic Pcd Build Definition\r | |
331 | //\r | |
332 | tmp = tmp + TAB + TAB + "Dynamic Pcd Build Definition: " + DataType.UNIX_LINE_SEPARATOR;\r | |
333 | if (pbd.getSkuInfoList() != null) {\r | |
334 | for (int indexOfPcd = 0; indexOfPcd < pbd.getSkuInfoList().size(); indexOfPcd++) {\r | |
335 | SkuInfo si = pbd.getSkuInfoList().get(indexOfPcd);\r | |
336 | if (si != null) {\r | |
337 | tmp = tmp + TAB + TAB + TAB + "Sku Id: " + si.getSkuId().toString()\r | |
338 | + DataType.UNIX_LINE_SEPARATOR;\r | |
339 | tmp = tmp + TAB + TAB + TAB + "Variable Name: " + si.getVariableName()\r | |
340 | + DataType.UNIX_LINE_SEPARATOR;\r | |
341 | tmp = tmp + TAB + TAB + TAB + "Variable GUID: " + si.getVariableGuid()\r | |
342 | + DataType.UNIX_LINE_SEPARATOR;\r | |
343 | tmp = tmp + TAB + TAB + TAB + "Variable Offset: " + si.getVariableOffset()\r | |
344 | + DataType.UNIX_LINE_SEPARATOR;\r | |
345 | tmp = tmp + TAB + TAB + TAB + "Hii Default Value: " + si.getHiiDefaultValue()\r | |
346 | + DataType.UNIX_LINE_SEPARATOR;\r | |
347 | }\r | |
348 | }\r | |
349 | }\r | |
350 | }\r | |
351 | }\r | |
352 | }\r | |
353 | }\r | |
354 | \r | |
355 | //\r | |
356 | // If not empty, write this platform info\r | |
357 | //\r | |
358 | if (!Tools.isEmpty(tmp)) {\r | |
359 | tmp = TAB + "Platform: " + pid.getName() + " ("\r | |
360 | + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")"\r | |
361 | + DataType.UNIX_LINE_SEPARATOR + tmp;\r | |
362 | this.writeReportLn(tmp);\r | |
363 | }\r | |
364 | }\r | |
365 | \r | |
366 | return reportContent;\r | |
367 | }\r | |
368 | \r | |
369 | //\r | |
370 | // Create detailed information report for library\r | |
371 | // \r | |
372 | /**\r | |
373 | \r | |
374 | @param frid\r | |
375 | @return\r | |
376 | \r | |
377 | **/\r | |
419558bb | 378 | private String createReport(FindResultId frid) {\r |
379 | String tmp = "";\r | |
380 | String name = frid.getName();\r | |
381 | \r | |
382 | //\r | |
383 | // Write Class Name\r | |
384 | //\r | |
385 | writeReportLn(name);\r | |
386 | \r | |
387 | //\r | |
388 | // Write Provided Package\r | |
389 | //\r | |
390 | writeReportLn(TAB + "Provided by: " + frid.getDeclaredBy().getName() + " ("\r | |
391 | + Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace()) + ")");\r | |
392 | \r | |
393 | //\r | |
394 | // Write Header File\r | |
395 | //\r | |
396 | PackageSurfaceArea spd = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(frid.getDeclaredBy());\r | |
397 | tmp = Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace());\r | |
398 | writeReportLn(TAB + "Header File: " + Tools.getFilePathOnly(tmp)\r | |
399 | + wt.getHeaderFileFromPackageByLibraryClassName(spd, name));\r | |
400 | \r | |
401 | //\r | |
402 | // Write Supported Module Types\r | |
403 | //\r | |
404 | writeReportLn(TAB + "Supported Module Types: " + Tools.convertVectorToString(frid.getModuleType()));\r | |
405 | \r | |
406 | //\r | |
407 | // Write Supported Arch\r | |
408 | //\r | |
409 | writeReportLn(TAB + "Supported Architectures: " + Tools.convertVectorToString(frid.getArch()));\r | |
410 | \r | |
411 | //\r | |
412 | // Write Help Text\r | |
413 | //\r | |
414 | writeReportLn(TAB + "Help Text: ");\r | |
415 | writeReportLn(TAB + TAB + frid.getHelp());\r | |
416 | \r | |
417 | //\r | |
418 | // Write an empty line\r | |
419 | //\r | |
420 | writeReportLn("");\r | |
421 | \r | |
422 | //\r | |
423 | // Write Instances\r | |
424 | //\r | |
425 | writeReportLn("Library Instances:");\r | |
426 | \r | |
427 | //\r | |
428 | // Write Instances One by One\r | |
429 | //\r | |
430 | for (int index = 0; index < frid.getProducedModules().size(); index++) {\r | |
431 | ModuleIdentification mid = frid.getProducedModules().get(index);\r | |
432 | ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);\r | |
433 | if (msa != null) {\r | |
434 | //\r | |
435 | // Write Instance Name\r | |
436 | //\r | |
437 | if (msa.getMsaHeader() != null) {\r | |
438 | writeReportLn(TAB + msa.getMsaHeader().getModuleName());\r | |
439 | }\r | |
440 | \r | |
441 | //\r | |
442 | // Write Msa File Name\r | |
443 | //\r | |
444 | writeReportLn(TAB + TAB + "Provided by: "\r | |
445 | + Tools.getRelativePath(mid.getPath(), Workspace.getCurrentWorkspace()));\r | |
446 | \r | |
447 | //\r | |
448 | // Find the produced library class\r | |
449 | //\r | |
450 | if (msa.getLibraryClassDefinitions() != null) {\r | |
451 | for (int indexL = 0; indexL < msa.getLibraryClassDefinitions().getLibraryClassList().size(); indexL++) {\r | |
452 | LibraryClass lc = msa.getLibraryClassDefinitions().getLibraryClassList().get(indexL);\r | |
453 | if (lc.getKeyword().equals(name)) {\r | |
454 | //\r | |
455 | // Write Supported Module Types\r | |
456 | //\r | |
457 | writeReportLn(TAB + TAB + "Supported Module Types: "\r | |
458 | + Tools.convertListToString(lc.getSupModuleList()));\r | |
459 | \r | |
460 | //\r | |
461 | // Write Supported Arch\r | |
462 | //\r | |
463 | writeReportLn(TAB + TAB + "Supported Architectures: "\r | |
464 | + Tools.convertListToString(lc.getSupArchList()));\r | |
465 | \r | |
466 | //\r | |
467 | // Write Help Text\r | |
468 | //\r | |
469 | writeReportLn(TAB + TAB + "Help Text: ");\r | |
470 | writeReportLn(TAB + TAB + (lc.getHelpText() == null ? "" : lc.getHelpText()));\r | |
471 | }\r | |
472 | }\r | |
473 | }\r | |
474 | \r | |
475 | }\r | |
476 | }\r | |
477 | \r | |
478 | //\r | |
479 | // Write an empty line\r | |
480 | //\r | |
481 | writeReportLn("");\r | |
482 | \r | |
483 | //\r | |
484 | // Write all modules which consumed this library\r | |
485 | //\r | |
486 | writeReportLn("Modules Requiring " + name + ":");\r | |
487 | for (int index = 0; index < frid.getConsumedModules().size(); index++) {\r | |
488 | //\r | |
489 | // Write\r | |
490 | //\r | |
491 | writeReportLn(TAB\r | |
492 | + frid.getConsumedModules().get(index).getName()\r | |
493 | + " ("\r | |
494 | + Tools.getRelativePath(frid.getConsumedModules().get(index).getPath(),\r | |
495 | Workspace.getCurrentWorkspace()) + ")");\r | |
496 | }\r | |
497 | \r | |
498 | //\r | |
499 | // Write an empty line\r | |
500 | //\r | |
501 | writeReportLn("");\r | |
502 | \r | |
503 | //\r | |
504 | // Write platforms using the library class instances\r | |
505 | //\r | |
506 | writeReportLn("Platforms Using " + name + ":");\r | |
507 | \r | |
508 | //\r | |
509 | // Write Instances One by One as Using Platforms\r | |
510 | //\r | |
511 | for (int index = 0; index < frid.getProducedModules().size(); index++) {\r | |
512 | ModuleIdentification mid = frid.getProducedModules().get(index);\r | |
513 | \r | |
514 | //\r | |
515 | // Write Instance Name \r | |
516 | //\r | |
517 | writeReportLn(TAB + mid.getName());\r | |
518 | \r | |
519 | //\r | |
520 | // Go through each platform one by one\r | |
521 | //\r | |
522 | for (int indexOfPlatform = 0; indexOfPlatform < GlobalData.openingPlatformList.size(); indexOfPlatform++) {\r | |
523 | PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)\r | |
524 | .getXmlFpd();\r | |
525 | PlatformIdentification pid = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)\r | |
526 | .getId();\r | |
527 | Vector<ModuleIdentification> vModuleSa = new Vector<ModuleIdentification>();\r | |
528 | if (fpd != null) {\r | |
529 | FrameworkModules fm = fpd.getFrameworkModules();\r | |
530 | if (fm != null) {\r | |
531 | for (int indexOfModule = 0; indexOfModule < fm.getModuleSAList().size(); indexOfModule++) {\r | |
532 | ModuleSA msa = fm.getModuleSAList().get(indexOfModule);\r | |
533 | if (msa != null) {\r | |
534 | Libraries l = msa.getLibraries();\r | |
535 | if (l != null) {\r | |
536 | if (l.getInstanceList() != null) {\r | |
537 | for (int indexOfInstance = 0; indexOfInstance < l.getInstanceList().size(); indexOfInstance++) {\r | |
538 | Instance i = l.getInstanceList().get(indexOfInstance);\r | |
539 | if (mid.equals(i.getModuleGuid(), i.getModuleVersion(), i.getPackageGuid(),\r | |
540 | i.getPackageVersion())) {\r | |
541 | ModuleIdentification moduleSaId = GlobalData\r | |
542 | .findIdByGuidVersion(\r | |
543 | msa\r | |
544 | .getModuleGuid(),\r | |
545 | msa\r | |
546 | .getModuleVersion(),\r | |
547 | msa\r | |
548 | .getPackageGuid(),\r | |
549 | msa\r | |
550 | .getPackageVersion());\r | |
551 | if (moduleSaId != null) {\r | |
552 | vModuleSa.addElement(moduleSaId);\r | |
553 | }\r | |
554 | }\r | |
555 | }\r | |
556 | }\r | |
557 | }\r | |
558 | }\r | |
559 | }\r | |
560 | \r | |
561 | //\r | |
562 | // Get finded moduleSa in this spd\r | |
563 | //\r | |
564 | if (vModuleSa.size() > 0) {\r | |
565 | writeReportLn(TAB + TAB + pid.getName() + " ("\r | |
566 | + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")");\r | |
567 | for (int indexOfModuleSa = 0; indexOfModuleSa < vModuleSa.size(); indexOfModuleSa++) {\r | |
568 | writeReportLn(TAB\r | |
569 | + TAB\r | |
570 | + TAB\r | |
571 | + vModuleSa.elementAt(indexOfModuleSa).getName()\r | |
572 | + " ("\r | |
573 | + Tools.getRelativePath(vModuleSa.elementAt(indexOfModuleSa).getPath(),\r | |
574 | Workspace.getCurrentWorkspace()) + ")");\r | |
575 | }\r | |
576 | }\r | |
577 | }\r | |
578 | }\r | |
579 | }\r | |
580 | writeReportLn("");\r | |
581 | }\r | |
582 | \r | |
583 | return this.reportContent;\r | |
584 | }\r | |
585 | \r | |
586 | /**\r | |
587 | * This method initializes this\r | |
588 | * \r | |
589 | * @return void\r | |
590 | */\r | |
591 | private void init() {\r | |
592 | this.setSize(550, 380);\r | |
593 | this.setContentPane(getJContentPane());\r | |
594 | this.setTitle("JFrame");\r | |
595 | this.setResizable(true);\r | |
596 | this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\r | |
597 | this.centerWindow();\r | |
598 | \r | |
599 | }\r | |
600 | \r | |
601 | /**\r | |
602 | * This method initializes jContentPane\r | |
603 | * \r | |
604 | * @return javax.swing.JPanel\r | |
605 | */\r | |
606 | private JPanel getJContentPane() {\r | |
607 | if (jContentPane == null) {\r | |
608 | jContentPane = new JPanel();\r | |
609 | jContentPane.setLayout(null);\r | |
610 | jContentPane.setSize(new java.awt.Dimension(550, 350));\r | |
611 | jContentPane.add(getJScrollPane(), null);\r | |
612 | jContentPane.add(getJButtonClose(), null);\r | |
613 | \r | |
614 | jContentPane.setPreferredSize(new java.awt.Dimension(550, 340));\r | |
615 | }\r | |
616 | return jContentPane;\r | |
617 | }\r | |
618 | \r | |
619 | /* (non-Javadoc)\r | |
620 | * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r | |
621 | *\r | |
622 | * Override windowClosing to popup warning message to confirm quit\r | |
623 | * \r | |
624 | */\r | |
625 | public void windowClosing(WindowEvent arg0) {\r | |
626 | this.dispose();\r | |
627 | }\r | |
628 | \r | |
629 | /* (non-Javadoc)\r | |
630 | * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)\r | |
631 | * \r | |
632 | * Override componentResized to resize all components when frame's size is changed\r | |
633 | */\r | |
634 | public void componentResized(ComponentEvent arg0) {\r | |
635 | int intCurrentWidth = this.getJContentPane().getWidth();\r | |
636 | int intCurrentHeight = this.getJContentPane().getHeight();\r | |
637 | int intPreferredWidth = this.getJContentPane().getPreferredSize().width;\r | |
638 | int intPreferredHeight = this.getJContentPane().getPreferredSize().height;\r | |
639 | \r | |
640 | Tools.resizeComponent(this.jScrollPane, intCurrentWidth, intCurrentHeight, intPreferredWidth,\r | |
641 | intPreferredHeight);\r | |
642 | Tools.centerComponent(this.jButtonClose, intCurrentWidth, intCurrentHeight, intPreferredHeight,\r | |
643 | DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);\r | |
644 | }\r | |
645 | \r | |
646 | /* (non-Javadoc)\r | |
647 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r | |
648 | *\r | |
649 | */\r | |
650 | public void actionPerformed(ActionEvent arg0) {\r | |
651 | if (arg0.getSource() == this.jButtonClose) {\r | |
652 | this.dispose();\r | |
653 | }\r | |
654 | }\r | |
655 | \r | |
656 | private void writeReportLn(String line) {\r | |
657 | this.reportContent = this.reportContent + line + DataType.LINE_SEPARATOR;\r | |
658 | }\r | |
659 | }\r |