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
= 600;
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
);
282 jTableAllModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
285 return jTableAllModules
;
289 * This method initializes jPanelTopSouth
291 * This panel contains the ADD button
293 * @return javax.swing.JPanel jPanelTopSouth
295 private JPanel
getJPanelTopSouth() {
296 if (jPanelTopSouth
== null) {
297 FlowLayout flowLayout
= new FlowLayout();
298 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
299 jPanelTopSouth
= new JPanel();
300 jPanelTopSouth
.setLayout(flowLayout
);
301 jPanelTopSouth
.add(getJButtonAddModule(), null);
303 return jPanelTopSouth
;
307 * This method initializes jButtonAddModule
309 * @return javax.swing.JButton jButtonAddModule
311 private JButton
getJButtonAddModule() {
312 if (jButtonAddModule
== null) {
313 jButtonAddModule
= new JButton();
314 jButtonAddModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
315 jButtonAddModule
.setText("Add a Module");
316 jButtonAddModule
.addActionListener(new java
.awt
.event
.ActionListener() {
317 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
318 int selectedRow
= jTableAllModules
.getSelectedRow();
319 if (selectedRow
< 0) {
323 TableSorter sorter
= (TableSorter
) jTableAllModules
.getModel();
324 selectedRow
= sorter
.modelIndex(selectedRow
);
325 String path
= modelAllModules
.getValueAt(selectedRow
, pathColForAllModTable
) + "";
326 ModuleIdentification mi
= miList
.get(selectedRow
);
327 Vector
<String
> vArchs
= null;
329 vArchs
= GlobalData
.getModuleSupArchs(mi
);
331 catch (Exception exp
) {
332 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
335 if (vArchs
== null) {
336 JOptionPane
.showMessageDialog(frame
, "No Supported Architectures specified in MSA file.");
340 String archsAdded
= "";
341 String mg
= mi
.getGuid();
342 String mv
= mi
.getVersion();
343 String pg
= mi
.getPackage().getGuid();
344 String pv
= mi
.getPackage().getVersion();
345 String mType
= mi
.getModuleType();
347 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
350 // if existing ModuleSA does not specify version info.
352 al
= fpdMsa
.get(mg
+ "null" + pg
+ "null");
354 al
= fpdMsa
.get(mg
+ "null" + pg
+ pv
);
356 al
= fpdMsa
.get(mg
+ mv
+ pg
+ "null");
358 al
= new ArrayList
<String
>();
359 fpdMsa
.put(mg
+ mv
+ pg
+ pv
, al
);
365 // filter from module SupArchs what archs has been added.
367 for (int i
= 0; i
< al
.size(); ++i
) {
368 vArchs
.remove(al
.get(i
));
371 // check whether archs conform to SupArch of platform.
373 Vector
<Object
> platformSupArch
= new Vector
<Object
>();
374 ffc
.getPlatformDefsSupportedArchs(platformSupArch
);
375 vArchs
.retainAll(platformSupArch
);
377 // Archs this Module supported have already been added.
379 if (vArchs
.size() == 0) {
380 JOptionPane
.showMessageDialog(frame
, "This Module has already been added.");
383 //ToDo put Arch instead of null
384 boolean errorOccurred
= false;
385 for (int i
= 0; i
< vArchs
.size(); ++i
) {
386 String arch
= vArchs
.get(i
);
388 archsAdded
+= arch
+ " ";
389 String
[] row
= { "", "", "", "", "", "", "" };
392 row
[modNameColForFpdModTable
] = mi
.getName();
393 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
394 row
[pathColForFpdModTable
] = path
;
395 row
[archColForFpdModTable
] = arch
;
396 row
[pkgVerColForFpdModTable
] = pv
;
397 row
[modVerColForFpdModTable
] = mv
;
398 row
[typeColForFpdModTable
] = mType
;
401 modelFpdModules
.addRow(row
);
403 docConsole
.setSaved(false);
405 //ToDo : specify archs need to add.
406 ffc
.addFrameworkModulesPcdBuildDefs(mi
, arch
, null);
407 } catch (Exception exception
) {
408 JOptionPane
.showMessageDialog(frame
, "Adding " + row
[modNameColForFpdModTable
] + " with Supporting Architectures: " + arch
409 + ": " + exception
.getMessage());
410 errorOccurred
= true;
414 String s
= "This Module with Architecture " + archsAdded
;
416 s
+= " was added with Error. Platform may NOT Build.";
418 s
+= " was added Successfully.";
420 JOptionPane
.showMessageDialog(frame
, s
);
421 jTableFpdModules
.changeSelection(modelFpdModules
.getRowCount() - 1, 0, false, false);
425 return jButtonAddModule
;
429 * This method initializes jPanelBottomSouth
431 * This panel contains the Settings and Remove Buttons
433 * @return javax.swing.JPanel jPanelBottomSouth
435 private JPanel
getJPanelBottomSouth() {
436 if (jPanelBottomSouth
== null) {
437 FlowLayout flowLayout1
= new FlowLayout();
438 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
439 jPanelBottomSouth
= new JPanel();
440 jPanelBottomSouth
.setLayout(flowLayout1
);
441 jPanelBottomSouth
.add(getJButtonSettings(), null);
442 jPanelBottomSouth
.add(getJButtonRemoveModule(), null);
444 return jPanelBottomSouth
;
448 * This method initializes jScrollPaneFpdModules
450 * @return javax.swing.JScrollPane jScrollPaneFpdModules
452 private JScrollPane
getJScrollPaneFpdModules() {
453 if (jScrollPaneFpdModules
== null) {
454 jScrollPaneFpdModules
= new JScrollPane();
455 jScrollPaneFpdModules
.setPreferredSize(new java
.awt
.Dimension(453, 200));
456 jScrollPaneFpdModules
.setViewportView(getJTableFpdModules());
458 return jScrollPaneFpdModules
;
462 * This method initializes jTableFpdModules
464 * @return javax.swing.JTable jTableFpdModules
466 private JTable
getJTableFpdModules() {
467 if (jTableFpdModules
== null) {
468 modelFpdModules
= new NonEditableTableModel();
469 TableSorter sorter
= new TableSorter(modelFpdModules
);
470 jTableFpdModules
= new JTable(sorter
);
471 sorter
.setTableHeader(jTableFpdModules
.getTableHeader());
472 jTableFpdModules
.setRowHeight(20);
473 modelFpdModules
.addColumn("<html>Module<br>Name</html>");
474 modelFpdModules
.addColumn("<html>Package<br>Name</html>");
475 modelFpdModules
.addColumn("Path");
476 modelFpdModules
.addColumn("<html>Supported<br>Architectures</html>");
477 modelFpdModules
.addColumn("<html>Module<br>Type</html>");
478 modelFpdModules
.addColumn("<html>Module<br>Version</html>");
479 modelFpdModules
.addColumn("<html>Package<br>Version</html>");
482 javax
.swing
.table
.TableColumn column
= null;
483 column
= jTableFpdModules
.getColumnModel().getColumn(modNameColForFpdModTable
);
484 column
.setPreferredWidth(modNamePrefWidth
);
485 column
.setMinWidth(modNameMinWidth
);
486 column
.setMaxWidth(modNameMaxWidth
);
487 column
= jTableFpdModules
.getColumnModel().getColumn(modVerColForFpdModTable
);
488 column
.setPreferredWidth(verPrefWidth
);
489 column
.setMaxWidth(verMaxWidth
);
490 column
.setMinWidth(verMinWidth
);
491 column
= jTableFpdModules
.getColumnModel().getColumn(pkgNameColForFpdModTable
);
492 column
.setPreferredWidth(pkgNamePrefWidth
);
493 column
.setMinWidth(pkgNameMinWidth
);
494 column
.setMaxWidth(pkgNameMaxWidth
);
495 column
= jTableFpdModules
.getColumnModel().getColumn(pkgVerColForFpdModTable
);
496 column
.setPreferredWidth(verPrefWidth
);
497 column
.setMaxWidth(verMaxWidth
);
498 column
.setMinWidth(verMinWidth
);
499 column
= jTableFpdModules
.getColumnModel().getColumn(archColForFpdModTable
);
500 column
.setPreferredWidth(archPrefWidth
);
501 column
.setMaxWidth(archMaxWidth
);
502 column
.setMinWidth(archMinWidth
);
503 column
= jTableFpdModules
.getColumnModel().getColumn(pathColForFpdModTable
);
504 column
.setPreferredWidth(pathPrefWidth
);
505 column
.setMinWidth(pathMinWidth
);
506 column
= jTableFpdModules
.getColumnModel().getColumn(typeColForFpdModTable
);
507 column
.setPreferredWidth(typePrefWidth
);
508 column
.setMaxWidth(typeMaxWidth
);
509 column
.setMinWidth(typeMinWidth
);
511 jTableFpdModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
512 jTableFpdModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
515 return jTableFpdModules
;
519 * This method initializes jButtonSettings
521 * @return javax.swing.JButton jButtonSettings
523 private JButton
getJButtonSettings() {
524 if (jButtonSettings
== null) {
525 jButtonSettings
= new JButton();
526 jButtonSettings
.setPreferredSize(new java
.awt
.Dimension(130,20));
527 jButtonSettings
.setText("Settings");
528 jButtonSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
529 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
530 int selectedRow
= jTableFpdModules
.getSelectedRow();
531 if (selectedRow
< 0) {
535 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
536 selectedRow
= sorter
.modelIndex(selectedRow
);
538 if (ffc
.adjustPcd(selectedRow
)) {
539 docConsole
.setSaved(false);
542 catch (Exception exp
) {
543 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
547 if (settingDlg
== null) {
548 settingDlg
= new FpdModuleSA(ffc
);
551 String
[] sa
= new String
[5];
552 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
553 String mg
= sa
[ffcModGuid
];
554 String mv
= sa
[ffcModVer
];
555 String pg
= sa
[ffcPkgGuid
];
556 String pv
= sa
[ffcPkgVer
];
557 String arch
= sa
[ffcModArch
];
558 settingDlg
.setKey(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
, selectedRow
, docConsole
);
559 settingDlg
.setVisible(true);
563 return jButtonSettings
;
567 * This method initializes jButtonRemoveModule
569 * @return javax.swing.JButton jButtonRemoveModule
571 private JButton
getJButtonRemoveModule() {
572 if (jButtonRemoveModule
== null) {
573 jButtonRemoveModule
= new JButton();
574 jButtonRemoveModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
575 jButtonRemoveModule
.setText("Remove Module");
576 jButtonRemoveModule
.addActionListener(new java
.awt
.event
.ActionListener() {
577 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
578 int selectedRow
= jTableFpdModules
.getSelectedRow();
579 if (selectedRow
< 0) {
583 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
584 selectedRow
= sorter
.modelIndex(selectedRow
);
586 String
[] sa
= new String
[5];
587 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
588 String mg
= sa
[ffcModGuid
];
589 String mv
= sa
[ffcModVer
];
590 String pg
= sa
[ffcPkgGuid
];
591 String pv
= sa
[ffcPkgVer
];
592 String arch
= sa
[ffcModArch
];
593 ModuleIdentification mi
= GlobalData
.getModuleId(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
);
594 mv
= mi
.getVersion();
595 pv
= mi
.getPackage().getVersion();
596 modelFpdModules
.removeRow(selectedRow
);
598 // if no arch specified in ModuleSA
599 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
602 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
604 if (al
.size() == 0) {
605 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
609 docConsole
.setSaved(false);
610 ffc
.removeModuleSA(selectedRow
);
614 return jButtonRemoveModule
;
621 public static void main(String
[] args
) {
622 // Set the pane visable
623 new FpdFrameworkModules().setVisible(true);
627 * This is the default constructor
629 public FpdFrameworkModules() {
634 public FpdFrameworkModules(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
640 public FpdFrameworkModules(OpeningPlatformType opt
) {
641 this(opt
.getXmlFpd());
645 private void init(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
647 GlobalData
.initInfo("Tools" + File
.separator
+ "Conf" + File
.separator
+ "FrameworkDatabase.db", System
.getenv("WORKSPACE"));
650 JOptionPane
.showMessageDialog(frame
, "Error occurred when getting module data.");
654 ffc
= new FpdFileContents(fpd
);
658 if (fpdMsa
== null) {
659 fpdMsa
= new HashMap
<String
, ArrayList
<String
>>();
662 if (ffc
.getFrameworkModulesCount() > 0) {
663 String
[][] saa
= new String
[ffc
.getFrameworkModulesCount()][5];
664 ffc
.getFrameworkModulesInfo(saa
);
665 for (int i
= 0; i
< saa
.length
; ++i
) {
666 ModuleIdentification mi
= GlobalData
.getModuleId(saa
[i
][ffcModGuid
] + " " + saa
[i
][ffcModVer
] + " "
667 + saa
[i
][ffcPkgGuid
] + " " + saa
[i
][ffcPkgVer
]);
668 String
[] row
= { "", "", "", "", "", "", "" };
670 row
[modNameColForFpdModTable
] = mi
.getName();
671 row
[modVerColForFpdModTable
] = mi
.getVersion();
672 row
[typeColForFpdModTable
] = mi
.getModuleType();
673 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
674 row
[pkgVerColForFpdModTable
] = mi
.getPackage().getVersion();
675 row
[archColForFpdModTable
] = saa
[i
][ffcModArch
];
677 row
[pathColForFpdModTable
] = GlobalData
.getMsaFile(mi
).getPath().substring(
678 System
.getenv("WORKSPACE")
680 } catch (Exception e
) {
681 JOptionPane
.showMessageDialog(frame
, "Show FPD Modules:" + e
.getMessage());
684 modelFpdModules
.addRow(row
);
685 String fpdMsaKey
= saa
[i
][ffcModGuid
] + row
[modVerColForFpdModTable
]
686 + saa
[i
][ffcPkgGuid
] + row
[pkgVerColForFpdModTable
];
687 ArrayList
<String
> al
= fpdMsa
.get(fpdMsaKey
);
689 al
= new ArrayList
<String
>();
690 fpdMsa
.put(fpdMsaKey
, al
);
692 al
.add(saa
[i
][ffcModArch
]);
697 TableSorter sorter
= (TableSorter
)jTableFpdModules
.getModel();
698 sorter
.setSortingStatus(modNameColForFpdModTable
, TableSorter
.ASCENDING
);
705 private void showAllModules() {
707 if (miList
== null) {
708 miList
= new ArrayList
<ModuleIdentification
>();
710 Set
<PackageIdentification
> spi
= GlobalData
.getPackageList();
711 Iterator ispi
= spi
.iterator();
713 while (ispi
.hasNext()) {
714 PackageIdentification pi
= (PackageIdentification
) ispi
.next();
715 String
[] s
= { "", "", "", "", "", "" };
717 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(pi
);
718 Iterator ismi
= smi
.iterator();
719 while (ismi
.hasNext()) {
720 ModuleIdentification mi
= (ModuleIdentification
) ismi
.next();
721 s
[modNameColForAllModTable
] = mi
.getName();
722 s
[modVerColForAllModTable
] = mi
.getVersion();
723 s
[typeColForAllModTable
] = mi
.getModuleType();
724 s
[pkgNameColForAllModTable
] = pi
.getName();
725 s
[pkgVerColForAllModTable
] = pi
.getVersion();
727 s
[pathColForAllModTable
] = GlobalData
.getMsaFile(mi
).getPath()
728 .substring(System
.getenv("WORKSPACE").length() + 1);
729 } catch (Exception e
) {
730 JOptionPane
.showMessageDialog(frame
, "Show All Modules:" + e
.getMessage());
732 modelAllModules
.addRow(s
);
737 TableSorter sorter
= (TableSorter
)jTableAllModules
.getModel();
738 sorter
.setSortingStatus(modNameColForAllModTable
, TableSorter
.ASCENDING
);
742 * This method initializes this
746 private void initialize() {
747 this.setSize(633, 533);
748 this.setTitle("Framework Modules");
749 this.setContentPane(getJSplitPane());
750 this.setVisible(true);
754 } // @jve:decl-index=0:visual-constraint="10,10"
756 class NonEditableTableModel
extends DefaultTableModel
{
760 private static final long serialVersionUID
= 1L;
762 public boolean isCellEditable(int row
, int col
) {