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
= 6;
111 private final int modVerColForFpdModTable
= 5;
113 private final int typeColForFpdModTable
= 4;
116 * FpdFileContents structure
118 private final int ffcModGuid
= 0;
120 private final int ffcModVer
= 1;
122 private final int ffcPkgGuid
= 2;
124 private final int ffcPkgVer
= 3;
126 private final int ffcModArch
= 4;
129 * Set Column Widths, Only the PATH should not have a max width.
131 private final int modNameMinWidth
= 168;
133 private final int modNamePrefWidth
= 200;
135 private final int modNameMaxWidth
= 350;
137 private final int pkgNameMinWidth
= 100;
139 private final int pkgNamePrefWidth
= 130;
141 private final int pkgNameMaxWidth
= 150;
143 private final int verMinWidth
= 60;
145 private final int verMaxWidth
= 80;
147 private final int verPrefWidth
= 70;
149 private final int pathPrefWidth
= 320;
151 private final int pathMinWidth
= 280;
153 private final int archPrefWidth
= 80;
155 private final int archMinWidth
= 60;
157 private final int archMaxWidth
= 100;
159 private final int typePrefWidth
= 145;
161 private final int typeMinWidth
= 100;
163 private final int typeMaxWidth
= 155;
166 * This method initializes jSplitPane
168 * This is the main edit window
170 * @return javax.swing.JSplitPane jSplitPane
172 private JSplitPane
getJSplitPane() {
173 if (jSplitPane
== null) {
174 jSplitPane
= new JSplitPane();
175 jSplitPane
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
176 jSplitPane
.setDividerLocation(250);
177 jSplitPane
.setBottomComponent(getJPanelBottom());
178 jSplitPane
.setTopComponent(getJPanelTop());
184 * This method initializes jPanelTop
186 * This panel contains the All Modules Table
188 * @return javax.swing.JPanel jPanelTop
190 private JPanel
getJPanelTop() {
191 if (jPanelTop
== null) {
192 jLabel
= new JLabel();
193 jLabel
.setText("Modules in Workspace");
194 jPanelTop
= new JPanel();
195 jPanelTop
.setLayout(new BorderLayout());
196 jPanelTop
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
197 jPanelTop
.add(getJScrollPaneAllModules(), java
.awt
.BorderLayout
.CENTER
);
198 jPanelTop
.add(getJPanelTopSouth(), java
.awt
.BorderLayout
.SOUTH
);
204 * This method initializes jPanelBottom
206 * This panel contains the FPD Modules Table
208 * @return javax.swing.JPanel jPanelBottom
210 private JPanel
getJPanelBottom() {
211 if (jPanelBottom
== null) {
212 jLabelModulesAdded
= new JLabel();
213 jLabelModulesAdded
.setText("Modules Added");
214 jPanelBottom
= new JPanel();
215 jPanelBottom
.setLayout(new BorderLayout());
216 jPanelBottom
.add(jLabelModulesAdded
, java
.awt
.BorderLayout
.NORTH
);
217 jPanelBottom
.add(getJPanelBottomSouth(), java
.awt
.BorderLayout
.SOUTH
);
218 jPanelBottom
.add(getJScrollPaneFpdModules(), java
.awt
.BorderLayout
.CENTER
);
224 * This method initializes jScrollPaneAllModules
226 * @return javax.swing.JScrollPane jScrollPaneAllModules
228 private JScrollPane
getJScrollPaneAllModules() {
229 if (jScrollPaneAllModules
== null) {
230 jScrollPaneAllModules
= new JScrollPane();
231 jScrollPaneAllModules
.setPreferredSize(new java
.awt
.Dimension(600, 200));
232 jScrollPaneAllModules
.setViewportView(getJTableAllModules());
234 return jScrollPaneAllModules
;
238 * This method initializes jTableAllModules
240 * @return javax.swing.JTable jTableAllModules
242 private JTable
getJTableAllModules() {
243 if (jTableAllModules
== null) {
244 modelAllModules
= new NonEditableTableModel();
245 TableSorter sorter
= new TableSorter(modelAllModules
);
246 jTableAllModules
= new JTable(sorter
);
247 sorter
.setTableHeader(jTableAllModules
.getTableHeader());
248 jTableAllModules
.setRowHeight(20);
249 modelAllModules
.addColumn("<html>Module<br>Name</html>");
250 modelAllModules
.addColumn("<html>Package<br>Name</html>");
251 modelAllModules
.addColumn("Path");
252 modelAllModules
.addColumn("<html>Module<br>Type</html>");
253 modelAllModules
.addColumn("<html>Module<br>Version</html>");
254 modelAllModules
.addColumn("<html>Package<br>Version</html>");
256 javax
.swing
.table
.TableColumn column
= null;
257 column
= jTableAllModules
.getColumnModel().getColumn(modNameColForAllModTable
);
258 column
.setPreferredWidth(modNamePrefWidth
);
259 column
.setMinWidth(modNameMinWidth
);
260 column
.setMaxWidth(modNameMaxWidth
);
261 column
= jTableAllModules
.getColumnModel().getColumn(modVerColForAllModTable
);
262 column
.setPreferredWidth(verPrefWidth
);
263 column
.setMaxWidth(verMaxWidth
);
264 column
.setMinWidth(verMinWidth
);
265 column
= jTableAllModules
.getColumnModel().getColumn(pkgNameColForAllModTable
);
266 column
.setPreferredWidth(pkgNamePrefWidth
);
267 column
.setMinWidth(pkgNameMinWidth
);
268 column
.setMaxWidth(pkgNameMaxWidth
);
269 column
= jTableAllModules
.getColumnModel().getColumn(pkgVerColForAllModTable
);
270 column
.setPreferredWidth(verPrefWidth
);
271 column
.setMaxWidth(verMaxWidth
);
272 column
.setMinWidth(verMinWidth
);
273 column
= jTableAllModules
.getColumnModel().getColumn(typeColForAllModTable
);
274 column
.setPreferredWidth(typePrefWidth
);
275 column
.setMaxWidth(typeMaxWidth
);
276 column
.setMinWidth(typeMinWidth
);
277 column
= jTableAllModules
.getColumnModel().getColumn(pathColForAllModTable
);
278 column
.setPreferredWidth(pathPrefWidth
);
279 column
.setMinWidth(pathMinWidth
);
281 jTableAllModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
284 return jTableAllModules
;
288 * This method initializes jPanelTopSouth
290 * This panel contains the ADD button
292 * @return javax.swing.JPanel jPanelTopSouth
294 private JPanel
getJPanelTopSouth() {
295 if (jPanelTopSouth
== null) {
296 FlowLayout flowLayout
= new FlowLayout();
297 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
298 jPanelTopSouth
= new JPanel();
299 jPanelTopSouth
.setLayout(flowLayout
);
300 jPanelTopSouth
.add(getJButtonAddModule(), null);
302 return jPanelTopSouth
;
306 * This method initializes jButtonAddModule
308 * @return javax.swing.JButton jButtonAddModule
310 private JButton
getJButtonAddModule() {
311 if (jButtonAddModule
== null) {
312 jButtonAddModule
= new JButton();
313 jButtonAddModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
314 jButtonAddModule
.setText("Add a Module");
315 jButtonAddModule
.addActionListener(new java
.awt
.event
.ActionListener() {
316 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
317 int selectedRow
= jTableAllModules
.getSelectedRow();
318 if (selectedRow
< 0) {
322 TableSorter sorter
= (TableSorter
) jTableAllModules
.getModel();
323 selectedRow
= sorter
.modelIndex(selectedRow
);
324 String path
= modelAllModules
.getValueAt(selectedRow
, pathColForAllModTable
) + "";
325 ModuleIdentification mi
= miList
.get(selectedRow
);
326 Vector
<String
> vArchs
= null;
328 vArchs
= GlobalData
.getModuleSupArchs(mi
);
330 catch (Exception exp
) {
331 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
334 if (vArchs
== null) {
335 JOptionPane
.showMessageDialog(frame
, "No Supported Architectures specified in MSA file.");
339 String archsAdded
= "";
340 String mg
= mi
.getGuid();
341 String mv
= mi
.getVersion();
342 String pg
= mi
.getPackage().getGuid();
343 String pv
= mi
.getPackage().getVersion();
344 String mType
= mi
.getModuleType();
346 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
348 al
= new ArrayList
<String
>();
349 fpdMsa
.put(mg
+ mv
+ pg
+ pv
, al
);
351 for (int i
= 0; i
< al
.size(); ++i
) {
352 vArchs
.remove(al
.get(i
));
355 // Archs this Module supported have already been added.
357 if (vArchs
.size() == 0) {
358 JOptionPane
.showMessageDialog(frame
, "This Module has already been added.");
361 //ToDo put Arch instead of null
362 boolean errorOccurred
= false;
363 for (int i
= 0; i
< vArchs
.size(); ++i
) {
364 String arch
= vArchs
.get(i
);
366 archsAdded
+= arch
+ " ";
367 String
[] row
= { "", "", "", "", "", "", "" };
370 row
[modNameColForFpdModTable
] = mi
.getName();
371 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
372 row
[pathColForFpdModTable
] = path
;
373 row
[archColForFpdModTable
] = arch
;
374 row
[pkgVerColForFpdModTable
] = pv
;
375 row
[modVerColForFpdModTable
] = mv
;
376 row
[typeColForFpdModTable
] = mType
;
379 modelFpdModules
.addRow(row
);
381 docConsole
.setSaved(false);
383 //ToDo : specify archs need to add.
384 ffc
.addFrameworkModulesPcdBuildDefs(mi
, arch
, null);
385 } catch (Exception exception
) {
386 JOptionPane
.showMessageDialog(frame
, "Adding " + row
[modNameColForFpdModTable
] + " with Supporting Architectures: " + arch
387 + ": " + exception
.getMessage());
388 errorOccurred
= true;
392 String s
= "This Module with Architecture " + archsAdded
;
394 s
+= " was added with Error. Platform may NOT Build.";
396 s
+= " was added Successfully.";
398 JOptionPane
.showMessageDialog(frame
, s
);
399 jTableFpdModules
.changeSelection(modelFpdModules
.getRowCount() - 1, 0, false, false);
403 return jButtonAddModule
;
407 * This method initializes jPanelBottomSouth
409 * This panel contains the Settings and Remove Buttons
411 * @return javax.swing.JPanel jPanelBottomSouth
413 private JPanel
getJPanelBottomSouth() {
414 if (jPanelBottomSouth
== null) {
415 FlowLayout flowLayout1
= new FlowLayout();
416 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
417 jPanelBottomSouth
= new JPanel();
418 jPanelBottomSouth
.setLayout(flowLayout1
);
419 jPanelBottomSouth
.add(getJButtonSettings(), null);
420 jPanelBottomSouth
.add(getJButtonRemoveModule(), null);
422 return jPanelBottomSouth
;
426 * This method initializes jScrollPaneFpdModules
428 * @return javax.swing.JScrollPane jScrollPaneFpdModules
430 private JScrollPane
getJScrollPaneFpdModules() {
431 if (jScrollPaneFpdModules
== null) {
432 jScrollPaneFpdModules
= new JScrollPane();
433 jScrollPaneFpdModules
.setPreferredSize(new java
.awt
.Dimension(453, 200));
434 jScrollPaneFpdModules
.setViewportView(getJTableFpdModules());
436 return jScrollPaneFpdModules
;
440 * This method initializes jTableFpdModules
442 * @return javax.swing.JTable jTableFpdModules
444 private JTable
getJTableFpdModules() {
445 if (jTableFpdModules
== null) {
446 modelFpdModules
= new NonEditableTableModel();
447 TableSorter sorter
= new TableSorter(modelFpdModules
);
448 jTableFpdModules
= new JTable(sorter
);
449 sorter
.setTableHeader(jTableFpdModules
.getTableHeader());
450 jTableFpdModules
.setRowHeight(20);
451 modelFpdModules
.addColumn("<html>Module<br>Name</html>");
452 modelFpdModules
.addColumn("<html>Package<br>Name</html>");
453 modelFpdModules
.addColumn("Path");
454 modelFpdModules
.addColumn("<html>Supported<br>Architectures</html>");
455 modelFpdModules
.addColumn("<html>Module<br>Type</html>");
456 modelFpdModules
.addColumn("<html>Module<br>Version</html>");
457 modelFpdModules
.addColumn("<html>Package<br>Version</html>");
460 javax
.swing
.table
.TableColumn column
= null;
461 column
= jTableFpdModules
.getColumnModel().getColumn(modNameColForFpdModTable
);
462 column
.setPreferredWidth(modNamePrefWidth
);
463 column
.setMinWidth(modNameMinWidth
);
464 column
.setMaxWidth(modNameMaxWidth
);
465 column
= jTableFpdModules
.getColumnModel().getColumn(modVerColForFpdModTable
);
466 column
.setPreferredWidth(verPrefWidth
);
467 column
.setMaxWidth(verMaxWidth
);
468 column
.setMinWidth(verMinWidth
);
469 column
= jTableFpdModules
.getColumnModel().getColumn(pkgNameColForFpdModTable
);
470 column
.setPreferredWidth(pkgNamePrefWidth
);
471 column
.setMinWidth(pkgNameMinWidth
);
472 column
.setMaxWidth(pkgNameMaxWidth
);
473 column
= jTableFpdModules
.getColumnModel().getColumn(pkgVerColForFpdModTable
);
474 column
.setPreferredWidth(verPrefWidth
);
475 column
.setMaxWidth(verMaxWidth
);
476 column
.setMinWidth(verMinWidth
);
477 column
= jTableFpdModules
.getColumnModel().getColumn(archColForFpdModTable
);
478 column
.setPreferredWidth(archPrefWidth
);
479 column
.setMaxWidth(archMaxWidth
);
480 column
.setMinWidth(archMinWidth
);
481 column
= jTableFpdModules
.getColumnModel().getColumn(pathColForFpdModTable
);
482 column
.setPreferredWidth(pathPrefWidth
);
483 column
.setMinWidth(pathMinWidth
);
484 column
= jTableFpdModules
.getColumnModel().getColumn(typeColForFpdModTable
);
485 column
.setPreferredWidth(typePrefWidth
);
486 column
.setMaxWidth(typeMaxWidth
);
487 column
.setMinWidth(typeMinWidth
);
489 jTableFpdModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
492 return jTableFpdModules
;
496 * This method initializes jButtonSettings
498 * @return javax.swing.JButton jButtonSettings
500 private JButton
getJButtonSettings() {
501 if (jButtonSettings
== null) {
502 jButtonSettings
= new JButton();
503 jButtonSettings
.setPreferredSize(new java
.awt
.Dimension(130,20));
504 jButtonSettings
.setText("Settings");
505 jButtonSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
506 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
507 int selectedRow
= jTableFpdModules
.getSelectedRow();
508 if (selectedRow
< 0) {
512 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
513 selectedRow
= sorter
.modelIndex(selectedRow
);
515 if (ffc
.adjustPcd(selectedRow
)) {
516 docConsole
.setSaved(false);
519 catch (Exception exp
) {
520 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
524 if (settingDlg
== null) {
525 settingDlg
= new FpdModuleSA(ffc
);
528 String
[] sa
= new String
[5];
529 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
530 String mg
= sa
[ffcModGuid
];
531 String mv
= sa
[ffcModVer
];
532 String pg
= sa
[ffcPkgGuid
];
533 String pv
= sa
[ffcPkgVer
];
534 String arch
= sa
[ffcModArch
];
535 settingDlg
.setKey(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
, selectedRow
, docConsole
);
536 settingDlg
.setVisible(true);
540 return jButtonSettings
;
544 * This method initializes jButtonRemoveModule
546 * @return javax.swing.JButton jButtonRemoveModule
548 private JButton
getJButtonRemoveModule() {
549 if (jButtonRemoveModule
== null) {
550 jButtonRemoveModule
= new JButton();
551 jButtonRemoveModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
552 jButtonRemoveModule
.setText("Remove Module");
553 jButtonRemoveModule
.addActionListener(new java
.awt
.event
.ActionListener() {
554 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
555 int selectedRow
= jTableFpdModules
.getSelectedRow();
556 if (selectedRow
< 0) {
560 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
561 selectedRow
= sorter
.modelIndex(selectedRow
);
563 String
[] sa
= new String
[5];
564 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
565 String mg
= sa
[ffcModGuid
];
566 String mv
= sa
[ffcModVer
];
567 String pg
= sa
[ffcPkgGuid
];
568 String pv
= sa
[ffcPkgVer
];
569 String arch
= sa
[ffcModArch
];
570 ModuleIdentification mi
= GlobalData
.getModuleId(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
);
571 mv
= mi
.getVersion();
572 pv
= mi
.getPackage().getVersion();
573 modelFpdModules
.removeRow(selectedRow
);
575 // if no arch specified in ModuleSA
576 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
578 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
580 if (al
.size() == 0) {
581 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
585 docConsole
.setSaved(false);
586 ffc
.removeModuleSA(selectedRow
);
590 return jButtonRemoveModule
;
597 public static void main(String
[] args
) {
598 // Set the pane visable
599 new FpdFrameworkModules().setVisible(true);
603 * This is the default constructor
605 public FpdFrameworkModules() {
610 public FpdFrameworkModules(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
616 public FpdFrameworkModules(OpeningPlatformType opt
) {
617 this(opt
.getXmlFpd());
621 private void init(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
623 GlobalData
.initInfo("Tools" + File
.separator
+ "Conf" + File
.separator
+ "FrameworkDatabase.db", System
.getenv("WORKSPACE"));
626 JOptionPane
.showMessageDialog(frame
, "Error occurred when getting module data.");
630 ffc
= new FpdFileContents(fpd
);
634 if (fpdMsa
== null) {
635 fpdMsa
= new HashMap
<String
, ArrayList
<String
>>();
638 if (ffc
.getFrameworkModulesCount() > 0) {
639 String
[][] saa
= new String
[ffc
.getFrameworkModulesCount()][5];
640 ffc
.getFrameworkModulesInfo(saa
);
641 for (int i
= 0; i
< saa
.length
; ++i
) {
642 ModuleIdentification mi
= GlobalData
.getModuleId(saa
[i
][ffcModGuid
] + " " + saa
[i
][ffcModVer
] + " "
643 + saa
[i
][ffcPkgGuid
] + " " + saa
[i
][ffcPkgVer
]);
644 String
[] row
= { "", "", "", "", "", "", "" };
646 row
[modNameColForFpdModTable
] = mi
.getName();
647 row
[modVerColForFpdModTable
] = mi
.getVersion();
648 row
[typeColForFpdModTable
] = mi
.getModuleType();
649 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
650 row
[pkgVerColForFpdModTable
] = mi
.getPackage().getVersion();
651 row
[archColForFpdModTable
] = saa
[i
][4];
653 row
[pathColForFpdModTable
] = GlobalData
.getMsaFile(mi
).getPath().substring(
654 System
.getenv("WORKSPACE")
656 } catch (Exception e
) {
657 JOptionPane
.showMessageDialog(frame
, "Show FPD Modules:" + e
.getMessage());
660 modelFpdModules
.addRow(row
);
661 ArrayList
<String
> al
= fpdMsa
.get(saa
[i
][ffcModGuid
] + saa
[i
][ffcModVer
]
662 + saa
[i
][ffcPkgGuid
] + saa
[i
][ffcPkgVer
]);
664 al
= new ArrayList
<String
>();
665 fpdMsa
.put(saa
[i
][ffcModGuid
] + saa
[i
][ffcModVer
] + saa
[i
][ffcPkgGuid
] + saa
[i
][ffcPkgVer
], al
);
667 al
.add(saa
[i
][ffcModArch
]);
670 TableSorter sorter
= (TableSorter
)jTableFpdModules
.getModel();
671 sorter
.setSortingStatus(modNameColForFpdModTable
, TableSorter
.ASCENDING
);
678 private void showAllModules() {
680 if (miList
== null) {
681 miList
= new ArrayList
<ModuleIdentification
>();
683 Set
<PackageIdentification
> spi
= GlobalData
.getPackageList();
684 Iterator ispi
= spi
.iterator();
686 while (ispi
.hasNext()) {
687 PackageIdentification pi
= (PackageIdentification
) ispi
.next();
688 String
[] s
= { "", "", "", "", "", "" };
690 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(pi
);
691 Iterator ismi
= smi
.iterator();
692 while (ismi
.hasNext()) {
693 ModuleIdentification mi
= (ModuleIdentification
) ismi
.next();
694 s
[modNameColForAllModTable
] = mi
.getName();
695 s
[modVerColForAllModTable
] = mi
.getVersion();
696 s
[typeColForAllModTable
] = mi
.getModuleType();
697 s
[pkgNameColForAllModTable
] = pi
.getName();
698 s
[pkgVerColForAllModTable
] = pi
.getVersion();
700 s
[pathColForAllModTable
] = GlobalData
.getMsaFile(mi
).getPath()
701 .substring(System
.getenv("WORKSPACE").length() + 1);
702 } catch (Exception e
) {
703 JOptionPane
.showMessageDialog(frame
, "Show All Modules:" + e
.getMessage());
705 modelAllModules
.addRow(s
);
710 TableSorter sorter
= (TableSorter
)jTableAllModules
.getModel();
711 sorter
.setSortingStatus(modNameColForAllModTable
, TableSorter
.ASCENDING
);
715 * This method initializes this
719 private void initialize() {
720 this.setSize(633, 533);
721 this.setTitle("Framework Modules");
722 this.setContentPane(getJSplitPane());
723 this.setVisible(true);
727 } // @jve:decl-index=0:visual-constraint="10,10"
729 class NonEditableTableModel
extends DefaultTableModel
{
733 private static final long serialVersionUID
= 1L;
735 public boolean isCellEditable(int row
, int col
) {