1 package org
.tianocore
.frameworkwizard
.platform
.ui
;
3 import java
.awt
.BorderLayout
;
5 import javax
.swing
.JFrame
;
6 import javax
.swing
.JOptionPane
;
7 import javax
.swing
.JPanel
;
8 import javax
.swing
.JSplitPane
;
9 import javax
.swing
.JLabel
;
10 import javax
.swing
.JScrollPane
;
11 import javax
.swing
.JTable
;
12 import javax
.swing
.JButton
;
13 import javax
.swing
.ListSelectionModel
;
14 import javax
.swing
.table
.DefaultTableModel
;
16 import org
.tianocore
.PlatformSurfaceAreaDocument
;
17 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
18 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
19 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.GlobalData
;
20 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.ModuleIdentification
;
21 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.PackageIdentification
;
23 import java
.awt
.FlowLayout
;
25 import java
.util
.ArrayList
;
26 import java
.util
.HashMap
;
27 import java
.util
.Iterator
;
30 import java
.util
.Vector
;
32 public class FpdFrameworkModules
extends IInternalFrame
{
37 private static final long serialVersionUID
= 1L;
41 private JSplitPane jSplitPane
= null;
43 private JPanel jPanelTop
= null;
45 private JPanel jPanelBottom
= null;
47 private JLabel jLabel
= null;
49 private JScrollPane jScrollPaneAllModules
= null;
51 private JTable jTableAllModules
= null;
53 private JPanel jPanelTopSouth
= null;
55 private JButton jButtonAddModule
= null;
57 private JLabel jLabelModulesAdded
= null;
59 private JPanel jPanelBottomSouth
= null;
61 private JScrollPane jScrollPaneFpdModules
= null;
63 private JTable jTableFpdModules
= null;
65 private JButton jButtonSettings
= null;
67 private JButton jButtonRemoveModule
= null;
69 private NonEditableTableModel modelAllModules
= null;
71 private NonEditableTableModel modelFpdModules
= null;
73 private FpdModuleSA settingDlg
= null;
75 private FpdFileContents ffc
= null;
77 private OpeningPlatformType docConsole
= null;
79 private Map
<String
, ArrayList
<String
>> fpdMsa
= null;
81 private ArrayList
<ModuleIdentification
> miList
= null;
84 * Column settings for displaying all modules in workspace
86 private final int modNameColForAllModTable
= 0;
88 private final int pkgNameColForAllModTable
= 1;
90 private final int pathColForAllModTable
= 2;
92 private final int typeColForAllModTable
= 3;
94 private final int pkgVerColForAllModTable
= 5;
96 private final int modVerColForAllModTable
= 4;
99 * Column settings for display modules in the FPD file
101 private final int modNameColForFpdModTable
= 0;
103 private final int pkgNameColForFpdModTable
= 1;
105 private final int pathColForFpdModTable
= 2;
107 private final int archColForFpdModTable
= 3;
109 private final int pkgVerColForFpdModTable
= 5;
111 private final int modVerColForFpdModTable
= 4;
114 * FpdFileContents structure
116 private final int ffcModGuid
= 0;
118 private final int ffcModVer
= 1;
120 private final int ffcPkgGuid
= 2;
122 private final int ffcPkgVer
= 3;
124 private final int ffcModArch
= 4;
127 * Set Column Widths, Only the PATH should not have a max width.
129 private final int modNameMinWidth
= 168;
131 private final int modNamePrefWidth
= 200;
133 private final int modNameMaxWidth
= 350;
135 private final int pkgNameMinWidth
= 100;
137 private final int pkgNamePrefWidth
= 130;
139 private final int pkgNameMaxWidth
= 150;
141 private final int verMinWidth
= 60;
143 private final int verMaxWidth
= 80;
145 private final int verPrefWidth
= 70;
147 private final int pathPrefWidth
= 320;
149 private final int pathMinWidth
= 280;
151 private final int archPrefWidth
= 80;
153 private final int archMinWidth
= 60;
155 private final int archMaxWidth
= 100;
157 private final int typePrefWidth
= 145;
159 private final int typeMinWidth
= 100;
161 private final int typeMaxWidth
= 155;
164 * This method initializes jSplitPane
166 * This is the main edit window
168 * @return javax.swing.JSplitPane jSplitPane
170 private JSplitPane
getJSplitPane() {
171 if (jSplitPane
== null) {
172 jSplitPane
= new JSplitPane();
173 jSplitPane
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
174 jSplitPane
.setDividerLocation(250);
175 jSplitPane
.setBottomComponent(getJPanelBottom());
176 jSplitPane
.setTopComponent(getJPanelTop());
182 * This method initializes jPanelTop
184 * This panel contains the All Modules Table
186 * @return javax.swing.JPanel jPanelTop
188 private JPanel
getJPanelTop() {
189 if (jPanelTop
== null) {
190 jLabel
= new JLabel();
191 jLabel
.setText("Modules in Workspace");
192 jPanelTop
= new JPanel();
193 jPanelTop
.setLayout(new BorderLayout());
194 jPanelTop
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
195 jPanelTop
.add(getJScrollPaneAllModules(), java
.awt
.BorderLayout
.CENTER
);
196 jPanelTop
.add(getJPanelTopSouth(), java
.awt
.BorderLayout
.SOUTH
);
202 * This method initializes jPanelBottom
204 * This panel contains the FPD Modules Table
206 * @return javax.swing.JPanel jPanelBottom
208 private JPanel
getJPanelBottom() {
209 if (jPanelBottom
== null) {
210 jLabelModulesAdded
= new JLabel();
211 jLabelModulesAdded
.setText("Modules Added");
212 jPanelBottom
= new JPanel();
213 jPanelBottom
.setLayout(new BorderLayout());
214 jPanelBottom
.add(jLabelModulesAdded
, java
.awt
.BorderLayout
.NORTH
);
215 jPanelBottom
.add(getJPanelBottomSouth(), java
.awt
.BorderLayout
.SOUTH
);
216 jPanelBottom
.add(getJScrollPaneFpdModules(), java
.awt
.BorderLayout
.CENTER
);
222 * This method initializes jScrollPaneAllModules
224 * @return javax.swing.JScrollPane jScrollPaneAllModules
226 private JScrollPane
getJScrollPaneAllModules() {
227 if (jScrollPaneAllModules
== null) {
228 jScrollPaneAllModules
= new JScrollPane();
229 jScrollPaneAllModules
.setPreferredSize(new java
.awt
.Dimension(600, 200));
230 jScrollPaneAllModules
.setViewportView(getJTableAllModules());
232 return jScrollPaneAllModules
;
236 * This method initializes jTableAllModules
238 * @return javax.swing.JTable jTableAllModules
240 private JTable
getJTableAllModules() {
241 if (jTableAllModules
== null) {
242 modelAllModules
= new NonEditableTableModel();
243 TableSorter sorter
= new TableSorter(modelAllModules
);
244 jTableAllModules
= new JTable(sorter
);
245 sorter
.setTableHeader(jTableAllModules
.getTableHeader());
246 jTableAllModules
.setRowHeight(20);
247 modelAllModules
.addColumn("<html>Module<br>Name</html>");
248 modelAllModules
.addColumn("<html>Package<br>Name</html>");
249 modelAllModules
.addColumn("Path");
250 modelAllModules
.addColumn("<html>Module<br>Type</html>");
251 modelAllModules
.addColumn("<html>Module<br>Version</html>");
252 modelAllModules
.addColumn("<html>Package<br>Version</html>");
254 javax
.swing
.table
.TableColumn column
= null;
255 column
= jTableAllModules
.getColumnModel().getColumn(modNameColForAllModTable
);
256 column
.setPreferredWidth(modNamePrefWidth
);
257 column
.setMinWidth(modNameMinWidth
);
258 column
.setMaxWidth(modNameMaxWidth
);
259 column
= jTableAllModules
.getColumnModel().getColumn(modVerColForAllModTable
);
260 column
.setPreferredWidth(verPrefWidth
);
261 column
.setMaxWidth(verMaxWidth
);
262 column
.setMinWidth(verMinWidth
);
263 column
= jTableAllModules
.getColumnModel().getColumn(pkgNameColForAllModTable
);
264 column
.setPreferredWidth(pkgNamePrefWidth
);
265 column
.setMinWidth(pkgNameMinWidth
);
266 column
.setMaxWidth(pkgNameMaxWidth
);
267 column
= jTableAllModules
.getColumnModel().getColumn(pkgVerColForAllModTable
);
268 column
.setPreferredWidth(verPrefWidth
);
269 column
.setMaxWidth(verMaxWidth
);
270 column
.setMinWidth(verMinWidth
);
271 column
= jTableAllModules
.getColumnModel().getColumn(typeColForAllModTable
);
272 column
.setPreferredWidth(typePrefWidth
);
273 column
.setMaxWidth(typeMaxWidth
);
274 column
.setMinWidth(typeMinWidth
);
275 column
= jTableAllModules
.getColumnModel().getColumn(pathColForAllModTable
);
276 column
.setPreferredWidth(pathPrefWidth
);
277 column
.setMinWidth(pathMinWidth
);
279 jTableAllModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
280 jTableAllModules
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
282 return jTableAllModules
;
286 * This method initializes jPanelTopSouth
288 * This panel contains the ADD button
290 * @return javax.swing.JPanel jPanelTopSouth
292 private JPanel
getJPanelTopSouth() {
293 if (jPanelTopSouth
== null) {
294 FlowLayout flowLayout
= new FlowLayout();
295 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
296 jPanelTopSouth
= new JPanel();
297 jPanelTopSouth
.setLayout(flowLayout
);
298 jPanelTopSouth
.add(getJButtonAddModule(), null);
300 return jPanelTopSouth
;
304 * This method initializes jButtonAddModule
306 * @return javax.swing.JButton jButtonAddModule
308 private JButton
getJButtonAddModule() {
309 if (jButtonAddModule
== null) {
310 jButtonAddModule
= new JButton();
311 jButtonAddModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
312 jButtonAddModule
.setText("Add a Module");
313 jButtonAddModule
.addActionListener(new java
.awt
.event
.ActionListener() {
314 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
315 int selectedRow
= jTableAllModules
.getSelectedRow();
316 if (selectedRow
< 0) {
320 TableSorter sorter
= (TableSorter
) jTableAllModules
.getModel();
321 selectedRow
= sorter
.modelIndex(selectedRow
);
322 String path
= modelAllModules
.getValueAt(selectedRow
, pathColForAllModTable
) + "";
323 ModuleIdentification mi
= miList
.get(selectedRow
);
324 Vector
<String
> vArchs
= null;
326 vArchs
= GlobalData
.getModuleSupArchs(mi
);
328 catch (Exception exp
) {
329 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
332 if (vArchs
== null) {
333 JOptionPane
.showMessageDialog(frame
, "No Supported Architectures specified in MSA file.");
337 String archsAdded
= "";
338 String mg
= mi
.getGuid();
339 String mv
= mi
.getVersion();
340 String pg
= mi
.getPackage().getGuid();
341 String pv
= mi
.getPackage().getVersion();
343 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
345 al
= new ArrayList
<String
>();
346 fpdMsa
.put(mg
+ mv
+ pg
+ pv
, al
);
348 for (int i
= 0; i
< al
.size(); ++i
) {
349 vArchs
.remove(al
.get(i
));
352 // Archs this Module supported have already been added.
354 if (vArchs
.size() == 0) {
355 JOptionPane
.showMessageDialog(frame
, "This Module has already been added.");
358 //ToDo put Arch instead of null
359 boolean errorOccurred
= false;
360 for (int i
= 0; i
< vArchs
.size(); ++i
) {
361 String arch
= vArchs
.get(i
);
363 archsAdded
+= arch
+ " ";
364 String
[] row
= { "", "", "", "", "", "" };
367 row
[modNameColForFpdModTable
] = mi
.getName();
368 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
369 row
[pathColForFpdModTable
] = path
;
370 row
[archColForFpdModTable
] = arch
;
371 row
[pkgVerColForFpdModTable
] = pv
;
372 row
[modVerColForFpdModTable
] = mv
;
375 modelFpdModules
.addRow(row
);
377 docConsole
.setSaved(false);
379 //ToDo : specify archs need to add.
380 ffc
.addFrameworkModulesPcdBuildDefs(mi
, arch
, null);
381 } catch (Exception exception
) {
382 JOptionPane
.showMessageDialog(frame
, "Adding " + row
[modNameColForFpdModTable
] + " with SupArch " + arch
383 + ": " + exception
.getMessage());
384 errorOccurred
= true;
388 String s
= "This Module with Architecture " + archsAdded
;
390 s
+= " was added with Error. Platform may NOT Build.";
392 s
+= " was added Successfully.";
394 JOptionPane
.showMessageDialog(frame
, s
);
395 jTableFpdModules
.changeSelection(modelFpdModules
.getRowCount() - 1, 0, false, false);
399 return jButtonAddModule
;
403 * This method initializes jPanelBottomSouth
405 * This panel contains the Settings and Remove Buttons
407 * @return javax.swing.JPanel jPanelBottomSouth
409 private JPanel
getJPanelBottomSouth() {
410 if (jPanelBottomSouth
== null) {
411 FlowLayout flowLayout1
= new FlowLayout();
412 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
413 jPanelBottomSouth
= new JPanel();
414 jPanelBottomSouth
.setLayout(flowLayout1
);
415 jPanelBottomSouth
.add(getJButtonSettings(), null);
416 jPanelBottomSouth
.add(getJButtonRemoveModule(), null);
418 return jPanelBottomSouth
;
422 * This method initializes jScrollPaneFpdModules
424 * @return javax.swing.JScrollPane jScrollPaneFpdModules
426 private JScrollPane
getJScrollPaneFpdModules() {
427 if (jScrollPaneFpdModules
== null) {
428 jScrollPaneFpdModules
= new JScrollPane();
429 jScrollPaneFpdModules
.setPreferredSize(new java
.awt
.Dimension(453, 200));
430 jScrollPaneFpdModules
.setViewportView(getJTableFpdModules());
432 return jScrollPaneFpdModules
;
436 * This method initializes jTableFpdModules
438 * @return javax.swing.JTable jTableFpdModules
440 private JTable
getJTableFpdModules() {
441 if (jTableFpdModules
== null) {
442 modelFpdModules
= new NonEditableTableModel();
443 TableSorter sorter
= new TableSorter(modelFpdModules
);
444 jTableFpdModules
= new JTable(sorter
);
445 sorter
.setTableHeader(jTableFpdModules
.getTableHeader());
446 jTableFpdModules
.setRowHeight(20);
447 modelFpdModules
.addColumn("<html>Module<br>Name</html>");
448 modelFpdModules
.addColumn("<html>Package<br>Name</html>");
449 modelFpdModules
.addColumn("Path");
450 modelFpdModules
.addColumn("<html>Supported<br>Architectures</html>");
451 modelFpdModules
.addColumn("<html>Module<br>Version</html>");
452 modelFpdModules
.addColumn("<html>Package<br>Version</html>");
454 javax
.swing
.table
.TableColumn column
= null;
455 column
= jTableFpdModules
.getColumnModel().getColumn(modNameColForFpdModTable
);
456 column
.setPreferredWidth(modNamePrefWidth
);
457 column
.setMinWidth(modNameMinWidth
);
458 column
.setMaxWidth(modNameMaxWidth
);
459 column
= jTableFpdModules
.getColumnModel().getColumn(modVerColForFpdModTable
);
460 column
.setPreferredWidth(verPrefWidth
);
461 column
.setMaxWidth(verMaxWidth
);
462 column
.setMinWidth(verMinWidth
);
463 column
= jTableFpdModules
.getColumnModel().getColumn(pkgNameColForFpdModTable
);
464 column
.setPreferredWidth(pkgNamePrefWidth
);
465 column
.setMinWidth(pkgNameMinWidth
);
466 column
.setMaxWidth(pkgNameMaxWidth
);
467 column
= jTableFpdModules
.getColumnModel().getColumn(pkgVerColForFpdModTable
);
468 column
.setPreferredWidth(verPrefWidth
);
469 column
.setMaxWidth(verMaxWidth
);
470 column
.setMinWidth(verMinWidth
);
471 column
= jTableFpdModules
.getColumnModel().getColumn(archColForFpdModTable
);
472 column
.setPreferredWidth(archPrefWidth
);
473 column
.setMaxWidth(archMaxWidth
);
474 column
.setMinWidth(archMinWidth
);
475 column
= jTableFpdModules
.getColumnModel().getColumn(pathColForFpdModTable
);
476 column
.setPreferredWidth(pathPrefWidth
);
477 column
.setMinWidth(pathMinWidth
);
479 jTableFpdModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
480 jTableFpdModules
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
482 return jTableFpdModules
;
486 * This method initializes jButtonSettings
488 * @return javax.swing.JButton jButtonSettings
490 private JButton
getJButtonSettings() {
491 if (jButtonSettings
== null) {
492 jButtonSettings
= new JButton();
493 jButtonSettings
.setPreferredSize(new java
.awt
.Dimension(130,20));
494 jButtonSettings
.setText("Settings");
495 jButtonSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
496 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
497 int selectedRow
= jTableFpdModules
.getSelectedRow();
498 if (selectedRow
< 0) {
502 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
503 selectedRow
= sorter
.modelIndex(selectedRow
);
505 if (ffc
.adjustPcd(selectedRow
)) {
506 docConsole
.setSaved(false);
509 catch (Exception exp
) {
510 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
514 if (settingDlg
== null) {
515 settingDlg
= new FpdModuleSA(ffc
);
518 String
[] sa
= new String
[5];
519 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
520 String mg
= sa
[ffcModGuid
];
521 String mv
= sa
[ffcModVer
];
522 String pg
= sa
[ffcPkgGuid
];
523 String pv
= sa
[ffcPkgVer
];
524 String arch
= sa
[ffcModArch
];
525 settingDlg
.setKey(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
, selectedRow
, docConsole
);
526 settingDlg
.setVisible(true);
530 return jButtonSettings
;
534 * This method initializes jButtonRemoveModule
536 * @return javax.swing.JButton jButtonRemoveModule
538 private JButton
getJButtonRemoveModule() {
539 if (jButtonRemoveModule
== null) {
540 jButtonRemoveModule
= new JButton();
541 jButtonRemoveModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
542 jButtonRemoveModule
.setText("Remove Module");
543 jButtonRemoveModule
.addActionListener(new java
.awt
.event
.ActionListener() {
544 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
545 int selectedRow
= jTableFpdModules
.getSelectedRow();
546 if (selectedRow
< 0) {
550 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
551 selectedRow
= sorter
.modelIndex(selectedRow
);
553 String
[] sa
= new String
[5];
554 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
555 String mg
= sa
[ffcModGuid
];
556 String mv
= sa
[ffcModVer
];
557 String pg
= sa
[ffcPkgGuid
];
558 String pv
= sa
[ffcPkgVer
];
559 String arch
= sa
[ffcModArch
];
560 ModuleIdentification mi
= GlobalData
.getModuleId(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
);
561 mv
= mi
.getVersion();
562 pv
= mi
.getPackage().getVersion();
563 modelFpdModules
.removeRow(selectedRow
);
565 // if no arch specified in ModuleSA
566 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
568 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
570 if (al
.size() == 0) {
571 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
575 docConsole
.setSaved(false);
576 ffc
.removeModuleSA(selectedRow
);
580 return jButtonRemoveModule
;
587 public static void main(String
[] args
) {
588 // TODO Auto-generated method stub
589 new FpdFrameworkModules().setVisible(true);
593 * This is the default constructor
595 public FpdFrameworkModules() {
600 public FpdFrameworkModules(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
606 public FpdFrameworkModules(OpeningPlatformType opt
) {
607 this(opt
.getXmlFpd());
611 private void init(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
613 GlobalData
.initInfo("Tools" + File
.separator
+ "Conf" + File
.separator
+ "FrameworkDatabase.db", System
.getenv("WORKSPACE"));
616 JOptionPane
.showMessageDialog(frame
, "Error occurred when getting module data.");
620 ffc
= new FpdFileContents(fpd
);
624 if (fpdMsa
== null) {
625 fpdMsa
= new HashMap
<String
, ArrayList
<String
>>();
628 if (ffc
.getFrameworkModulesCount() > 0) {
629 String
[][] saa
= new String
[ffc
.getFrameworkModulesCount()][5];
630 ffc
.getFrameworkModulesInfo(saa
);
631 for (int i
= 0; i
< saa
.length
; ++i
) {
632 ModuleIdentification mi
= GlobalData
.getModuleId(saa
[i
][ffcModGuid
] + " " + saa
[i
][ffcModVer
] + " "
633 + saa
[i
][ffcPkgGuid
] + " " + saa
[i
][ffcPkgVer
]);
634 String
[] row
= { "", "", "", "", "", "" };
636 row
[modNameColForFpdModTable
] = mi
.getName();
637 row
[modVerColForFpdModTable
] = mi
.getVersion();
638 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
639 row
[pkgVerColForFpdModTable
] = mi
.getPackage().getVersion();
640 row
[archColForFpdModTable
] = saa
[i
][4];
642 row
[pathColForFpdModTable
] = GlobalData
.getMsaFile(mi
).getPath().substring(
643 System
.getenv("WORKSPACE")
645 } catch (Exception e
) {
646 JOptionPane
.showMessageDialog(frame
, "Show FPD Modules:" + e
.getMessage());
649 modelFpdModules
.addRow(row
);
650 ArrayList
<String
> al
= fpdMsa
.get(saa
[i
][ffcModGuid
] + saa
[i
][ffcModVer
]
651 + saa
[i
][ffcPkgGuid
] + saa
[i
][ffcPkgVer
]);
653 al
= new ArrayList
<String
>();
654 fpdMsa
.put(saa
[i
][ffcModGuid
] + saa
[i
][ffcModVer
] + saa
[i
][ffcPkgGuid
] + saa
[i
][ffcPkgVer
], al
);
656 al
.add(saa
[i
][ffcModArch
]);
659 TableSorter sorter
= (TableSorter
)jTableFpdModules
.getModel();
660 sorter
.setSortingStatus(modNameColForFpdModTable
, TableSorter
.ASCENDING
);
667 private void showAllModules() {
669 if (miList
== null) {
670 miList
= new ArrayList
<ModuleIdentification
>();
672 Set
<PackageIdentification
> spi
= GlobalData
.getPackageList();
673 Iterator ispi
= spi
.iterator();
675 while (ispi
.hasNext()) {
676 PackageIdentification pi
= (PackageIdentification
) ispi
.next();
677 String
[] s
= { "", "", "", "", "", "" };
679 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(pi
);
680 Iterator ismi
= smi
.iterator();
681 while (ismi
.hasNext()) {
682 ModuleIdentification mi
= (ModuleIdentification
) ismi
.next();
683 s
[modNameColForAllModTable
] = mi
.getName();
684 s
[modVerColForAllModTable
] = mi
.getVersion();
685 s
[typeColForAllModTable
] = mi
.getModuleType();
686 s
[pkgNameColForAllModTable
] = pi
.getName();
687 s
[pkgVerColForAllModTable
] = pi
.getVersion();
689 s
[pathColForAllModTable
] = GlobalData
.getMsaFile(mi
).getPath()
690 .substring(System
.getenv("WORKSPACE").length() + 1);
691 } catch (Exception e
) {
692 JOptionPane
.showMessageDialog(frame
, "Show All Modules:" + e
.getMessage());
694 modelAllModules
.addRow(s
);
699 TableSorter sorter
= (TableSorter
)jTableAllModules
.getModel();
700 sorter
.setSortingStatus(modNameColForAllModTable
, TableSorter
.ASCENDING
);
704 * This method initializes this
708 private void initialize() {
709 this.setSize(633, 533);
710 this.setTitle("Framework Modules");
711 this.setContentPane(getJSplitPane());
712 this.setVisible(true);
716 } // @jve:decl-index=0:visual-constraint="10,10"
718 class NonEditableTableModel
extends DefaultTableModel
{
722 private static final long serialVersionUID
= 1L;
724 public boolean isCellEditable(int row
, int col
) {