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
.JDialog
;
9 import javax
.swing
.JTabbedPane
;
10 import javax
.swing
.JLabel
;
11 import javax
.swing
.JScrollPane
;
12 import javax
.swing
.JTable
;
13 import javax
.swing
.JTextArea
;
14 import javax
.swing
.JSplitPane
;
15 import javax
.swing
.JButton
;
16 import javax
.swing
.ListSelectionModel
;
17 import javax
.swing
.event
.ListSelectionEvent
;
18 import javax
.swing
.event
.ListSelectionListener
;
19 import javax
.swing
.event
.TableModelEvent
;
20 import javax
.swing
.event
.TableModelListener
;
21 import javax
.swing
.table
.DefaultTableModel
;
22 import javax
.swing
.table
.TableModel
;
24 import org
.apache
.xmlbeans
.XmlObject
;
25 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.GlobalData
;
26 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.SurfaceAreaQuery
;
27 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.ModuleIdentification
;
28 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.PackageIdentification
;
30 import java
.awt
.FlowLayout
;
31 import java
.awt
.event
.ActionEvent
;
32 import java
.awt
.event
.ActionListener
;
33 import java
.util
.ArrayList
;
34 import java
.util
.HashMap
;
35 import java
.util
.Iterator
;
36 import java
.util
.ListIterator
;
39 import javax
.swing
.JTextField
;
41 public class FpdModuleSA
extends JDialog
implements ActionListener
{
46 private static final long serialVersionUID
= 1L;
48 private JPanel jContentPane
= null;
49 private JTabbedPane jTabbedPane
= null;
50 private JPanel jPanel
= null;
51 private JPanel jPanel1
= null;
52 private JLabel jLabel
= null;
53 private JScrollPane jScrollPane
= null;
54 private JTable jTable
= null;
55 private JPanel jPanel2
= null;
56 private JScrollPane jScrollPane1
= null;
57 private JTextArea jTextArea
= null;
58 private JPanel jPanel3
= null;
59 private JSplitPane jSplitPane
= null;
60 private JPanel jPanel4
= null;
61 private JPanel jPanel5
= null;
62 private JLabel jLabel1
= null;
63 private JLabel jLabel2
= null;
64 private JScrollPane jScrollPane2
= null;
65 private JTable jTable1
= null;
66 private JScrollPane jScrollPane3
= null;
67 private JTable jTable2
= null;
68 private JScrollPane jScrollPane4
= null;
69 private JTable jTable3
= null;
70 private JPanel jPanel6
= null;
71 private JPanel jPanel7
= null;
72 private JScrollPane jScrollPane5
= null;
73 private JTextArea jTextArea1
= null;
74 private JLabel jLabel3
= null;
75 private JLabel jLabel4
= null;
76 private JButton jButton
= null;
77 private JButton jButton1
= null;
78 private JLabel jLabel5
= null;
79 private JButton jButton2
= null;
80 private JButton jButton3
= null;
81 private PartialEditableTableModel model
= null;
82 private LibraryTableModel model1
= null;
83 private LibraryTableModel model2
= null;
84 private LibraryTableModel model3
= null;
85 private FpdFileContents ffc
= null;
86 private String moduleKey
= null;
87 private HashMap
<String
, ArrayList
<String
>> classInstanceMap
= null;
88 private ArrayList
<String
> classProduced
= null;
89 private HashMap
<String
, ArrayList
<String
>> classConsumed
= null;
90 private JPanel jPanel8
= null;
91 private JLabel jLabel6
= null;
92 private JTextField jTextField
= null;
93 private JLabel jLabel7
= null;
94 private JTextField jTextField1
= null;
95 private JLabel jLabel8
= null;
96 private JTextField jTextField2
= null;
97 private JScrollPane jScrollPane6
= null;
98 private JTable jTable4
= null;
100 * This is the default constructor
102 public FpdModuleSA() {
106 public FpdModuleSA(FpdFileContents ffc
) {
111 public void setKey(String k
){
116 init will be called each time FpdModuleSA object is to be shown.
117 @param key Module information.
119 public void init(String key
) {
121 // display pcd for key.
123 model
.setRowCount(0);
124 int pcdCount
= ffc
.getPcdDataCount(key
);
126 String
[][] saa
= new String
[pcdCount
][6];
127 ffc
.getPcdData(key
, saa
);
128 for (int i
= 0; i
< saa
.length
; ++i
) {
129 model
.addRow(saa
[i
]);
134 // display lib instances already selected for key
136 model1
.setRowCount(0);
137 int instanceCount
= ffc
.getLibraryInstancesCount(key
);
138 if (instanceCount
!= 0) {
139 String
[][] saa
= new String
[instanceCount
][5];
140 ffc
.getLibraryInstances(key
, saa
);
141 for (int i
= 0; i
< saa
.length
; ++i
) {
142 if (getModuleId(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3] + " " + saa
[i
][4]) != null) {
143 saa
[i
][0] = getModuleId(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3] + " " + saa
[i
][4]).getName();
146 model1
.addRow(saa
[i
]);
150 // display library classes that need to be resolved. also potential instances for them.
152 resolveLibraryInstances(key
);
155 private void resolveLibraryInstances(String key
) {
156 ModuleIdentification mi
= getModuleId(key
);
157 PackageIdentification
[] depPkgList
= null;
159 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
160 SurfaceAreaQuery
.setDoc(m
);
162 // Get dependency pkg list into which we will search lib instances.
164 depPkgList
= SurfaceAreaQuery
.getDependencePkg(null);
166 // Get the lib class consumed, produced by this module itself.
168 String
[] classConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED");
170 if (this.classConsumed
== null) {
171 this.classConsumed
= new HashMap
<String
, ArrayList
<String
>>();
174 for(int i
= 0; i
< classConsumed
.length
; ++i
){
175 ArrayList
<String
> consumedBy
= this.classConsumed
.get(classConsumed
[i
]);
176 if (consumedBy
== null) {
177 consumedBy
= new ArrayList
<String
>();
180 this.classConsumed
.put(classConsumed
[i
], consumedBy
);
183 String
[] classProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED");
184 if (this.classProduced
== null) {
185 this.classProduced
= new ArrayList
<String
>();
187 for(int i
= 0; i
< classProduced
.length
; ++i
){
188 if (!this.classProduced
.contains(classProduced
[i
])){
189 this.classProduced
.add(classProduced
[i
]);
193 // Get classes unresolved
195 // Iterator<String> lip = this.classProduced.listIterator();
196 // while(lip.hasNext()){
197 // String clsProduced = lip.next();
198 // this.classConsumed.remove(clsProduced);
202 // find potential instances in all dependency pkgs for classes still in classConsumed.
204 if (classInstanceMap
== null){
205 classInstanceMap
= new HashMap
<String
, ArrayList
<String
>>();
207 Iterator
<String
> lic
= this.classConsumed
.keySet().iterator();
208 while(lic
.hasNext()){
209 String cls
= lic
.next();
210 if (this.classProduced
.contains(cls
) || classInstanceMap
.containsKey(cls
)) {
213 ArrayList
<String
> instances
= getInstancesForClass(cls
, depPkgList
);
214 if (instances
.size() == 0){
215 JOptionPane
.showMessageDialog(frame
, "No Applicable Instance for Library Class " +
216 cls
+ ", Platform Build will Fail.");
218 classInstanceMap
.put(cls
, instances
);
222 showClassToResolved();
229 private ArrayList
<String
> getInstancesForClass(String cls
, PackageIdentification
[] depPkgList
) throws Exception
{
230 ArrayList
<String
> al
= new ArrayList
<String
>();
232 for (int i
= 0; i
< depPkgList
.length
; ++i
) {
233 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(depPkgList
[i
]);
234 Iterator ismi
= smi
.iterator();
235 while(ismi
.hasNext()) {
236 ModuleIdentification mi
= (ModuleIdentification
)ismi
.next();
238 String
[] clsProduced
= getClassProduced(mi
);
240 boolean isPotential
= false;
241 for (int j
= 0; j
< clsProduced
.length
; ++j
) {
242 if (clsProduced
[j
] == null) {
245 if (clsProduced
[j
].equals(cls
)){
248 if (classProduced
.contains(clsProduced
[j
])) {
254 al
.add(mi
.getGuid() + " " + mi
.getVersion() + " " +
255 depPkgList
[i
].getGuid() + " " + depPkgList
[i
].getVersion());
263 private void removeInstance(String key
) {
264 ModuleIdentification mi
= getModuleId(key
);
266 // remove pcd information of instance from current ModuleSA
268 ffc
.removePcdDataFromLibraryInstance(moduleKey
, key
);
270 // remove class produced by this instance and add back these produced class to be bound.
272 String
[] clsProduced
= getClassProduced(mi
);
273 for (int i
= 0; i
< clsProduced
.length
; ++i
) {
275 classProduced
.remove(clsProduced
[i
]);
278 // remove class consumed by this instance. we do not need to bound it now.
280 String
[] clsConsumed
= getClassConsumed(mi
);
281 for (int i
= 0; i
< clsConsumed
.length
; ++i
) {
282 ArrayList
<String
> al
= classConsumed
.get(clsConsumed
[i
]);
285 classConsumed
.remove(clsConsumed
[i
]);
289 if (al
.size() == 0) {
290 classConsumed
.remove(clsConsumed
[i
]);
295 showClassToResolved();
299 private ModuleIdentification
getModuleId(String key
){
301 // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion into string array.
303 String
[] keyPart
= key
.split(" ");
304 Set
<PackageIdentification
> spi
= GlobalData
.getPackageList();
305 Iterator ispi
= spi
.iterator();
307 while(ispi
.hasNext()) {
308 PackageIdentification pi
= (PackageIdentification
)ispi
.next();
309 if ( !pi
.getGuid().equals(keyPart
[2]) || !pi
.getVersion().equals(keyPart
[3])){
312 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(pi
);
313 Iterator ismi
= smi
.iterator();
314 while(ismi
.hasNext()) {
315 ModuleIdentification mi
= (ModuleIdentification
)ismi
.next();
316 if (mi
.getGuid().equals(keyPart
[0]) && mi
.getVersion().equals(keyPart
[1])){
324 private String
[] getClassProduced(ModuleIdentification mi
){
327 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
328 SurfaceAreaQuery
.setDoc(m
);
329 String
[] clsProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED");
332 }catch (Exception e
) {
335 return new String
[0];
339 private String
[] getClassConsumed(ModuleIdentification mi
){
341 String
[] clsConsumed
= null;
343 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
344 SurfaceAreaQuery
.setDoc(m
);
345 clsConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED");
347 }catch (Exception e
) {
353 private void showClassToResolved(){
354 model2
.setRowCount(0);
355 if (classConsumed
.size() == 0) {
358 Iterator
<String
> li
= classConsumed
.keySet().iterator();
361 String
[] s
= {li
.next()};
362 if (classConsumed
.get(s
[0]) == null) {
365 if (classConsumed
.get(s
[0]).size() == 0) {
368 if (!classProduced
.contains(s
[0])){
372 model3
.setRowCount(0);
375 * This method initializes this
379 private void initialize() {
380 this.setSize(664, 515);
382 this.setTitle("Module Settings");
383 this.setContentPane(getJContentPane());
387 * This method initializes jContentPane
389 * @return javax.swing.JPanel
391 private JPanel
getJContentPane() {
392 if (jContentPane
== null) {
393 jContentPane
= new JPanel();
394 jContentPane
.setLayout(new BorderLayout());
395 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
396 jContentPane
.add(getJPanel3(), java
.awt
.BorderLayout
.SOUTH
);
402 * This method initializes jTabbedPane
404 * @return javax.swing.JTabbedPane
406 private JTabbedPane
getJTabbedPane() {
407 if (jTabbedPane
== null) {
408 jTabbedPane
= new JTabbedPane();
409 jTabbedPane
.addTab("PCD Build Definition", null, getJPanel(), null);
410 jTabbedPane
.addTab("Module SA Options", null, getJPanel8(), null);
411 jTabbedPane
.addTab("Libraries", null, getJPanel1(), null);
417 * This method initializes jPanel
419 * @return javax.swing.JPanel
421 private JPanel
getJPanel() {
422 if (jPanel
== null) {
423 jLabel
= new JLabel();
424 jLabel
.setText("PcdData");
425 jPanel
= new JPanel();
426 jPanel
.setLayout(new BorderLayout());
427 jPanel
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
428 jPanel
.add(getJScrollPane(), java
.awt
.BorderLayout
.CENTER
);
429 jPanel
.add(getJPanel2(), java
.awt
.BorderLayout
.SOUTH
);
430 jPanel
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
431 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
441 * This method initializes jPanel1
443 * @return javax.swing.JPanel
445 private JPanel
getJPanel1() {
446 if (jPanel1
== null) {
447 jPanel1
= new JPanel();
448 jPanel1
.setLayout(new BorderLayout());
449 jPanel1
.add(getJSplitPane(), java
.awt
.BorderLayout
.NORTH
);
450 jPanel1
.add(getJPanel6(), java
.awt
.BorderLayout
.SOUTH
);
451 jPanel1
.add(getJPanel7(), java
.awt
.BorderLayout
.CENTER
);
452 jPanel1
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
453 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
461 * This method initializes jScrollPane
463 * @return javax.swing.JScrollPane
465 private JScrollPane
getJScrollPane() {
466 if (jScrollPane
== null) {
467 jScrollPane
= new JScrollPane();
468 jScrollPane
.setViewportView(getJTable());
474 * This method initializes jTable
476 * @return javax.swing.JTable
478 private JTable
getJTable() {
479 if (jTable
== null) {
480 model
= new PartialEditableTableModel();
481 jTable
= new JTable(model
);
482 model
.addColumn("CName");
483 model
.addColumn("TokenSpaceGUID");
484 model
.addColumn("ItemType");
485 model
.addColumn("Token");
486 model
.addColumn("DataType");
487 model
.addColumn("DefaultValue");
489 jTable
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
490 jTable
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
491 public void valueChanged(ListSelectionEvent e
) {
493 if (e
.getValueIsAdjusting()){
496 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
497 if (lsm
.isSelectionEmpty()) {
501 // int selectedRow = lsm.getMinSelectionIndex();
508 jTable
.getModel().addTableModelListener(new TableModelListener() {
509 public void tableChanged(TableModelEvent arg0
) {
510 // TODO Auto-generated method stub
511 int row
= arg0
.getFirstRow();
512 TableModel m
= (TableModel
)arg0
.getSource();
513 if (arg0
.getType() == TableModelEvent
.INSERT
) {
515 // Set combo box values for item type according to pcd values added.
519 if (arg0
.getType() == TableModelEvent
.UPDATE
){
520 //ToDo Data Validition check.
530 * This method initializes jPanel2
532 * @return javax.swing.JPanel
534 private JPanel
getJPanel2() {
535 if (jPanel2
== null) {
536 jLabel5
= new JLabel();
537 jLabel5
.setText("PCD Description");
538 jPanel2
= new JPanel();
539 jPanel2
.add(jLabel5
, null);
540 jPanel2
.add(getJScrollPane1(), null);
546 * This method initializes jScrollPane1
548 * @return javax.swing.JScrollPane
550 private JScrollPane
getJScrollPane1() {
551 if (jScrollPane1
== null) {
552 jScrollPane1
= new JScrollPane();
553 jScrollPane1
.setPreferredSize(new java
.awt
.Dimension(500,100));
554 jScrollPane1
.setViewportView(getJTextArea());
560 * This method initializes jTextArea
562 * @return javax.swing.JTextArea
564 private JTextArea
getJTextArea() {
565 if (jTextArea
== null) {
566 jTextArea
= new JTextArea();
567 jTextArea
.setEditable(false);
573 * This method initializes jPanel3
575 * @return javax.swing.JPanel
577 private JPanel
getJPanel3() {
578 if (jPanel3
== null) {
579 FlowLayout flowLayout
= new FlowLayout();
580 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
581 jPanel3
= new JPanel();
582 jPanel3
.setLayout(flowLayout
);
583 jPanel3
.add(getJButton2(), null);
584 jPanel3
.add(getJButton3(), null);
590 * This method initializes jSplitPane
592 * @return javax.swing.JSplitPane
594 private JSplitPane
getJSplitPane() {
595 if (jSplitPane
== null) {
596 jSplitPane
= new JSplitPane();
597 jSplitPane
.setDividerLocation(200);
598 jSplitPane
.setLeftComponent(getJPanel4());
599 jSplitPane
.setRightComponent(getJPanel5());
600 jSplitPane
.setPreferredSize(new java
.awt
.Dimension(202,200));
606 * This method initializes jPanel4
608 * @return javax.swing.JPanel
610 private JPanel
getJPanel4() {
611 if (jPanel4
== null) {
612 jLabel1
= new JLabel();
613 jLabel1
.setText("Library Classes Consumed");
614 jPanel4
= new JPanel();
615 jPanel4
.add(jLabel1
, null);
616 jPanel4
.add(getJScrollPane3(), null);
622 * This method initializes jPanel5
624 * @return javax.swing.JPanel
626 private JPanel
getJPanel5() {
627 if (jPanel5
== null) {
628 jLabel2
= new JLabel();
629 jLabel2
.setText("Instances Available");
630 jPanel5
= new JPanel();
631 jPanel5
.add(jLabel2
, null);
632 jPanel5
.add(getJScrollPane4(), null);
638 * This method initializes jScrollPane2
640 * @return javax.swing.JScrollPane
642 private JScrollPane
getJScrollPane2() {
643 if (jScrollPane2
== null) {
644 jScrollPane2
= new JScrollPane();
645 jScrollPane2
.setPreferredSize(new java
.awt
.Dimension(453,150));
646 jScrollPane2
.setViewportView(getJTable1());
652 * This method initializes jTable1
654 * @return javax.swing.JTable
656 private JTable
getJTable1() {
657 if (jTable1
== null) {
658 model1
= new LibraryTableModel();
659 model1
.addColumn("Name");
660 model1
.addColumn("ModuleGUID");
661 model1
.addColumn("ModuleVersion");
662 model1
.addColumn("PackageGUID");
663 model1
.addColumn("PackageVersion");
664 jTable1
= new JTable(model1
);
666 jTable1
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
667 jTable1
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
668 public void valueChanged(ListSelectionEvent e
) {
669 int selectedRow1
= -1;
670 if (e
.getValueIsAdjusting()){
673 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
674 if (lsm
.isSelectionEmpty()) {
678 selectedRow1
= lsm
.getMinSelectionIndex();
691 * This method initializes jScrollPane3
693 * @return javax.swing.JScrollPane
695 private JScrollPane
getJScrollPane3() {
696 if (jScrollPane3
== null) {
697 jScrollPane3
= new JScrollPane();
698 jScrollPane3
.setPreferredSize(new java
.awt
.Dimension(200,170));
699 jScrollPane3
.setViewportView(getJTable2());
705 * This method initializes jTable2
707 * @return javax.swing.JTable
709 private JTable
getJTable2() {
710 if (jTable2
== null) {
711 model2
= new LibraryTableModel();
712 model2
.addColumn("LibraryClass");
713 jTable2
= new JTable(model2
);
715 jTable2
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
716 jTable2
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
717 public void valueChanged(ListSelectionEvent e
) {
718 if (e
.getValueIsAdjusting()){
721 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
722 if (lsm
.isSelectionEmpty()) {
726 int selectedRow2
= lsm
.getMinSelectionIndex();
727 if (selectedRow2
< 0) {
731 // display potential lib instances according to class selection
733 model3
.setRowCount(0);
734 String cls
= model2
.getValueAt(selectedRow2
, 0).toString();
735 ArrayList
<String
> al
= classInstanceMap
.get(cls
);
736 ListIterator
<String
> li
= al
.listIterator();
737 while(li
.hasNext()) {
738 String instance
= li
.next();
739 String
[] s
= {"", "", "", "", ""};
740 if (getModuleId(instance
) != null) {
741 s
[0] = getModuleId(instance
).getName();
744 String
[] instancePart
= instance
.split(" ");
745 for (int i
= 0; i
< instancePart
.length
; ++i
){
746 s
[i
+1] = instancePart
[i
];
759 * This method initializes jScrollPane4
761 * @return javax.swing.JScrollPane
763 private JScrollPane
getJScrollPane4() {
764 if (jScrollPane4
== null) {
765 jScrollPane4
= new JScrollPane();
766 jScrollPane4
.setPreferredSize(new java
.awt
.Dimension(450,170));
767 jScrollPane4
.setViewportView(getJTable3());
773 * This method initializes jTable3
775 * @return javax.swing.JTable
777 private JTable
getJTable3() {
778 if (jTable3
== null) {
779 model3
= new LibraryTableModel();
780 model3
.addColumn("Name");
781 model3
.addColumn("ModuleGUID");
782 model3
.addColumn("ModuleVersion");
783 model3
.addColumn("PackageGUID");
784 model3
.addColumn("PackageVersion");
785 jTable3
= new JTable(model3
);
787 jTable3
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
788 jTable3
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
789 public void valueChanged(ListSelectionEvent e
) {
790 int selectedRow3
= -1;
791 if (e
.getValueIsAdjusting()){
794 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
795 if (lsm
.isSelectionEmpty()) {
799 selectedRow3
= lsm
.getMinSelectionIndex();
810 * This method initializes jPanel6
812 * @return javax.swing.JPanel
814 private JPanel
getJPanel6() {
815 if (jPanel6
== null) {
816 jPanel6
= new JPanel();
822 * This method initializes jPanel7
824 * @return javax.swing.JPanel
826 private JPanel
getJPanel7() {
827 if (jPanel7
== null) {
828 jLabel4
= new JLabel();
829 jLabel4
.setText("Instance Description");
830 jLabel3
= new JLabel();
831 jLabel3
.setText("Selected Instances");
832 jPanel7
= new JPanel();
833 jPanel7
.add(jLabel4
, null);
834 jPanel7
.add(getJScrollPane5(), null);
835 jPanel7
.add(getJButton(), null);
836 jPanel7
.add(getJButton1(), null);
837 jPanel7
.add(jLabel3
, null);
838 jPanel7
.add(getJScrollPane2(), null);
844 * This method initializes jScrollPane5
846 * @return javax.swing.JScrollPane
848 private JScrollPane
getJScrollPane5() {
849 if (jScrollPane5
== null) {
850 jScrollPane5
= new JScrollPane();
851 jScrollPane5
.setPreferredSize(new java
.awt
.Dimension(300,50));
852 jScrollPane5
.setViewportView(getJTextArea1());
858 * This method initializes jTextArea1
860 * @return javax.swing.JTextArea
862 private JTextArea
getJTextArea1() {
863 if (jTextArea1
== null) {
864 jTextArea1
= new JTextArea();
865 jTextArea1
.setEditable(false);
871 * This method initializes jButton
873 * @return javax.swing.JButton
875 private JButton
getJButton() {
876 if (jButton
== null) {
877 jButton
= new JButton();
878 jButton
.setPreferredSize(new java
.awt
.Dimension(80,20));
879 jButton
.setText("Add");
880 jButton
.addActionListener(new java
.awt
.event
.ActionListener() {
881 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
882 int row
= jTable3
.getSelectedRow();
886 Object
[] s
= {model3
.getValueAt(row
, 0), model3
.getValueAt(row
, 1),
887 model3
.getValueAt(row
, 2), model3
.getValueAt(row
, 3),
888 model3
.getValueAt(row
, 4)};
890 String instanceValue
= model3
.getValueAt(row
, 1) + " " +
891 model3
.getValueAt(row
, 2) + " " +
892 model3
.getValueAt(row
, 3) + " " +
893 model3
.getValueAt(row
, 4);
895 // Add pcd information of selected instance to current moduleSA
897 ffc
.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue
), ffc
.getModuleSA(moduleKey
));
899 resolveLibraryInstances(instanceValue
);
907 * This method initializes jButton1
909 * @return javax.swing.JButton
911 private JButton
getJButton1() {
912 if (jButton1
== null) {
913 jButton1
= new JButton();
914 jButton1
.setPreferredSize(new java
.awt
.Dimension(80,20));
915 jButton1
.setText("Delete");
916 jButton1
.addActionListener(new java
.awt
.event
.ActionListener() {
917 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
918 int row
= jTable1
.getSelectedRow();
922 removeInstance(model1
.getValueAt(row
, 1) + " " +
923 model1
.getValueAt(row
, 2) + " " +
924 model1
.getValueAt(row
, 3) + " " +
925 model1
.getValueAt(row
, 4));
926 model1
.removeRow(row
);
935 * This method initializes jButton2
937 * @return javax.swing.JButton
939 private JButton
getJButton2() {
940 if (jButton2
== null) {
941 jButton2
= new JButton();
942 jButton2
.setPreferredSize(new java
.awt
.Dimension(80,20));
943 jButton2
.setText("Ok");
944 jButton2
.addActionListener(this);
950 * This method initializes jButton3
952 * @return javax.swing.JButton
954 private JButton
getJButton3() {
955 if (jButton3
== null) {
956 jButton3
= new JButton();
957 jButton3
.setPreferredSize(new java
.awt
.Dimension(80,20));
958 jButton3
.setText("Cancel");
959 jButton3
.setVisible(false);
963 public void actionPerformed(ActionEvent arg0
) {
965 if (arg0
.getSource() == jButton2
) {
966 ffc
.removeLibraryInstances(moduleKey
);
967 for (int i
= 0; i
< model1
.getRowCount(); ++i
) {
968 String mg
= model1
.getValueAt(i
, 1)+"";
969 String mv
= model1
.getValueAt(i
, 2)+"";
970 String pg
= model1
.getValueAt(i
, 3)+"";
971 String pv
= model1
.getValueAt(i
, 4)+"";
972 ffc
.genLibraryInstance(mg
, mv
, pg
, pv
, moduleKey
);
974 this.setVisible(false);
978 * This method initializes jPanel8
980 * @return javax.swing.JPanel
982 private JPanel
getJPanel8() {
983 if (jPanel8
== null) {
984 jLabel8
= new JLabel();
985 jLabel8
.setText("FFS Format Key");
986 jLabel7
= new JLabel();
987 jLabel7
.setText("FFS File GUID");
988 jLabel6
= new JLabel();
989 jLabel6
.setText("FV Binding");
990 jPanel8
= new JPanel();
991 jPanel8
.add(jLabel6
, null);
992 jPanel8
.add(getJTextField(), null);
993 jPanel8
.add(jLabel7
, null);
994 jPanel8
.add(getJTextField1(), null);
995 jPanel8
.add(jLabel8
, null);
996 jPanel8
.add(getJTextField2(), null);
997 jPanel8
.add(getJScrollPane6(), null);
1002 * This method initializes jTextField
1004 * @return javax.swing.JTextField
1006 private JTextField
getJTextField() {
1007 if (jTextField
== null) {
1008 jTextField
= new JTextField();
1009 jTextField
.setPreferredSize(new java
.awt
.Dimension(100,20));
1014 * This method initializes jTextField1
1016 * @return javax.swing.JTextField
1018 private JTextField
getJTextField1() {
1019 if (jTextField1
== null) {
1020 jTextField1
= new JTextField();
1021 jTextField1
.setPreferredSize(new java
.awt
.Dimension(100,20));
1026 * This method initializes jTextField2
1028 * @return javax.swing.JTextField
1030 private JTextField
getJTextField2() {
1031 if (jTextField2
== null) {
1032 jTextField2
= new JTextField();
1033 jTextField2
.setPreferredSize(new java
.awt
.Dimension(100,20));
1038 * This method initializes jScrollPane6
1040 * @return javax.swing.JScrollPane
1042 private JScrollPane
getJScrollPane6() {
1043 if (jScrollPane6
== null) {
1044 jScrollPane6
= new JScrollPane();
1045 jScrollPane6
.setPreferredSize(new java
.awt
.Dimension(600,200));
1046 jScrollPane6
.setViewportView(getJTable4());
1048 return jScrollPane6
;
1051 * This method initializes jTable4
1053 * @return javax.swing.JTable
1055 private JTable
getJTable4() {
1056 if (jTable4
== null) {
1057 jTable4
= new JTable();
1062 } // @jve:decl-index=0:visual-constraint="10,10"
1064 class PartialEditableTableModel
extends DefaultTableModel
{
1068 private static final long serialVersionUID
= 1L;
1070 public boolean isCellEditable(int row
, int col
) {
1081 class LibraryTableModel
extends DefaultTableModel
{
1085 private static final long serialVersionUID
= 1L;
1087 public boolean isCellEditable(int row
, int col
) {