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 |
fc87d0ba |
289 | .findModuleId(\r |
290 | msa.getModuleGuid(),\r |
291 | msa\r |
292 | .getModuleVersion(),\r |
293 | msa.getPackageGuid(),\r |
294 | msa\r |
295 | .getPackageVersion());\r |
d12f87d3 |
296 | tmp = tmp\r |
297 | + TAB\r |
298 | + TAB\r |
299 | + "Module: "\r |
300 | + moduleSaId.getName()\r |
301 | + " ("\r |
302 | + Tools.getRelativePath(moduleSaId.getPath(),\r |
303 | Workspace.getCurrentWorkspace()) + ")"\r |
304 | + DataType.UNIX_LINE_SEPARATOR;\r |
305 | tmp = tmp + TAB + TAB + TAB + "Implementation: " + pd.getItemType().toString()\r |
306 | + DataType.UNIX_LINE_SEPARATOR;\r |
307 | tmp = tmp + TAB + TAB + TAB + "Specified / Implementation Value: "\r |
308 | + pd.getValue() + DataType.UNIX_LINE_SEPARATOR;\r |
309 | tmp = tmp + DataType.UNIX_LINE_SEPARATOR;\r |
310 | }\r |
311 | }\r |
312 | }\r |
313 | }\r |
314 | }\r |
315 | }\r |
316 | }\r |
317 | \r |
318 | //\r |
319 | // Get Dynamic Pcd\r |
320 | //\r |
321 | DynamicPcdBuildDefinitions dpbd = fpd.getDynamicPcdBuildDefinitions();\r |
322 | if (dpbd != null) {\r |
323 | for (int indexOfDpbd = 0; indexOfDpbd < dpbd.getPcdBuildDataList().size(); indexOfDpbd++) {\r |
324 | PcdBuildData pbd = dpbd.getPcdBuildDataList().get(indexOfDpbd);\r |
325 | if (pbd != null) {\r |
326 | if (pbd.getCName().equals(name)) {\r |
327 | //\r |
328 | // Write Dynamic Pcd Build Definition\r |
329 | //\r |
330 | tmp = tmp + TAB + TAB + "Dynamic Pcd Build Definition: " + DataType.UNIX_LINE_SEPARATOR;\r |
331 | if (pbd.getSkuInfoList() != null) {\r |
332 | for (int indexOfPcd = 0; indexOfPcd < pbd.getSkuInfoList().size(); indexOfPcd++) {\r |
333 | SkuInfo si = pbd.getSkuInfoList().get(indexOfPcd);\r |
334 | if (si != null) {\r |
335 | tmp = tmp + TAB + TAB + TAB + "Sku Id: " + si.getSkuId().toString()\r |
336 | + DataType.UNIX_LINE_SEPARATOR;\r |
337 | tmp = tmp + TAB + TAB + TAB + "Variable Name: " + si.getVariableName()\r |
338 | + DataType.UNIX_LINE_SEPARATOR;\r |
339 | tmp = tmp + TAB + TAB + TAB + "Variable GUID: " + si.getVariableGuid()\r |
340 | + DataType.UNIX_LINE_SEPARATOR;\r |
341 | tmp = tmp + TAB + TAB + TAB + "Variable Offset: " + si.getVariableOffset()\r |
342 | + DataType.UNIX_LINE_SEPARATOR;\r |
343 | tmp = tmp + TAB + TAB + TAB + "Hii Default Value: " + si.getHiiDefaultValue()\r |
344 | + DataType.UNIX_LINE_SEPARATOR;\r |
345 | }\r |
346 | }\r |
347 | }\r |
348 | }\r |
349 | }\r |
350 | }\r |
351 | }\r |
352 | \r |
353 | //\r |
354 | // If not empty, write this platform info\r |
355 | //\r |
356 | if (!Tools.isEmpty(tmp)) {\r |
357 | tmp = TAB + "Platform: " + pid.getName() + " ("\r |
358 | + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")"\r |
359 | + DataType.UNIX_LINE_SEPARATOR + tmp;\r |
360 | this.writeReportLn(tmp);\r |
361 | }\r |
362 | }\r |
363 | \r |
364 | return reportContent;\r |
365 | }\r |
366 | \r |
367 | //\r |
368 | // Create detailed information report for library\r |
369 | // \r |
370 | /**\r |
371 | \r |
372 | @param frid\r |
373 | @return\r |
374 | \r |
375 | **/\r |
419558bb |
376 | private String createReport(FindResultId frid) {\r |
377 | String tmp = "";\r |
378 | String name = frid.getName();\r |
379 | \r |
380 | //\r |
381 | // Write Class Name\r |
382 | //\r |
383 | writeReportLn(name);\r |
384 | \r |
385 | //\r |
386 | // Write Provided Package\r |
387 | //\r |
388 | writeReportLn(TAB + "Provided by: " + frid.getDeclaredBy().getName() + " ("\r |
389 | + Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace()) + ")");\r |
390 | \r |
391 | //\r |
392 | // Write Header File\r |
393 | //\r |
394 | PackageSurfaceArea spd = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(frid.getDeclaredBy());\r |
395 | tmp = Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace());\r |
396 | writeReportLn(TAB + "Header File: " + Tools.getFilePathOnly(tmp)\r |
397 | + wt.getHeaderFileFromPackageByLibraryClassName(spd, name));\r |
398 | \r |
399 | //\r |
400 | // Write Supported Module Types\r |
401 | //\r |
402 | writeReportLn(TAB + "Supported Module Types: " + Tools.convertVectorToString(frid.getModuleType()));\r |
403 | \r |
404 | //\r |
405 | // Write Supported Arch\r |
406 | //\r |
407 | writeReportLn(TAB + "Supported Architectures: " + Tools.convertVectorToString(frid.getArch()));\r |
408 | \r |
409 | //\r |
410 | // Write Help Text\r |
411 | //\r |
412 | writeReportLn(TAB + "Help Text: ");\r |
413 | writeReportLn(TAB + TAB + frid.getHelp());\r |
414 | \r |
415 | //\r |
416 | // Write an empty line\r |
417 | //\r |
418 | writeReportLn("");\r |
419 | \r |
420 | //\r |
421 | // Write Instances\r |
422 | //\r |
423 | writeReportLn("Library Instances:");\r |
424 | \r |
425 | //\r |
426 | // Write Instances One by One\r |
427 | //\r |
428 | for (int index = 0; index < frid.getProducedModules().size(); index++) {\r |
429 | ModuleIdentification mid = frid.getProducedModules().get(index);\r |
430 | ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);\r |
431 | if (msa != null) {\r |
432 | //\r |
433 | // Write Instance Name\r |
434 | //\r |
435 | if (msa.getMsaHeader() != null) {\r |
436 | writeReportLn(TAB + msa.getMsaHeader().getModuleName());\r |
437 | }\r |
438 | \r |
439 | //\r |
440 | // Write Msa File Name\r |
441 | //\r |
442 | writeReportLn(TAB + TAB + "Provided by: "\r |
443 | + Tools.getRelativePath(mid.getPath(), Workspace.getCurrentWorkspace()));\r |
444 | \r |
445 | //\r |
446 | // Find the produced library class\r |
447 | //\r |
448 | if (msa.getLibraryClassDefinitions() != null) {\r |
449 | for (int indexL = 0; indexL < msa.getLibraryClassDefinitions().getLibraryClassList().size(); indexL++) {\r |
450 | LibraryClass lc = msa.getLibraryClassDefinitions().getLibraryClassList().get(indexL);\r |
451 | if (lc.getKeyword().equals(name)) {\r |
452 | //\r |
453 | // Write Supported Module Types\r |
454 | //\r |
455 | writeReportLn(TAB + TAB + "Supported Module Types: "\r |
456 | + Tools.convertListToString(lc.getSupModuleList()));\r |
457 | \r |
458 | //\r |
459 | // Write Supported Arch\r |
460 | //\r |
461 | writeReportLn(TAB + TAB + "Supported Architectures: "\r |
462 | + Tools.convertListToString(lc.getSupArchList()));\r |
463 | \r |
464 | //\r |
465 | // Write Help Text\r |
466 | //\r |
467 | writeReportLn(TAB + TAB + "Help Text: ");\r |
468 | writeReportLn(TAB + TAB + (lc.getHelpText() == null ? "" : lc.getHelpText()));\r |
469 | }\r |
470 | }\r |
471 | }\r |
472 | \r |
473 | }\r |
474 | }\r |
475 | \r |
476 | //\r |
477 | // Write an empty line\r |
478 | //\r |
479 | writeReportLn("");\r |
480 | \r |
481 | //\r |
482 | // Write all modules which consumed this library\r |
483 | //\r |
484 | writeReportLn("Modules Requiring " + name + ":");\r |
485 | for (int index = 0; index < frid.getConsumedModules().size(); index++) {\r |
486 | //\r |
487 | // Write\r |
488 | //\r |
489 | writeReportLn(TAB\r |
490 | + frid.getConsumedModules().get(index).getName()\r |
491 | + " ("\r |
492 | + Tools.getRelativePath(frid.getConsumedModules().get(index).getPath(),\r |
493 | Workspace.getCurrentWorkspace()) + ")");\r |
494 | }\r |
495 | \r |
496 | //\r |
497 | // Write an empty line\r |
498 | //\r |
499 | writeReportLn("");\r |
500 | \r |
501 | //\r |
502 | // Write platforms using the library class instances\r |
503 | //\r |
504 | writeReportLn("Platforms Using " + name + ":");\r |
505 | \r |
506 | //\r |
507 | // Write Instances One by One as Using Platforms\r |
508 | //\r |
509 | for (int index = 0; index < frid.getProducedModules().size(); index++) {\r |
510 | ModuleIdentification mid = frid.getProducedModules().get(index);\r |
511 | \r |
512 | //\r |
513 | // Write Instance Name \r |
514 | //\r |
515 | writeReportLn(TAB + mid.getName());\r |
516 | \r |
517 | //\r |
518 | // Go through each platform one by one\r |
519 | //\r |
520 | for (int indexOfPlatform = 0; indexOfPlatform < GlobalData.openingPlatformList.size(); indexOfPlatform++) {\r |
521 | PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)\r |
522 | .getXmlFpd();\r |
523 | PlatformIdentification pid = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)\r |
524 | .getId();\r |
525 | Vector<ModuleIdentification> vModuleSa = new Vector<ModuleIdentification>();\r |
526 | if (fpd != null) {\r |
527 | FrameworkModules fm = fpd.getFrameworkModules();\r |
528 | if (fm != null) {\r |
529 | for (int indexOfModule = 0; indexOfModule < fm.getModuleSAList().size(); indexOfModule++) {\r |
530 | ModuleSA msa = fm.getModuleSAList().get(indexOfModule);\r |
531 | if (msa != null) {\r |
532 | Libraries l = msa.getLibraries();\r |
533 | if (l != null) {\r |
534 | if (l.getInstanceList() != null) {\r |
535 | for (int indexOfInstance = 0; indexOfInstance < l.getInstanceList().size(); indexOfInstance++) {\r |
536 | Instance i = l.getInstanceList().get(indexOfInstance);\r |
537 | if (mid.equals(i.getModuleGuid(), i.getModuleVersion(), i.getPackageGuid(),\r |
538 | i.getPackageVersion())) {\r |
539 | ModuleIdentification moduleSaId = GlobalData\r |
fc87d0ba |
540 | .findModuleId(\r |
541 | msa\r |
542 | .getModuleGuid(),\r |
543 | msa\r |
544 | .getModuleVersion(),\r |
545 | msa\r |
546 | .getPackageGuid(),\r |
547 | msa\r |
548 | .getPackageVersion());\r |
419558bb |
549 | if (moduleSaId != null) {\r |
550 | vModuleSa.addElement(moduleSaId);\r |
551 | }\r |
552 | }\r |
553 | }\r |
554 | }\r |
555 | }\r |
556 | }\r |
557 | }\r |
558 | \r |
559 | //\r |
560 | // Get finded moduleSa in this spd\r |
561 | //\r |
562 | if (vModuleSa.size() > 0) {\r |
563 | writeReportLn(TAB + TAB + pid.getName() + " ("\r |
564 | + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")");\r |
565 | for (int indexOfModuleSa = 0; indexOfModuleSa < vModuleSa.size(); indexOfModuleSa++) {\r |
566 | writeReportLn(TAB\r |
567 | + TAB\r |
568 | + TAB\r |
569 | + vModuleSa.elementAt(indexOfModuleSa).getName()\r |
570 | + " ("\r |
571 | + Tools.getRelativePath(vModuleSa.elementAt(indexOfModuleSa).getPath(),\r |
572 | Workspace.getCurrentWorkspace()) + ")");\r |
573 | }\r |
574 | }\r |
575 | }\r |
576 | }\r |
577 | }\r |
578 | writeReportLn("");\r |
579 | }\r |
580 | \r |
581 | return this.reportContent;\r |
582 | }\r |
583 | \r |
584 | /**\r |
585 | * This method initializes this\r |
586 | * \r |
587 | * @return void\r |
588 | */\r |
589 | private void init() {\r |
590 | this.setSize(550, 380);\r |
591 | this.setContentPane(getJContentPane());\r |
592 | this.setTitle("JFrame");\r |
593 | this.setResizable(true);\r |
594 | this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);\r |
595 | this.centerWindow();\r |
596 | \r |
597 | }\r |
598 | \r |
599 | /**\r |
600 | * This method initializes jContentPane\r |
601 | * \r |
602 | * @return javax.swing.JPanel\r |
603 | */\r |
604 | private JPanel getJContentPane() {\r |
605 | if (jContentPane == null) {\r |
606 | jContentPane = new JPanel();\r |
607 | jContentPane.setLayout(null);\r |
608 | jContentPane.setSize(new java.awt.Dimension(550, 350));\r |
609 | jContentPane.add(getJScrollPane(), null);\r |
610 | jContentPane.add(getJButtonClose(), null);\r |
611 | \r |
612 | jContentPane.setPreferredSize(new java.awt.Dimension(550, 340));\r |
613 | }\r |
614 | return jContentPane;\r |
615 | }\r |
616 | \r |
617 | /* (non-Javadoc)\r |
618 | * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r |
619 | *\r |
620 | * Override windowClosing to popup warning message to confirm quit\r |
621 | * \r |
622 | */\r |
623 | public void windowClosing(WindowEvent arg0) {\r |
624 | this.dispose();\r |
625 | }\r |
626 | \r |
627 | /* (non-Javadoc)\r |
628 | * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)\r |
629 | * \r |
630 | * Override componentResized to resize all components when frame's size is changed\r |
631 | */\r |
632 | public void componentResized(ComponentEvent arg0) {\r |
633 | int intCurrentWidth = this.getJContentPane().getWidth();\r |
634 | int intCurrentHeight = this.getJContentPane().getHeight();\r |
635 | int intPreferredWidth = this.getJContentPane().getPreferredSize().width;\r |
636 | int intPreferredHeight = this.getJContentPane().getPreferredSize().height;\r |
637 | \r |
638 | Tools.resizeComponent(this.jScrollPane, intCurrentWidth, intCurrentHeight, intPreferredWidth,\r |
639 | intPreferredHeight);\r |
640 | Tools.centerComponent(this.jButtonClose, intCurrentWidth, intCurrentHeight, intPreferredHeight,\r |
641 | DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);\r |
642 | }\r |
643 | \r |
644 | /* (non-Javadoc)\r |
645 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r |
646 | *\r |
647 | */\r |
648 | public void actionPerformed(ActionEvent arg0) {\r |
649 | if (arg0.getSource() == this.jButtonClose) {\r |
650 | this.dispose();\r |
651 | }\r |
652 | }\r |
653 | \r |
654 | private void writeReportLn(String line) {\r |
655 | this.reportContent = this.reportContent + line + DataType.LINE_SEPARATOR;\r |
656 | }\r |
657 | }\r |