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
.event
.TableModelEvent
;
29 import javax
.swing
.table
.DefaultTableModel
;
30 import javax
.swing
.table
.TableModel
;
32 import org
.tianocore
.PlatformSurfaceAreaDocument
;
33 import org
.tianocore
.frameworkwizard
.common
.GlobalData
;
34 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
35 import org
.tianocore
.frameworkwizard
.common
.ui
.IInternalFrame
;
36 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.SurfaceAreaQuery
;
37 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.WorkspaceProfile
;
38 import org
.tianocore
.frameworkwizard
.module
.Identifications
.ModuleIdentification
;
40 import java
.awt
.FlowLayout
;
41 import java
.util
.ArrayList
;
42 import java
.util
.HashMap
;
43 import java
.util
.Iterator
;
45 import java
.util
.Vector
;
47 public class FpdFrameworkModules
extends IInternalFrame
{
52 private static final long serialVersionUID
= 1L;
54 public static final int forceDbgColForFpdModTable
= 7;
58 private JSplitPane jSplitPane
= null;
60 private JPanel jPanelTop
= null;
62 private JPanel jPanelBottom
= null;
64 private JLabel jLabel
= null;
66 private JScrollPane jScrollPaneAllModules
= null;
68 private JTable jTableAllModules
= null;
70 private JPanel jPanelTopSouth
= null;
72 private JButton jButtonAddModule
= null;
74 private JLabel jLabelModulesAdded
= null;
76 private JPanel jPanelBottomSouth
= null;
78 private JScrollPane jScrollPaneFpdModules
= null;
80 private JTable jTableFpdModules
= null;
82 private JButton jButtonSettings
= null;
84 private JButton jButtonRemoveModule
= null;
86 private NonEditableTableModel modelAllModules
= null;
88 private FpdModulesTableModel modelFpdModules
= null;
90 private FpdModuleSA settingDlg
= null;
92 private FpdFileContents ffc
= null;
94 private OpeningPlatformType docConsole
= null;
96 private Map
<String
, ArrayList
<String
>> fpdMsa
= null;
98 private ArrayList
<ModuleIdentification
> miList
= null;
101 * Column settings for displaying all modules in workspace
103 private final int modNameColForAllModTable
= 0;
105 private final int pkgNameColForAllModTable
= 1;
107 private final int pathColForAllModTable
= 2;
109 private final int typeColForAllModTable
= 3;
111 private final int pkgVerColForAllModTable
= 5;
113 private final int modVerColForAllModTable
= 4;
116 * Column settings for display modules in the FPD file
118 private final int modNameColForFpdModTable
= 0;
120 private final int pkgNameColForFpdModTable
= 1;
122 private final int pathColForFpdModTable
= 2;
124 private final int archColForFpdModTable
= 3;
126 private final int pkgVerColForFpdModTable
= 6;
128 private final int modVerColForFpdModTable
= 5;
130 private final int typeColForFpdModTable
= 4;
133 * FpdFileContents structure
135 private final int ffcModGuid
= 0;
137 private final int ffcModVer
= 1;
139 private final int ffcPkgGuid
= 2;
141 private final int ffcPkgVer
= 3;
143 private final int ffcModArch
= 4;
146 * Set Column Widths, Only the PATH should not have a max width.
148 private final int modNameMinWidth
= 168;
150 private final int modNamePrefWidth
= 200;
152 private final int modNameMaxWidth
= 350;
154 private final int pkgNameMinWidth
= 100;
156 private final int pkgNamePrefWidth
= 130;
158 private final int pkgNameMaxWidth
= 150;
160 private final int verMinWidth
= 60;
162 private final int verMaxWidth
= 80;
164 private final int verPrefWidth
= 70;
166 private final int pathPrefWidth
= 600;
168 private final int pathMinWidth
= 280;
170 private final int archPrefWidth
= 80;
172 private final int archMinWidth
= 60;
174 private final int archMaxWidth
= 100;
176 private final int typePrefWidth
= 145;
178 private final int typeMinWidth
= 100;
180 private final int typeMaxWidth
= 155;
183 * This method initializes jSplitPane
185 * This is the main edit window
187 * @return javax.swing.JSplitPane jSplitPane
189 private JSplitPane
getJSplitPane() {
190 if (jSplitPane
== null) {
191 jSplitPane
= new JSplitPane();
192 jSplitPane
.setOrientation(javax
.swing
.JSplitPane
.VERTICAL_SPLIT
);
193 jSplitPane
.setDividerLocation(250);
194 jSplitPane
.setBottomComponent(getJPanelBottom());
195 jSplitPane
.setTopComponent(getJPanelTop());
201 * This method initializes jPanelTop
203 * This panel contains the All Modules Table
205 * @return javax.swing.JPanel jPanelTop
207 private JPanel
getJPanelTop() {
208 if (jPanelTop
== null) {
209 jLabel
= new JLabel();
210 jLabel
.setText("Modules in Workspace");
211 jPanelTop
= new JPanel();
212 jPanelTop
.setLayout(new BorderLayout());
213 jPanelTop
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
214 jPanelTop
.add(getJScrollPaneAllModules(), java
.awt
.BorderLayout
.CENTER
);
215 jPanelTop
.add(getJPanelTopSouth(), java
.awt
.BorderLayout
.SOUTH
);
221 * This method initializes jPanelBottom
223 * This panel contains the FPD Modules Table
225 * @return javax.swing.JPanel jPanelBottom
227 private JPanel
getJPanelBottom() {
228 if (jPanelBottom
== null) {
229 jLabelModulesAdded
= new JLabel();
230 jLabelModulesAdded
.setText("Modules Added");
231 jPanelBottom
= new JPanel();
232 jPanelBottom
.setLayout(new BorderLayout());
233 jPanelBottom
.add(jLabelModulesAdded
, java
.awt
.BorderLayout
.NORTH
);
234 jPanelBottom
.add(getJPanelBottomSouth(), java
.awt
.BorderLayout
.SOUTH
);
235 jPanelBottom
.add(getJScrollPaneFpdModules(), java
.awt
.BorderLayout
.CENTER
);
241 * This method initializes jScrollPaneAllModules
243 * @return javax.swing.JScrollPane jScrollPaneAllModules
245 private JScrollPane
getJScrollPaneAllModules() {
246 if (jScrollPaneAllModules
== null) {
247 jScrollPaneAllModules
= new JScrollPane();
248 jScrollPaneAllModules
.setPreferredSize(new java
.awt
.Dimension(600, 200));
249 jScrollPaneAllModules
.setViewportView(getJTableAllModules());
251 return jScrollPaneAllModules
;
255 * This method initializes jTableAllModules
257 * @return javax.swing.JTable jTableAllModules
259 private JTable
getJTableAllModules() {
260 if (jTableAllModules
== null) {
261 modelAllModules
= new NonEditableTableModel();
262 TableSorter sorter
= new TableSorter(modelAllModules
);
263 jTableAllModules
= new JTable(sorter
);
264 sorter
.setTableHeader(jTableAllModules
.getTableHeader());
265 jTableAllModules
.setRowHeight(20);
266 modelAllModules
.addColumn("<html>Module<br>Name</html>");
267 modelAllModules
.addColumn("<html>Package<br>Name</html>");
268 modelAllModules
.addColumn("Path");
269 modelAllModules
.addColumn("<html>Module<br>Type</html>");
270 modelAllModules
.addColumn("<html>Module<br>Version</html>");
271 modelAllModules
.addColumn("<html>Package<br>Version</html>");
273 javax
.swing
.table
.TableColumn column
= null;
274 column
= jTableAllModules
.getColumnModel().getColumn(modNameColForAllModTable
);
275 column
.setPreferredWidth(modNamePrefWidth
);
276 column
.setMinWidth(modNameMinWidth
);
277 column
.setMaxWidth(modNameMaxWidth
);
278 column
= jTableAllModules
.getColumnModel().getColumn(modVerColForAllModTable
);
279 column
.setPreferredWidth(verPrefWidth
);
280 column
.setMaxWidth(verMaxWidth
);
281 column
.setMinWidth(verMinWidth
);
282 column
= jTableAllModules
.getColumnModel().getColumn(pkgNameColForAllModTable
);
283 column
.setPreferredWidth(pkgNamePrefWidth
);
284 column
.setMinWidth(pkgNameMinWidth
);
285 column
.setMaxWidth(pkgNameMaxWidth
);
286 column
= jTableAllModules
.getColumnModel().getColumn(pkgVerColForAllModTable
);
287 column
.setPreferredWidth(verPrefWidth
);
288 column
.setMaxWidth(verMaxWidth
);
289 column
.setMinWidth(verMinWidth
);
290 column
= jTableAllModules
.getColumnModel().getColumn(typeColForAllModTable
);
291 column
.setPreferredWidth(typePrefWidth
);
292 column
.setMaxWidth(typeMaxWidth
);
293 column
.setMinWidth(typeMinWidth
);
294 column
= jTableAllModules
.getColumnModel().getColumn(pathColForAllModTable
);
295 column
.setPreferredWidth(pathPrefWidth
);
296 column
.setMinWidth(pathMinWidth
);
298 jTableAllModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
299 jTableAllModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
302 return jTableAllModules
;
306 * This method initializes jPanelTopSouth
308 * This panel contains the ADD button
310 * @return javax.swing.JPanel jPanelTopSouth
312 private JPanel
getJPanelTopSouth() {
313 if (jPanelTopSouth
== null) {
314 FlowLayout flowLayout
= new FlowLayout();
315 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
316 jPanelTopSouth
= new JPanel();
317 jPanelTopSouth
.setLayout(flowLayout
);
318 jPanelTopSouth
.add(getJButtonAddModule(), null);
320 return jPanelTopSouth
;
324 * This method initializes jButtonAddModule
326 * @return javax.swing.JButton jButtonAddModule
328 private JButton
getJButtonAddModule() {
329 if (jButtonAddModule
== null) {
330 jButtonAddModule
= new JButton();
331 jButtonAddModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
332 jButtonAddModule
.setText("Add a Module");
333 jButtonAddModule
.addActionListener(new java
.awt
.event
.ActionListener() {
334 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
335 int selectedRow
= jTableAllModules
.getSelectedRow();
336 if (selectedRow
< 0) {
340 TableSorter sorter
= (TableSorter
) jTableAllModules
.getModel();
341 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
342 String path
= modelAllModules
.getValueAt(selectedRow
, pathColForAllModTable
) + "";
343 ModuleIdentification mi
= miList
.get(selectedRow
);
344 Vector
<String
> vArchs
= null;
346 vArchs
= WorkspaceProfile
.getModuleSupArchs(mi
);
348 catch (Exception exp
) {
349 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
352 if (vArchs
== null) {
353 JOptionPane
.showMessageDialog(frame
, "No Supported Architectures specified in MSA file.");
357 String archsAdded
= "";
358 String mg
= mi
.getGuid();
359 String mv
= mi
.getVersion();
360 String pg
= mi
.getPackageId().getGuid();
361 String pv
= mi
.getPackageId().getVersion();
362 String mType
= SurfaceAreaQuery
.getModuleType(mi
);
364 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
367 // if existing ModuleSA does not specify version info.
369 al
= fpdMsa
.get(mg
+ "null" + pg
+ "null");
371 al
= fpdMsa
.get(mg
+ "null" + pg
+ pv
);
373 al
= fpdMsa
.get(mg
+ mv
+ pg
+ "null");
375 al
= new ArrayList
<String
>();
376 fpdMsa
.put(mg
+ mv
+ pg
+ pv
, al
);
382 // filter from module SupArchs what archs has been added.
384 for (int i
= 0; i
< al
.size(); ++i
) {
385 vArchs
.remove(al
.get(i
));
388 // check whether archs conform to SupArch of platform.
390 Vector
<Object
> platformSupArch
= new Vector
<Object
>();
391 ffc
.getPlatformDefsSupportedArchs(platformSupArch
);
392 vArchs
.retainAll(platformSupArch
);
394 // Archs this Module supported have already been added.
396 if (vArchs
.size() == 0) {
397 JOptionPane
.showMessageDialog(frame
, "This Module has already been added.");
400 //ToDo put Arch instead of null
401 boolean errorOccurred
= false;
402 for (int i
= 0; i
< vArchs
.size(); ++i
) {
403 String arch
= vArchs
.get(i
);
405 archsAdded
+= arch
+ " ";
406 String
[] row
= { "", "", "", "", "", "", "" };
409 row
[modNameColForFpdModTable
] = mi
.getName();
410 row
[pkgNameColForFpdModTable
] = mi
.getPackageId().getName();
411 row
[pathColForFpdModTable
] = path
;
412 row
[archColForFpdModTable
] = arch
;
413 row
[pkgVerColForFpdModTable
] = pv
;
414 row
[modVerColForFpdModTable
] = mv
;
415 row
[typeColForFpdModTable
] = mType
;
418 modelFpdModules
.addRow(row
);
420 docConsole
.setSaved(false);
422 //ToDo : specify archs need to add.
423 ffc
.addFrameworkModulesPcdBuildDefs(mi
, arch
, null);
424 } catch (Exception exception
) {
425 JOptionPane
.showMessageDialog(frame
, "Adding " + row
[modNameColForFpdModTable
] + " with Supporting Architectures: " + arch
426 + ": " + exception
.getMessage());
427 errorOccurred
= true;
431 String s
= "This Module with Architecture " + archsAdded
;
433 s
+= " was added with Error. Platform may NOT Build.";
435 s
+= " was added Successfully.";
437 JOptionPane
.showMessageDialog(frame
, s
);
438 TableSorter sorterFpdModules
= (TableSorter
)jTableFpdModules
.getModel();
439 int viewIndex
= sorterFpdModules
.getViewIndexArray()[modelFpdModules
.getRowCount() - 1];
440 jTableFpdModules
.changeSelection(viewIndex
, 0, false, false);
444 return jButtonAddModule
;
448 * This method initializes jPanelBottomSouth
450 * This panel contains the Settings and Remove Buttons
452 * @return javax.swing.JPanel jPanelBottomSouth
454 private JPanel
getJPanelBottomSouth() {
455 if (jPanelBottomSouth
== null) {
456 FlowLayout flowLayout1
= new FlowLayout();
457 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
458 jPanelBottomSouth
= new JPanel();
459 jPanelBottomSouth
.setLayout(flowLayout1
);
460 jPanelBottomSouth
.add(getJButtonSettings(), null);
461 jPanelBottomSouth
.add(getJButtonRemoveModule(), null);
463 return jPanelBottomSouth
;
467 * This method initializes jScrollPaneFpdModules
469 * @return javax.swing.JScrollPane jScrollPaneFpdModules
471 private JScrollPane
getJScrollPaneFpdModules() {
472 if (jScrollPaneFpdModules
== null) {
473 jScrollPaneFpdModules
= new JScrollPane();
474 jScrollPaneFpdModules
.setPreferredSize(new java
.awt
.Dimension(453, 200));
475 jScrollPaneFpdModules
.setViewportView(getJTableFpdModules());
477 return jScrollPaneFpdModules
;
481 * This method initializes jTableFpdModules
483 * @return javax.swing.JTable jTableFpdModules
485 private JTable
getJTableFpdModules() {
486 if (jTableFpdModules
== null) {
487 modelFpdModules
= new FpdModulesTableModel();
488 TableSorter sorter
= new TableSorter(modelFpdModules
);
489 jTableFpdModules
= new JTable(sorter
);
490 sorter
.setTableHeader(jTableFpdModules
.getTableHeader());
491 jTableFpdModules
.setRowHeight(20);
492 modelFpdModules
.addColumn("<html>Module<br>Name</html>");
493 modelFpdModules
.addColumn("<html>Package<br>Name</html>");
494 modelFpdModules
.addColumn("Path");
495 modelFpdModules
.addColumn("<html>Supported<br>Architectures</html>");
496 modelFpdModules
.addColumn("<html>Module<br>Type</html>");
497 modelFpdModules
.addColumn("<html>Module<br>Version</html>");
498 modelFpdModules
.addColumn("<html>Package<br>Version</html>");
499 modelFpdModules
.addColumn("<html>Force<br>Debug</html>");
501 javax
.swing
.table
.TableColumn column
= null;
502 column
= jTableFpdModules
.getColumnModel().getColumn(modNameColForFpdModTable
);
503 column
.setPreferredWidth(modNamePrefWidth
);
504 column
.setMinWidth(modNameMinWidth
);
505 column
.setMaxWidth(modNameMaxWidth
);
506 column
= jTableFpdModules
.getColumnModel().getColumn(modVerColForFpdModTable
);
507 column
.setPreferredWidth(verPrefWidth
);
508 column
.setMaxWidth(verMaxWidth
);
509 column
.setMinWidth(verMinWidth
);
510 column
= jTableFpdModules
.getColumnModel().getColumn(pkgNameColForFpdModTable
);
511 column
.setPreferredWidth(pkgNamePrefWidth
);
512 column
.setMinWidth(pkgNameMinWidth
);
513 column
.setMaxWidth(pkgNameMaxWidth
);
514 column
= jTableFpdModules
.getColumnModel().getColumn(pkgVerColForFpdModTable
);
515 column
.setPreferredWidth(verPrefWidth
);
516 column
.setMaxWidth(verMaxWidth
);
517 column
.setMinWidth(verMinWidth
);
518 column
= jTableFpdModules
.getColumnModel().getColumn(archColForFpdModTable
);
519 column
.setPreferredWidth(archPrefWidth
);
520 column
.setMaxWidth(archMaxWidth
);
521 column
.setMinWidth(archMinWidth
);
522 column
= jTableFpdModules
.getColumnModel().getColumn(pathColForFpdModTable
);
523 column
.setPreferredWidth(pathPrefWidth
);
524 column
.setMinWidth(pathMinWidth
);
525 column
= jTableFpdModules
.getColumnModel().getColumn(typeColForFpdModTable
);
526 column
.setPreferredWidth(typePrefWidth
);
527 column
.setMaxWidth(typeMaxWidth
);
528 column
.setMinWidth(typeMinWidth
);
530 jTableFpdModules
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
531 jTableFpdModules
.setAutoResizeMode(JTable
.AUTO_RESIZE_OFF
);
533 jTableFpdModules
.getModel().addTableModelListener(this);
535 return jTableFpdModules
;
538 public void tableChanged(TableModelEvent arg0
) {
539 if (arg0
.getType() == TableModelEvent
.UPDATE
){
540 int row
= arg0
.getFirstRow();
541 int column
= arg0
.getColumn();
542 TableModel m
= (TableModel
)arg0
.getSource();
544 if (column
!= forceDbgColForFpdModTable
) {
547 String s
= m
.getValueAt(row
, column
)+"";
548 boolean dbgEnable
= new Boolean(s
);
549 ffc
.setModuleSAForceDebug(row
, dbgEnable
);
550 docConsole
.setSaved(false);
554 * This method initializes jButtonSettings
556 * @return javax.swing.JButton jButtonSettings
558 private JButton
getJButtonSettings() {
559 if (jButtonSettings
== null) {
560 jButtonSettings
= new JButton();
561 jButtonSettings
.setPreferredSize(new java
.awt
.Dimension(130,20));
562 jButtonSettings
.setText("Settings");
563 jButtonSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
564 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
565 int selectedRow
= jTableFpdModules
.getSelectedRow();
566 if (selectedRow
< 0) {
570 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
571 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
573 if (ffc
.adjustPcd(selectedRow
)) {
574 docConsole
.setSaved(false);
577 catch (Exception exp
) {
578 JOptionPane
.showMessageDialog(frame
, exp
.getMessage());
582 if (settingDlg
== null) {
583 settingDlg
= new FpdModuleSA(ffc
);
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 settingDlg
.setKey(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
, selectedRow
, docConsole
);
594 settingDlg
.setVisible(true);
598 return jButtonSettings
;
602 * This method initializes jButtonRemoveModule
604 * @return javax.swing.JButton jButtonRemoveModule
606 private JButton
getJButtonRemoveModule() {
607 if (jButtonRemoveModule
== null) {
608 jButtonRemoveModule
= new JButton();
609 jButtonRemoveModule
.setPreferredSize(new java
.awt
.Dimension(130, 20));
610 jButtonRemoveModule
.setText("Remove Module");
611 jButtonRemoveModule
.addActionListener(new java
.awt
.event
.ActionListener() {
612 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
613 int selectedRow
= jTableFpdModules
.getSelectedRow();
614 if (selectedRow
< 0) {
617 docConsole
.setSaved(false);
619 TableSorter sorter
= (TableSorter
) jTableFpdModules
.getModel();
620 selectedRow
= sorter
.getModelRowIndex(selectedRow
);
622 String
[] sa
= new String
[5];
623 ffc
.getFrameworkModuleInfo(selectedRow
, sa
);
624 String mg
= sa
[ffcModGuid
];
625 String mv
= sa
[ffcModVer
];
626 String pg
= sa
[ffcPkgGuid
];
627 String pv
= sa
[ffcPkgVer
];
628 String arch
= sa
[ffcModArch
];
629 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(mg
+ " " + mv
+ " " + pg
+ " " + pv
+ " " + arch
);
630 mv
= mi
.getVersion();
631 pv
= mi
.getPackageId().getVersion();
632 modelFpdModules
.removeRow(selectedRow
);
634 // if no arch specified in ModuleSA
635 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
638 ArrayList
<String
> al
= fpdMsa
.get(mg
+ mv
+ pg
+ pv
);
640 if (al
.size() == 0) {
641 fpdMsa
.remove(mg
+ mv
+ pg
+ pv
);
645 ffc
.removeModuleSA(selectedRow
);
649 return jButtonRemoveModule
;
656 public static void main(String
[] args
) {
657 // Set the pane visable
658 new FpdFrameworkModules().setVisible(true);
662 * This is the default constructor
664 public FpdFrameworkModules() {
669 public FpdFrameworkModules(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
675 public FpdFrameworkModules(OpeningPlatformType opt
) {
676 this(opt
.getXmlFpd());
680 private void init(PlatformSurfaceAreaDocument
.PlatformSurfaceArea fpd
) {
683 ffc
= new FpdFileContents(fpd
);
687 if (fpdMsa
== null) {
688 fpdMsa
= new HashMap
<String
, ArrayList
<String
>>();
691 if (ffc
.getFrameworkModulesCount() > 0) {
692 String
[][] saa
= new String
[ffc
.getFrameworkModulesCount()][5];
693 ffc
.getFrameworkModulesInfo(saa
);
694 for (int i
= 0; i
< saa
.length
; ++i
) {
695 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(saa
[i
][ffcModGuid
] + " " + saa
[i
][ffcModVer
] + " "
696 + saa
[i
][ffcPkgGuid
] + " " + saa
[i
][ffcPkgVer
]);
697 Object
[] row
= { "", "", "", "", "", "", "", "" };
699 row
[modNameColForFpdModTable
] = mi
.getName();
700 row
[modVerColForFpdModTable
] = mi
.getVersion();
701 row
[typeColForFpdModTable
] = SurfaceAreaQuery
.getModuleType(mi
);
702 row
[pkgNameColForFpdModTable
] = mi
.getPackageId().getName();
703 row
[pkgVerColForFpdModTable
] = mi
.getPackageId().getVersion();
704 row
[archColForFpdModTable
] = saa
[i
][ffcModArch
];
706 row
[pathColForFpdModTable
] = mi
.getPath().substring(System
.getenv("WORKSPACE").length() + 1);
707 } catch (Exception e
) {
708 JOptionPane
.showMessageDialog(frame
, "Show FPD Modules:" + e
.getMessage());
711 String fpdMsaKey
= saa
[i
][ffcModGuid
] + row
[modVerColForFpdModTable
]
712 + saa
[i
][ffcPkgGuid
] + row
[pkgVerColForFpdModTable
];
713 ArrayList
<String
> al
= fpdMsa
.get(fpdMsaKey
);
715 al
= new ArrayList
<String
>();
716 fpdMsa
.put(fpdMsaKey
, al
);
718 al
.add(saa
[i
][ffcModArch
]);
720 row
[forceDbgColForFpdModTable
] = ffc
.getModuleSAForceDebug(i
);
721 modelFpdModules
.addRow(row
);
724 TableSorter sorter
= (TableSorter
)jTableFpdModules
.getModel();
725 sorter
.setSortState(modNameColForFpdModTable
, TableSorter
.ASCENDING
);
732 private void showAllModules() {
734 if (miList
== null) {
735 miList
= new ArrayList
<ModuleIdentification
>();
738 String
[] s
= { "", "", "", "", "", "" };
740 Iterator ismi
= GlobalData
.vModuleList
.iterator();
741 while (ismi
.hasNext()) {
742 ModuleIdentification mi
= (ModuleIdentification
) ismi
.next();
743 s
[modNameColForAllModTable
] = mi
.getName();
744 s
[modVerColForAllModTable
] = mi
.getVersion();
745 s
[typeColForAllModTable
] = SurfaceAreaQuery
.getModuleType(mi
);
746 s
[pkgNameColForAllModTable
] = mi
.getPackageId().getName();
747 s
[pkgVerColForAllModTable
] = mi
.getPackageId().getVersion();
749 s
[pathColForAllModTable
] = mi
.getPath().substring(System
.getenv("WORKSPACE").length() + 1);
750 } catch (Exception e
) {
751 JOptionPane
.showMessageDialog(frame
, "Show All Modules:" + e
.getMessage());
753 modelAllModules
.addRow(s
);
758 TableSorter sorter
= (TableSorter
)jTableAllModules
.getModel();
759 sorter
.setSortState(modNameColForAllModTable
, TableSorter
.ASCENDING
);
763 * This method initializes this
767 private void initialize() {
768 this.setSize(633, 533);
769 this.setTitle("Framework Modules");
770 this.setContentPane(getJSplitPane());
771 this.setVisible(true);
775 } // @jve:decl-index=0:visual-constraint="10,10"
777 class NonEditableTableModel
extends DefaultTableModel
{
781 private static final long serialVersionUID
= 1L;
783 public boolean isCellEditable(int row
, int col
) {
788 class FpdModulesTableModel
extends DefaultTableModel
{
793 private static final long serialVersionUID
= 1L;
795 public Class
<?
> getColumnClass (int c
) {
796 if (getValueAt(0, c
) != null){
797 return getValueAt(0, c
).getClass();
802 public boolean isCellEditable (int row
, int col
) {
803 if (col
== FpdFrameworkModules
.forceDbgColForFpdModTable
) {