3 The file is used to create, update FrameworkModules of Fpd file
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 package org
.tianocore
.frameworkwizard
.platform
.ui
;
17 import java
.awt
.BorderLayout
;
19 import javax
.swing
.JFrame
;
20 import javax
.swing
.JOptionPane
;
21 import javax
.swing
.JPanel
;
22 import javax
.swing
.JSplitPane
;
23 import javax
.swing
.JLabel
;
24 import javax
.swing
.JScrollPane
;
25 import javax
.swing
.JTable
;
26 import javax
.swing
.JButton
;
27 import javax
.swing
.ListSelectionModel
;
28 import javax
.swing
.table
.DefaultTableModel
;
30 import org
.tianocore
.PlatformSurfaceAreaDocument
;
31 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
32 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
33 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.WorkspaceProfile
;
34 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.ModuleIdentification
;
35 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.PackageIdentification
;
37 import java
.awt
.FlowLayout
;
39 import java
.util
.ArrayList
;
40 import java
.util
.HashMap
;
41 import java
.util
.Iterator
;
44 import java
.util
.Vector
;
46 public class FpdFrameworkModules
extends IInternalFrame
{
51 private static final long serialVersionUID
= 1L;
53 public static final int forceDbgColForFpdModTable
= 7;
57 private JSplitPane jSplitPane
= null;
59 private JPanel jPanelTop
= null;
61 private JPanel jPanelBottom
= null;
63 private JLabel jLabel
= null;
65 private JScrollPane jScrollPaneAllModules
= null;
67 private JTable jTableAllModules
= null;
69 private JPanel jPanelTopSouth
= null;
71 private JButton jButtonAddModule
= null;
73 private JLabel jLabelModulesAdded
= null;
75 private JPanel jPanelBottomSouth
= null;
77 private JScrollPane jScrollPaneFpdModules
= null;
79 private JTable jTableFpdModules
= null;
81 private JButton jButtonSettings
= null;
83 private JButton jButtonRemoveModule
= null;
85 private NonEditableTableModel modelAllModules
= null;
87 private FpdModulesTableModel modelFpdModules
= null;
89 private FpdModuleSA settingDlg
= null;
91 private FpdFileContents ffc
= null;
93 private OpeningPlatformType docConsole
= null;
95 private Map
<String
, ArrayList
<String
>> fpdMsa
= null;
97 private ArrayList
<ModuleIdentification
> miList
= null;
100 * Column settings for displaying all modules in workspace
102 private final int modNameColForAllModTable
= 0;
104 private final int pkgNameColForAllModTable
= 1;
106 private final int pathColForAllModTable
= 2;
108 private final int typeColForAllModTable
= 3;
110 private final int pkgVerColForAllModTable
= 5;
112 private final int modVerColForAllModTable
= 4;
115 * Column settings for display modules in the FPD file
117 private final int modNameColForFpdModTable
= 0;
119 private final int pkgNameColForFpdModTable
= 1;
121 private final int pathColForFpdModTable
= 2;
123 private final int archColForFpdModTable
= 3;
125 private final int pkgVerColForFpdModTable
= 6;
127 private final int modVerColForFpdModTable
= 5;
129 private final int typeColForFpdModTable
= 4;
132 * FpdFileContents structure
134 private final int ffcModGuid
= 0;
136 private final int ffcModVer
= 1;
138 private final int ffcPkgGuid
= 2;
140 private final int ffcPkgVer
= 3;
142 private final int ffcModArch
= 4;
145 * Set Column Widths, Only the PATH should not have a max width.
147 private final int modNameMinWidth
= 168;
149 private final int modNamePrefWidth
= 200;
151 private final int modNameMaxWidth
= 350;
153 private final int pkgNameMinWidth
= 100;
155 private final int pkgNamePrefWidth
= 130;
157 private final int pkgNameMaxWidth
= 150;
159 private final int verMinWidth
= 60;
161 private final int verMaxWidth
= 80;
163 private final int verPrefWidth
= 70;
165 private final int pathPrefWidth
= 600;
167 private final int pathMinWidth
= 280;
169 private final int archPrefWidth
= 80;
171 private final int archMinWidth
= 60;
173 private final int archMaxWidth
= 100;
175 private final int typePrefWidth
= 145;
177 private final int typeMinWidth
= 100;
179 private final int typeMaxWidth
= 155;
182 * This method initializes jSplitPane
184 * This is the main edit window
186 * @return javax.swing.JSplitPane jSplitPane
188 private JSplitPane
getJSplitPane() {
189 if (jSplitPane
== null) {
190 jSplitPane
= new JSplitPane();
191 jSplitPane
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
192 jSplitPane
.setDividerLocation(250);
193 jSplitPane
.setBottomComponent(getJPanelBottom());
194 jSplitPane
.setTopComponent(getJPanelTop());
200 * This method initializes jPanelTop
202 * This panel contains the All Modules Table
204 * @return javax.swing.JPanel jPanelTop
206 private JPanel
getJPanelTop() {
207 if (jPanelTop
== null) {
208 jLabel
= new JLabel();
209 jLabel
.setText("Modules in Workspace");
210 jPanelTop
= new JPanel();
211 jPanelTop
.setLayout(new BorderLayout());
212 jPanelTop
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
213 jPanelTop
.add(getJScrollPaneAllModules(), java
.awt
.BorderLayout
.CENTER
);
214 jPanelTop
.add(getJPanelTopSouth(), java
.awt
.BorderLayout
.SOUTH
);
220 * This method initializes jPanelBottom
222 * This panel contains the FPD Modules Table
224 * @return javax.swing.JPanel jPanelBottom
226 private JPanel
getJPanelBottom() {
227 if (jPanelBottom
== null) {
228 jLabelModulesAdded
= new JLabel();
229 jLabelModulesAdded
.setText("Modules Added");
230 jPanelBottom
= new JPanel();
231 jPanelBottom
.setLayout(new BorderLayout());
232 jPanelBottom
.add(jLabelModulesAdded
, java
.awt
.BorderLayout
.NORTH
);
233 jPanelBottom
.add(getJPanelBottomSouth(), java
.awt
.BorderLayout
.SOUTH
);
234 jPanelBottom
.add(getJScrollPaneFpdModules(), java
.awt
.BorderLayout
.CENTER
);
240 * This method initializes jScrollPaneAllModules
242 * @return javax.swing.JScrollPane jScrollPaneAllModules
244 private JScrollPane
getJScrollPaneAllModules() {
245 if (jScrollPaneAllModules
== null) {
246 jScrollPaneAllModules
= new JScrollPane();
247 jScrollPaneAllModules
.setPreferredSize(new java
.awt
.Dimension(600, 200));
248 jScrollPaneAllModules
.setViewportView(getJTableAllModules());
250 return jScrollPaneAllModules
;
254 * This method initializes jTableAllModules
256 * @return javax.swing.JTable jTableAllModules
258 private JTable
getJTableAllModules() {
259 if (jTableAllModules
== null) {
260 modelAllModules
= new NonEditableTableModel();
261 TableSorter sorter
= new TableSorter(modelAllModules
);
262 jTableAllModules
= new JTable(sorter
);
263 sorter
.setTableHeader(jTableAllModules
.getTableHeader());
264 jTableAllModules
.setRowHeight(20);
265 modelAllModules
.addColumn("<html>Module<br>Name</html>");
266 modelAllModules
.addColumn("<html>Package<br>Name</html>");
267 modelAllModules
.addColumn("Path");
268 modelAllModules
.addColumn("<html>Module<br>Type</html>");
269 modelAllModules
.addColumn("<html>Module<br>Version</html>");
270 modelAllModules
.addColumn("<html>Package<br>Version</html>");
272 javax
.swing
.table
.TableColumn column
= null;
273 column
= jTableAllModules
.getColumnModel().getColumn(modNameColForAllModTable
);
274 column
.setPreferredWidth(modNamePrefWidth
);
275 column
.setMinWidth(modNameMinWidth
);
276 column
.setMaxWidth(modNameMaxWidth
);
277 column
= jTableAllModules
.getColumnModel().getColumn(modVerColForAllModTable
);
278 column
.setPreferredWidth(verPrefWidth
);
279 column
.setMaxWidth(verMaxWidth
);
280 column
.setMinWidth(verMinWidth
);
281 column
= jTableAllModules
.getColumnModel().getColumn(pkgNameColForAllModTable
);
282 column
.setPreferredWidth(pkgNamePrefWidth
);
283 column
.setMinWidth(pkgNameMinWidth
);
284 column
.setMaxWidth(pkgNameMaxWidth
);
285 column
= jTableAllModules
.getColumnModel().getColumn(pkgVerColForAllModTable
);
286 column
.setPreferredWidth(verPrefWidth
);
287 column
.setMaxWidth(verMaxWidth
);
288 column
.setMinWidth(verMinWidth
);
289 column
= jTableAllModules
.getColumnModel().getColumn(typeColForAllModTable
);
290 column
.setPreferredWidth(typePrefWidth
);
291 column
.setMaxWidth(typeMaxWidth
);
292 column
.setMinWidth(typeMinWidth
);
293 column
= jTableAllModules
.getColumnModel().getColumn(pathColForAllModTable
);
294 column
.setPreferredWidth(pathPrefWidth
);
295 column
.setMinWidth(pathMinWidth
);
297 jTableAllModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
298 jTableAllModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
301 return jTableAllModules
;
305 * This method initializes jPanelTopSouth
307 * This panel contains the ADD button
309 * @return javax.swing.JPanel jPanelTopSouth
311 private JPanel
getJPanelTopSouth() {
312 if (jPanelTopSouth
== null) {
313 FlowLayout flowLayout
= new FlowLayout();
314 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
315 jPanelTopSouth
= new JPanel();
316 jPanelTopSouth
.setLayout(flowLayout
);
317 jPanelTopSouth
.add(getJButtonAddModule(), null);
319 return jPanelTopSouth
;
323 * This method initializes jButtonAddModule
325 * @return javax.swing.JButton jButtonAddModule
327 private JButton
getJButtonAddModule() {
328 if (jButtonAddModule
== null) {
329 jButtonAddModule
= new JButton();
330 jButtonAddModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
331 jButtonAddModule
.setText("Add a Module");
332 jButtonAddModule
.addActionListener(new java
.awt
.event
.ActionListener() {
333 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
334 int selectedRow
= jTableAllModules
.getSelectedRow();
335 if (selectedRow
< 0) {
339 TableSorter sorter
= (TableSorter
) jTableAllModules
.getModel();
340 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
341 String path
= modelAllModules
.getValueAt(selectedRow
, pathColForAllModTable
) + "";
342 ModuleIdentification mi
= miList
.get(selectedRow
);
343 Vector
<String
> vArchs
= null;
345 vArchs
= WorkspaceProfile
.getModuleSupArchs(mi
);
347 catch (Exception exp
) {
348 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
351 if (vArchs
== null) {
352 JOptionPane
.showMessageDialog(frame
, "No Supported Architectures specified in MSA file.");
356 String archsAdded
= "";
357 String mg
= mi
.getGuid();
358 String mv
= mi
.getVersion();
359 String pg
= mi
.getPackage().getGuid();
360 String pv
= mi
.getPackage().getVersion();
361 String mType
= mi
.getModuleType();
363 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
366 // if existing ModuleSA does not specify version info.
368 al
= fpdMsa
.get(mg
+ "null" + pg
+ "null");
370 al
= fpdMsa
.get(mg
+ "null" + pg
+ pv
);
372 al
= fpdMsa
.get(mg
+ mv
+ pg
+ "null");
374 al
= new ArrayList
<String
>();
375 fpdMsa
.put(mg
+ mv
+ pg
+ pv
, al
);
381 // filter from module SupArchs what archs has been added.
383 for (int i
= 0; i
< al
.size(); ++i
) {
384 vArchs
.remove(al
.get(i
));
387 // check whether archs conform to SupArch of platform.
389 Vector
<Object
> platformSupArch
= new Vector
<Object
>();
390 ffc
.getPlatformDefsSupportedArchs(platformSupArch
);
391 vArchs
.retainAll(platformSupArch
);
393 // Archs this Module supported have already been added.
395 if (vArchs
.size() == 0) {
396 JOptionPane
.showMessageDialog(frame
, "This Module has already been added.");
399 //ToDo put Arch instead of null
400 boolean errorOccurred
= false;
401 for (int i
= 0; i
< vArchs
.size(); ++i
) {
402 String arch
= vArchs
.get(i
);
404 archsAdded
+= arch
+ " ";
405 String
[] row
= { "", "", "", "", "", "", "" };
408 row
[modNameColForFpdModTable
] = mi
.getName();
409 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
410 row
[pathColForFpdModTable
] = path
;
411 row
[archColForFpdModTable
] = arch
;
412 row
[pkgVerColForFpdModTable
] = pv
;
413 row
[modVerColForFpdModTable
] = mv
;
414 row
[typeColForFpdModTable
] = mType
;
417 modelFpdModules
.addRow(row
);
419 docConsole
.setSaved(false);
421 //ToDo : specify archs need to add.
422 ffc
.addFrameworkModulesPcdBuildDefs(mi
, arch
, null);
423 } catch (Exception exception
) {
424 JOptionPane
.showMessageDialog(frame
, "Adding " + row
[modNameColForFpdModTable
] + " with Supporting Architectures: " + arch
425 + ": " + exception
.getMessage());
426 errorOccurred
= true;
430 String s
= "This Module with Architecture " + archsAdded
;
432 s
+= " was added with Error. Platform may NOT Build.";
434 s
+= " was added Successfully.";
436 JOptionPane
.showMessageDialog(frame
, s
);
437 TableSorter sorterFpdModules
= (TableSorter
)jTableFpdModules
.getModel();
438 int viewIndex
= sorterFpdModules
.getViewIndexArray()[modelFpdModules
.getRowCount() - 1];
439 jTableFpdModules
.changeSelection(viewIndex
, 0, false, false);
443 return jButtonAddModule
;
447 * This method initializes jPanelBottomSouth
449 * This panel contains the Settings and Remove Buttons
451 * @return javax.swing.JPanel jPanelBottomSouth
453 private JPanel
getJPanelBottomSouth() {
454 if (jPanelBottomSouth
== null) {
455 FlowLayout flowLayout1
= new FlowLayout();
456 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
457 jPanelBottomSouth
= new JPanel();
458 jPanelBottomSouth
.setLayout(flowLayout1
);
459 jPanelBottomSouth
.add(getJButtonSettings(), null);
460 jPanelBottomSouth
.add(getJButtonRemoveModule(), null);
462 return jPanelBottomSouth
;
466 * This method initializes jScrollPaneFpdModules
468 * @return javax.swing.JScrollPane jScrollPaneFpdModules
470 private JScrollPane
getJScrollPaneFpdModules() {
471 if (jScrollPaneFpdModules
== null) {
472 jScrollPaneFpdModules
= new JScrollPane();
473 jScrollPaneFpdModules
.setPreferredSize(new java
.awt
.Dimension(453, 200));
474 jScrollPaneFpdModules
.setViewportView(getJTableFpdModules());
476 return jScrollPaneFpdModules
;
480 * This method initializes jTableFpdModules
482 * @return javax.swing.JTable jTableFpdModules
484 private JTable
getJTableFpdModules() {
485 if (jTableFpdModules
== null) {
486 modelFpdModules
= new FpdModulesTableModel();
487 TableSorter sorter
= new TableSorter(modelFpdModules
);
488 jTableFpdModules
= new JTable(sorter
);
489 sorter
.setTableHeader(jTableFpdModules
.getTableHeader());
490 jTableFpdModules
.setRowHeight(20);
491 modelFpdModules
.addColumn("<html>Module<br>Name</html>");
492 modelFpdModules
.addColumn("<html>Package<br>Name</html>");
493 modelFpdModules
.addColumn("Path");
494 modelFpdModules
.addColumn("<html>Supported<br>Architectures</html>");
495 modelFpdModules
.addColumn("<html>Module<br>Type</html>");
496 modelFpdModules
.addColumn("<html>Module<br>Version</html>");
497 modelFpdModules
.addColumn("<html>Package<br>Version</html>");
498 modelFpdModules
.addColumn("<html>Force<br>Debug</html>");
500 javax
.swing
.table
.TableColumn column
= null;
501 column
= jTableFpdModules
.getColumnModel().getColumn(modNameColForFpdModTable
);
502 column
.setPreferredWidth(modNamePrefWidth
);
503 column
.setMinWidth(modNameMinWidth
);
504 column
.setMaxWidth(modNameMaxWidth
);
505 column
= jTableFpdModules
.getColumnModel().getColumn(modVerColForFpdModTable
);
506 column
.setPreferredWidth(verPrefWidth
);
507 column
.setMaxWidth(verMaxWidth
);
508 column
.setMinWidth(verMinWidth
);
509 column
= jTableFpdModules
.getColumnModel().getColumn(pkgNameColForFpdModTable
);
510 column
.setPreferredWidth(pkgNamePrefWidth
);
511 column
.setMinWidth(pkgNameMinWidth
);
512 column
.setMaxWidth(pkgNameMaxWidth
);
513 column
= jTableFpdModules
.getColumnModel().getColumn(pkgVerColForFpdModTable
);
514 column
.setPreferredWidth(verPrefWidth
);
515 column
.setMaxWidth(verMaxWidth
);
516 column
.setMinWidth(verMinWidth
);
517 column
= jTableFpdModules
.getColumnModel().getColumn(archColForFpdModTable
);
518 column
.setPreferredWidth(archPrefWidth
);
519 column
.setMaxWidth(archMaxWidth
);
520 column
.setMinWidth(archMinWidth
);
521 column
= jTableFpdModules
.getColumnModel().getColumn(pathColForFpdModTable
);
522 column
.setPreferredWidth(pathPrefWidth
);
523 column
.setMinWidth(pathMinWidth
);
524 column
= jTableFpdModules
.getColumnModel().getColumn(typeColForFpdModTable
);
525 column
.setPreferredWidth(typePrefWidth
);
526 column
.setMaxWidth(typeMaxWidth
);
527 column
.setMinWidth(typeMinWidth
);
529 jTableFpdModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
530 jTableFpdModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
533 return jTableFpdModules
;
537 * This method initializes jButtonSettings
539 * @return javax.swing.JButton jButtonSettings
541 private JButton
getJButtonSettings() {
542 if (jButtonSettings
== null) {
543 jButtonSettings
= new JButton();
544 jButtonSettings
.setPreferredSize(new java
.awt
.Dimension(130,20));
545 jButtonSettings
.setText("Settings");
546 jButtonSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
547 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
548 int selectedRow
= jTableFpdModules
.getSelectedRow();
549 if (selectedRow
< 0) {
553 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
554 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
556 if (ffc
.adjustPcd(selectedRow
)) {
557 docConsole
.setSaved(false);
560 catch (Exception exp
) {
561 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
565 if (settingDlg
== null) {
566 settingDlg
= new FpdModuleSA(ffc
);
569 String
[] sa
= new String
[5];
570 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
571 String mg
= sa
[ffcModGuid
];
572 String mv
= sa
[ffcModVer
];
573 String pg
= sa
[ffcPkgGuid
];
574 String pv
= sa
[ffcPkgVer
];
575 String arch
= sa
[ffcModArch
];
576 settingDlg
.setKey(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
, selectedRow
, docConsole
);
577 settingDlg
.setVisible(true);
581 return jButtonSettings
;
585 * This method initializes jButtonRemoveModule
587 * @return javax.swing.JButton jButtonRemoveModule
589 private JButton
getJButtonRemoveModule() {
590 if (jButtonRemoveModule
== null) {
591 jButtonRemoveModule
= new JButton();
592 jButtonRemoveModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
593 jButtonRemoveModule
.setText("Remove Module");
594 jButtonRemoveModule
.addActionListener(new java
.awt
.event
.ActionListener() {
595 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
596 int selectedRow
= jTableFpdModules
.getSelectedRow();
597 if (selectedRow
< 0) {
600 docConsole
.setSaved(false);
602 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
603 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
605 String
[] sa
= new String
[5];
606 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
607 String mg
= sa
[ffcModGuid
];
608 String mv
= sa
[ffcModVer
];
609 String pg
= sa
[ffcPkgGuid
];
610 String pv
= sa
[ffcPkgVer
];
611 String arch
= sa
[ffcModArch
];
612 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
);
613 mv
= mi
.getVersion();
614 pv
= mi
.getPackage().getVersion();
615 modelFpdModules
.removeRow(selectedRow
);
617 // if no arch specified in ModuleSA
618 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
621 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
623 if (al
.size() == 0) {
624 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
628 ffc
.removeModuleSA(selectedRow
);
632 return jButtonRemoveModule
;
639 public static void main(String
[] args
) {
640 // Set the pane visable
641 new FpdFrameworkModules().setVisible(true);
645 * This is the default constructor
647 public FpdFrameworkModules() {
652 public FpdFrameworkModules(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
658 public FpdFrameworkModules(OpeningPlatformType opt
) {
659 this(opt
.getXmlFpd());
663 private void init(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
665 WorkspaceProfile
.initInfo("Tools" + File
.separator
+ "Conf" + File
.separator
+ "FrameworkDatabase.db", System
.getenv("WORKSPACE"));
668 JOptionPane
.showMessageDialog(frame
, "Error occurred when getting module data.");
672 ffc
= new FpdFileContents(fpd
);
676 if (fpdMsa
== null) {
677 fpdMsa
= new HashMap
<String
, ArrayList
<String
>>();
680 if (ffc
.getFrameworkModulesCount() > 0) {
681 String
[][] saa
= new String
[ffc
.getFrameworkModulesCount()][5];
682 ffc
.getFrameworkModulesInfo(saa
);
683 for (int i
= 0; i
< saa
.length
; ++i
) {
684 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(saa
[i
][ffcModGuid
] + " " + saa
[i
][ffcModVer
] + " "
685 + saa
[i
][ffcPkgGuid
] + " " + saa
[i
][ffcPkgVer
]);
686 Object
[] row
= { "", "", "", "", "", "", "", "" };
688 row
[modNameColForFpdModTable
] = mi
.getName();
689 row
[modVerColForFpdModTable
] = mi
.getVersion();
690 row
[typeColForFpdModTable
] = mi
.getModuleType();
691 row
[pkgNameColForFpdModTable
] = mi
.getPackage().getName();
692 row
[pkgVerColForFpdModTable
] = mi
.getPackage().getVersion();
693 row
[archColForFpdModTable
] = saa
[i
][ffcModArch
];
695 row
[pathColForFpdModTable
] = WorkspaceProfile
.getMsaFile(mi
).getPath().substring(
696 System
.getenv("WORKSPACE")
698 } catch (Exception e
) {
699 JOptionPane
.showMessageDialog(frame
, "Show FPD Modules:" + e
.getMessage());
702 String fpdMsaKey
= saa
[i
][ffcModGuid
] + row
[modVerColForFpdModTable
]
703 + saa
[i
][ffcPkgGuid
] + row
[pkgVerColForFpdModTable
];
704 ArrayList
<String
> al
= fpdMsa
.get(fpdMsaKey
);
706 al
= new ArrayList
<String
>();
707 fpdMsa
.put(fpdMsaKey
, al
);
709 al
.add(saa
[i
][ffcModArch
]);
711 row
[forceDbgColForFpdModTable
] = ffc
.getModuleSAForceDebug(i
);
712 modelFpdModules
.addRow(row
);
715 TableSorter sorter
= (TableSorter
)jTableFpdModules
.getModel();
716 sorter
.setSortState(modNameColForFpdModTable
, TableSorter
.ASCENDING
);
723 private void showAllModules() {
725 if (miList
== null) {
726 miList
= new ArrayList
<ModuleIdentification
>();
728 Set
<PackageIdentification
> spi
= WorkspaceProfile
.getPackageList();
729 Iterator ispi
= spi
.iterator();
731 while (ispi
.hasNext()) {
732 PackageIdentification pi
= (PackageIdentification
) ispi
.next();
733 String
[] s
= { "", "", "", "", "", "" };
735 Set
<ModuleIdentification
> smi
= WorkspaceProfile
.getModules(pi
);
736 Iterator ismi
= smi
.iterator();
737 while (ismi
.hasNext()) {
738 ModuleIdentification mi
= (ModuleIdentification
) ismi
.next();
739 s
[modNameColForAllModTable
] = mi
.getName();
740 s
[modVerColForAllModTable
] = mi
.getVersion();
741 s
[typeColForAllModTable
] = mi
.getModuleType();
742 s
[pkgNameColForAllModTable
] = pi
.getName();
743 s
[pkgVerColForAllModTable
] = pi
.getVersion();
745 s
[pathColForAllModTable
] = WorkspaceProfile
.getMsaFile(mi
).getPath()
746 .substring(System
.getenv("WORKSPACE").length() + 1);
747 } catch (Exception e
) {
748 JOptionPane
.showMessageDialog(frame
, "Show All Modules:" + e
.getMessage());
750 modelAllModules
.addRow(s
);
755 TableSorter sorter
= (TableSorter
)jTableAllModules
.getModel();
756 sorter
.setSortState(modNameColForAllModTable
, TableSorter
.ASCENDING
);
760 * This method initializes this
764 private void initialize() {
765 this.setSize(633, 533);
766 this.setTitle("Framework Modules");
767 this.setContentPane(getJSplitPane());
768 this.setVisible(true);
772 } // @jve:decl-index=0:visual-constraint="10,10"
774 class NonEditableTableModel
extends DefaultTableModel
{
778 private static final long serialVersionUID
= 1L;
780 public boolean isCellEditable(int row
, int col
) {
785 class FpdModulesTableModel
extends DefaultTableModel
{
790 private static final long serialVersionUID
= 1L;
792 public Class
<?
> getColumnClass (int c
) {
793 if (getValueAt(0, c
) != null){
794 return getValueAt(0, c
).getClass();
799 public boolean isCellEditable (int row
, int col
) {
800 if (col
== FpdFrameworkModules
.forceDbgColForFpdModTable
) {