1 package org
.tianocore
.frameworkwizard
.platform
.ui
;
3 import java
.awt
.BorderLayout
;
4 import java
.awt
.Dimension
;
5 import java
.awt
.Toolkit
;
7 import javax
.swing
.JFrame
;
8 import javax
.swing
.JOptionPane
;
9 import javax
.swing
.JPanel
;
10 import javax
.swing
.JDialog
;
11 import javax
.swing
.JTabbedPane
;
12 import javax
.swing
.JLabel
;
13 import javax
.swing
.JScrollPane
;
14 import javax
.swing
.JTable
;
15 import javax
.swing
.JTextArea
;
16 import javax
.swing
.JSplitPane
;
17 import javax
.swing
.JButton
;
18 import javax
.swing
.ListSelectionModel
;
19 import javax
.swing
.event
.ListSelectionEvent
;
20 import javax
.swing
.event
.ListSelectionListener
;
21 import javax
.swing
.event
.TableModelEvent
;
22 import javax
.swing
.event
.TableModelListener
;
23 import javax
.swing
.table
.DefaultTableModel
;
24 import javax
.swing
.table
.TableModel
;
26 import org
.apache
.xmlbeans
.XmlObject
;
27 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
28 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
29 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.GlobalData
;
30 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.SurfaceAreaQuery
;
31 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.ModuleIdentification
;
32 import org
.tianocore
.frameworkwizard
.platform
.ui
.id
.PackageIdentification
;
34 import java
.awt
.FlowLayout
;
35 import java
.awt
.event
.ActionEvent
;
36 import java
.awt
.event
.ActionListener
;
37 import java
.util
.ArrayList
;
38 import java
.util
.HashMap
;
39 import java
.util
.Iterator
;
40 import java
.util
.ListIterator
;
43 import java
.util
.Vector
;
45 import javax
.swing
.JTextField
;
46 import java
.awt
.GridLayout
;
47 import javax
.swing
.JComboBox
;
49 public class FpdModuleSA
extends JDialog
implements ActionListener
{
54 private static final long serialVersionUID
= 1L;
56 private JPanel jContentPane
= null;
57 private JTabbedPane jTabbedPane
= null;
58 private JPanel jPanel
= null;
59 private JPanel jPanel1
= null;
60 private JLabel jLabel
= null;
61 private JScrollPane jScrollPane
= null;
62 private JTable jTable
= null;
63 private JPanel jPanel2
= null;
64 private JScrollPane jScrollPane1
= null;
65 private JTextArea jTextArea
= null;
66 private JPanel jPanel3
= null;
67 private JSplitPane jSplitPane
= null;
68 private JPanel jPanel4
= null;
69 private JPanel jPanel5
= null;
70 private JLabel jLabel1
= null;
71 private JLabel jLabel2
= null;
72 private JScrollPane jScrollPane2
= null;
73 private JTable jTable1
= null;
74 private JScrollPane jScrollPane3
= null;
75 private JTable jTable2
= null;
76 private JScrollPane jScrollPane4
= null;
77 private JTable jTable3
= null;
78 private JPanel jPanel6
= null;
79 private JPanel jPanel7
= null;
80 private JScrollPane jScrollPane5
= null;
81 private JTextArea jTextArea1
= null;
82 private JLabel jLabel3
= null;
83 private JLabel jLabel4
= null;
84 private JButton jButton
= null;
85 private JButton jButton1
= null;
86 private JLabel jLabel5
= null;
87 private JButton jButton2
= null;
88 private JButton jButton3
= null;
89 private PartialEditableTableModel model
= null;
90 private LibraryTableModel model1
= null;
91 private LibraryTableModel model2
= null;
92 private LibraryTableModel model3
= null;
93 private DefaultTableModel optionsTableModel
= null;
94 private FpdFileContents ffc
= null;
95 private String moduleKey
= null;
96 private HashMap
<String
, ArrayList
<String
>> classInstanceMap
= null;
97 private ArrayList
<String
> classProduced
= null;
98 private HashMap
<String
, ArrayList
<String
>> classConsumed
= null;
99 private JPanel jPanel8
= null;
100 private JLabel jLabel6
= null;
101 private JTextField jTextFieldFvBinding
= null;
102 private JLabel jLabel7
= null;
103 private JTextField jTextFieldFileGuid
= null;
104 private JLabel jLabel8
= null;
105 private JTextField jTextFieldFfsKey
= null;
106 private JScrollPane jScrollPane6
= null;
107 private JTable jTable4
= null;
108 private JButton jButton4
= null;
109 private JButton jButton5
= null;
110 private JPanel jPanel9
= null;
111 private JPanel jPanel10
= null;
112 private JPanel jPanel11
= null;
113 private JPanel jPanel12
= null;
114 private JLabel jLabel9
= null;
115 private JComboBox jComboBox
= null;
116 private JLabel jLabel10
= null;
117 private JTextField jTextField3
= null;
118 private JLabel jLabel11
= null;
119 private JTextField jTextField4
= null;
120 private JButton jButton6
= null;
121 private JComboBox jComboBox1
= null;
122 private OpeningPlatformType docConsole
= null;
123 private JLabel jLabel12
= null;
125 * This is the default constructor
127 public FpdModuleSA() {
131 public FpdModuleSA(FpdFileContents ffc
) {
136 public void setKey(String k
, int i
, OpeningPlatformType dc
){
138 this.docConsole
= dc
;
139 jTabbedPane
.setSelectedIndex(0);
140 initPcdBuildDefinition(i
);
144 init will be called each time FpdModuleSA object is to be shown.
145 @param key Module information.
147 public void initPcdBuildDefinition(int i
) {
149 // display pcd for key.
151 model
.setRowCount(0);
152 int pcdCount
= ffc
.getPcdDataCount(i
);
154 String
[][] saa
= new String
[pcdCount
][7];
155 ffc
.getPcdData(i
, saa
);
156 for (int j
= 0; j
< saa
.length
; ++j
) {
157 model
.addRow(saa
[j
]);
162 public void initLibraries(String key
) {
164 // display library classes that need to be resolved. also potential instances for them.
166 resolveLibraryInstances(moduleKey
);
168 // display lib instances already selected for key
170 model1
.setRowCount(0);
171 int instanceCount
= ffc
.getLibraryInstancesCount(key
);
172 if (instanceCount
!= 0) {
173 String
[][] saa
= new String
[instanceCount
][5];
174 ffc
.getLibraryInstances(key
, saa
);
175 for (int i
= 0; i
< saa
.length
; ++i
) {
176 ModuleIdentification mi
= getModuleId(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3] + " " + saa
[i
][4]);
178 saa
[i
][0] = mi
.getName();
179 saa
[i
][2] = mi
.getVersion();
180 saa
[i
][4] = mi
.getPackage().getVersion();
182 // re-evaluate lib instance usage when adding a already-selected lib instance.
184 resolveLibraryInstances(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3] + " " + saa
[i
][4]);
185 model1
.addRow(saa
[i
]);
193 public void initModuleSAOptions(String key
) {
195 // display module SA options
197 String fvBinding
= ffc
.getFvBinding(key
);
198 if (fvBinding
!= null) {
199 jTextFieldFvBinding
.setText(fvBinding
);
201 String fileGuid
= ffc
.getFfsFileNameGuid(key
);
202 if (fileGuid
!= null) {
203 jTextFieldFileGuid
.setText(fileGuid
);
205 String ffsKey
= ffc
.getFfsFormatKey(key
);
206 if (ffsKey
!= null) {
207 jTextFieldFfsKey
.setText(ffsKey
);
210 optionsTableModel
.setRowCount(0);
211 String
[][] saa
= new String
[ffc
.getModuleSAOptionsCount(key
)][6];
212 ffc
.getModuleSAOptions(key
, saa
);
213 for (int i
= 0; i
< saa
.length
; ++i
) {
214 optionsTableModel
.addRow(saa
[i
]);
218 private void resolveLibraryInstances(String key
) {
219 ModuleIdentification mi
= getModuleId(key
);
220 PackageIdentification
[] depPkgList
= null;
222 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
223 SurfaceAreaQuery
.setDoc(m
);
225 // Get dependency pkg list into which we will search lib instances.
227 depPkgList
= SurfaceAreaQuery
.getDependencePkg(null);
229 // Get the lib class consumed, produced by this module itself.
231 String
[] classConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED");
233 if (this.classConsumed
== null) {
234 this.classConsumed
= new HashMap
<String
, ArrayList
<String
>>();
237 for(int i
= 0; i
< classConsumed
.length
; ++i
){
238 ArrayList
<String
> consumedBy
= this.classConsumed
.get(classConsumed
[i
]);
239 if (consumedBy
== null) {
240 consumedBy
= new ArrayList
<String
>();
243 this.classConsumed
.put(classConsumed
[i
], consumedBy
);
246 String
[] classProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED");
247 if (this.classProduced
== null) {
248 this.classProduced
= new ArrayList
<String
>();
250 for(int i
= 0; i
< classProduced
.length
; ++i
){
251 if (!this.classProduced
.contains(classProduced
[i
])){
252 this.classProduced
.add(classProduced
[i
]);
256 // Get classes unresolved
258 // Iterator<String> lip = this.classProduced.listIterator();
259 // while(lip.hasNext()){
260 // String clsProduced = lip.next();
261 // this.classConsumed.remove(clsProduced);
265 // find potential instances in all dependency pkgs for classes still in classConsumed.
267 if (classInstanceMap
== null){
268 classInstanceMap
= new HashMap
<String
, ArrayList
<String
>>();
270 Iterator
<String
> lic
= this.classConsumed
.keySet().iterator();
271 while(lic
.hasNext()){
272 String cls
= lic
.next();
273 if (this.classProduced
.contains(cls
) || classInstanceMap
.containsKey(cls
)) {
276 ArrayList
<String
> instances
= getInstancesForClass(cls
, depPkgList
);
277 if (instances
.size() == 0){
278 JOptionPane
.showMessageDialog(frame
, "No Applicable Instance for Library Class " +
279 cls
+ ", Platform Build will Fail.");
281 classInstanceMap
.put(cls
, instances
);
285 showClassToResolved();
292 private ArrayList
<String
> getInstancesForClass(String cls
, PackageIdentification
[] depPkgList
) throws Exception
{
293 ArrayList
<String
> al
= new ArrayList
<String
>();
295 for (int i
= 0; i
< depPkgList
.length
; ++i
) {
296 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(depPkgList
[i
]);
297 Iterator ismi
= smi
.iterator();
298 while(ismi
.hasNext()) {
299 ModuleIdentification mi
= (ModuleIdentification
)ismi
.next();
301 String
[] clsProduced
= getClassProduced(mi
);
303 boolean isPotential
= false;
304 for (int j
= 0; j
< clsProduced
.length
; ++j
) {
305 if (clsProduced
[j
] == null) {
308 if (clsProduced
[j
].equals(cls
)){
311 if (classProduced
.contains(clsProduced
[j
])) {
317 al
.add(mi
.getGuid() + " " + mi
.getVersion() + " " +
318 depPkgList
[i
].getGuid() + " " + depPkgList
[i
].getVersion());
326 private void removeInstance(String key
) {
327 ModuleIdentification mi
= getModuleId(key
);
329 // remove pcd information of instance from current ModuleSA
331 ffc
.removePcdData(moduleKey
, mi
);
333 // remove class produced by this instance and add back these produced class to be bound.
335 String
[] clsProduced
= getClassProduced(mi
);
336 for (int i
= 0; i
< clsProduced
.length
; ++i
) {
338 classProduced
.remove(clsProduced
[i
]);
341 // remove class consumed by this instance. we do not need to bound it now.
343 String
[] clsConsumed
= getClassConsumed(mi
);
344 for (int i
= 0; i
< clsConsumed
.length
; ++i
) {
345 ArrayList
<String
> al
= classConsumed
.get(clsConsumed
[i
]);
348 classConsumed
.remove(clsConsumed
[i
]);
352 if (al
.size() == 0) {
353 classConsumed
.remove(clsConsumed
[i
]);
358 showClassToResolved();
362 private ModuleIdentification
getModuleId(String key
){
364 // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.
366 String
[] keyPart
= key
.split(" ");
367 Set
<PackageIdentification
> spi
= GlobalData
.getPackageList();
368 Iterator ispi
= spi
.iterator();
370 while(ispi
.hasNext()) {
371 PackageIdentification pi
= (PackageIdentification
)ispi
.next();
372 if ( !pi
.getGuid().equals(keyPart
[2])){
376 if (keyPart
[3] != null && keyPart
[3].length() > 0 && !keyPart
[3].equals("null")){
377 if(!pi
.getVersion().equals(keyPart
[3])){
381 Set
<ModuleIdentification
> smi
= GlobalData
.getModules(pi
);
382 Iterator ismi
= smi
.iterator();
383 while(ismi
.hasNext()) {
384 ModuleIdentification mi
= (ModuleIdentification
)ismi
.next();
385 if (mi
.getGuid().equals(keyPart
[0])){
386 if (keyPart
[1] != null && keyPart
[1].length() > 0 && !keyPart
[1].equals("null")){
387 if(!mi
.getVersion().equals(keyPart
[1])){
399 private String
[] getClassProduced(ModuleIdentification mi
){
402 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
403 SurfaceAreaQuery
.setDoc(m
);
404 String
[] clsProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED");
407 }catch (Exception e
) {
410 return new String
[0];
414 private String
[] getClassConsumed(ModuleIdentification mi
){
416 String
[] clsConsumed
= null;
418 Map
<String
, XmlObject
> m
= GlobalData
.getNativeMsa(mi
);
419 SurfaceAreaQuery
.setDoc(m
);
420 clsConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED");
422 }catch (Exception e
) {
428 private void showClassToResolved(){
429 model2
.setRowCount(0);
430 if (classConsumed
.size() == 0) {
433 Iterator
<String
> li
= classConsumed
.keySet().iterator();
436 String
[] s
= {li
.next()};
437 if (classConsumed
.get(s
[0]) == null) {
440 if (classConsumed
.get(s
[0]).size() == 0) {
443 if (!classProduced
.contains(s
[0])){
447 model3
.setRowCount(0);
450 * This method initializes this
454 private void initialize() {
455 this.setSize(664, 515);
458 this.setTitle("Module Settings");
459 this.setContentPane(getJContentPane());
463 * This method initializes jContentPane
465 * @return javax.swing.JPanel
467 private JPanel
getJContentPane() {
468 if (jContentPane
== null) {
469 jContentPane
= new JPanel();
470 jContentPane
.setLayout(new BorderLayout());
471 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
472 jContentPane
.add(getJPanel3(), java
.awt
.BorderLayout
.SOUTH
);
478 * This method initializes jTabbedPane
480 * @return javax.swing.JTabbedPane
482 private JTabbedPane
getJTabbedPane() {
483 if (jTabbedPane
== null) {
484 jTabbedPane
= new JTabbedPane();
485 jTabbedPane
.addTab("PCD Build Definition", null, getJPanel(), null);
486 jTabbedPane
.addTab("Module SA Options", null, getJPanel8(), null);
487 jTabbedPane
.addTab("Libraries", null, getJPanel1(), null);
493 * This method initializes jPanel
495 * @return javax.swing.JPanel
497 private JPanel
getJPanel() {
498 if (jPanel
== null) {
499 jLabel
= new JLabel();
500 jLabel
.setText("PcdData");
501 jPanel
= new JPanel();
502 jPanel
.setLayout(new BorderLayout());
503 jPanel
.add(jLabel
, java
.awt
.BorderLayout
.NORTH
);
504 jPanel
.add(getJScrollPane(), java
.awt
.BorderLayout
.CENTER
);
505 jPanel
.add(getJPanel2(), java
.awt
.BorderLayout
.SOUTH
);
506 jPanel
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
507 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
508 // initPcdBuildDefinition(moduleKey);
517 * This method initializes jPanel1
519 * @return javax.swing.JPanel
521 private JPanel
getJPanel1() {
522 if (jPanel1
== null) {
523 jPanel1
= new JPanel();
524 jPanel1
.setLayout(new BorderLayout());
525 jPanel1
.add(getJSplitPane(), java
.awt
.BorderLayout
.NORTH
);
526 jPanel1
.add(getJPanel6(), java
.awt
.BorderLayout
.SOUTH
);
527 jPanel1
.add(getJPanel7(), java
.awt
.BorderLayout
.CENTER
);
528 jPanel1
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
529 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
530 initLibraries(moduleKey
);
538 * This method initializes jScrollPane
540 * @return javax.swing.JScrollPane
542 private JScrollPane
getJScrollPane() {
543 if (jScrollPane
== null) {
544 jScrollPane
= new JScrollPane();
545 jScrollPane
.setViewportView(getJTable());
551 * This method initializes jTable
553 * @return javax.swing.JTable
555 private JTable
getJTable() {
556 if (jTable
== null) {
557 model
= new PartialEditableTableModel();
558 jTable
= new JTable(model
);
559 jTable
.setRowHeight(20);
560 jTable
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
561 model
.addColumn("CName");
562 model
.addColumn("TokenSpaceGUID");
563 model
.addColumn("ItemType");
564 model
.addColumn("Token");
565 model
.addColumn("MaxDatumSize");
566 model
.addColumn("DataType");
567 model
.addColumn("DefaultValue");
569 jTable
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
570 jTable
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
571 public void valueChanged(ListSelectionEvent e
) {
573 if (e
.getValueIsAdjusting()){
576 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
577 if (lsm
.isSelectionEmpty()) {
581 int selectedRow
= lsm
.getMinSelectionIndex();
582 String cName
= jTable
.getValueAt(selectedRow
, 0)+"";
583 String
[] pcdInfo
= {"", ""};
584 getPcdInfo(cName
, pcdInfo
);
585 jTextArea
.setText(pcdInfo
[0]);
586 initComboBox(pcdInfo
[1]);
587 jComboBox
.setSelectedItem(pcdInfo
[1]);
588 jTextField3
.setEnabled(true);
589 jTextField3
.setVisible(true);
590 jTextField3
.setText(jTable
.getValueAt(selectedRow
, 4)+"");
591 jTextField4
.setEnabled(true);
592 jTextField4
.setText(jTable
.getValueAt(selectedRow
, 6)+"");
593 if (jTable
.getValueAt(selectedRow
, 5).equals("VOID*")) {
594 if (pcdInfo
[1].equals("FEATURE_FLAG")) {
595 jTextField3
.setVisible(false);
597 else if (pcdInfo
[1].equals("FIXED_AT_BUILD")) {
599 jTextField3
.setEnabled(false);
600 jTextField3
.setText(ffc
.setMaxSizeForPointer(jTable
.getValueAt(selectedRow
, 6)+"")+"");
602 catch(Exception except
){
603 JOptionPane
.showMessageDialog(frame
, "Unacceptable PCD Value: " + except
.getMessage());
607 jTextField3
.setText(jTable
.getValueAt(selectedRow
, 4)+"");
611 jTextField3
.setEnabled(false);
614 if (!jTable
.getValueAt(selectedRow
, 2).equals("DYNAMIC") && !jTable
.getValueAt(selectedRow
, 2).equals("DYNAMIC_EX")) {
615 jTextField4
.setText(jTable
.getValueAt(selectedRow
, 6)+"");
616 if (jTable
.getValueAt(selectedRow
, 2).equals("FEATURE_FLAG")){
617 jTextField4
.setVisible(false);
618 jComboBox1
.setVisible(true);
619 jComboBox1
.setSelectedItem(jTable
.getValueAt(selectedRow
, 6)+"");
622 jTextField4
.setVisible(true);
623 jTextField4
.setEnabled(true);
624 jComboBox1
.setVisible(false);
628 jTextField4
.setEnabled(false);
636 jTable
.getModel().addTableModelListener(new TableModelListener() {
637 public void tableChanged(TableModelEvent arg0
) {
638 // TODO Auto-generated method stub
639 // int row = arg0.getFirstRow();
640 // TableModel m = (TableModel)arg0.getSource();
642 if (arg0
.getType() == TableModelEvent
.UPDATE
){
643 //update xml doc here.
652 private void initComboBox(String originalType
) {
653 jComboBox
.removeAllItems();
654 jComboBox
.addItem(originalType
);
655 if (originalType
.equals("PATCHABLE_IN_MODULE")) {
656 jComboBox
.addItem("FIXED_AT_BUILD");
658 if (originalType
.equals("DYNAMIC")) {
659 jComboBox
.addItem("FIXED_AT_BUILD");
660 jComboBox
.addItem("PATCHABLE_IN_MODULE");
664 private void getPcdInfo(String cName
, String
[] sa
) {
665 String
[][] saa
= new String
[ffc
.getLibraryInstancesCount(moduleKey
)][5];
666 ffc
.getLibraryInstances(moduleKey
, saa
);
669 if (ffc
.getPcdBuildDataInfo(getModuleId(moduleKey
), cName
, sa
)) {
672 for (int j
= 0; j
< saa
.length
; ++j
) {
673 if (ffc
.getPcdBuildDataInfo(getModuleId(saa
[j
][1] + " " + saa
[j
][2] + " " + saa
[j
][3] + " " + saa
[j
][4]),
680 JOptionPane
.showMessageDialog(this, "Get PCD details fail: " + e
.getMessage());
685 * This method initializes jPanel2
687 * @return javax.swing.JPanel
689 private JPanel
getJPanel2() {
690 if (jPanel2
== null) {
691 jLabel5
= new JLabel();
692 jLabel5
.setText("PCD Description");
693 jPanel2
= new JPanel();
694 jPanel2
.setPreferredSize(new java
.awt
.Dimension(607,200));
695 jPanel2
.add(jLabel5
, null);
696 jPanel2
.add(getJScrollPane1(), null);
697 jPanel2
.add(getJPanel9(), null);
703 * This method initializes jScrollPane1
705 * @return javax.swing.JScrollPane
707 private JScrollPane
getJScrollPane1() {
708 if (jScrollPane1
== null) {
709 jScrollPane1
= new JScrollPane();
710 jScrollPane1
.setPreferredSize(new java
.awt
.Dimension(500,100));
711 jScrollPane1
.setViewportView(getJTextArea());
717 * This method initializes jTextArea
719 * @return javax.swing.JTextArea
721 private JTextArea
getJTextArea() {
722 if (jTextArea
== null) {
723 jTextArea
= new JTextArea();
724 jTextArea
.setEditable(false);
730 * This method initializes jPanel3
732 * @return javax.swing.JPanel
734 private JPanel
getJPanel3() {
735 if (jPanel3
== null) {
736 FlowLayout flowLayout
= new FlowLayout();
737 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
738 jPanel3
= new JPanel();
739 jPanel3
.setLayout(flowLayout
);
740 jPanel3
.add(getJButton2(), null);
741 jPanel3
.add(getJButton3(), null);
747 * This method initializes jSplitPane
749 * @return javax.swing.JSplitPane
751 private JSplitPane
getJSplitPane() {
752 if (jSplitPane
== null) {
753 jSplitPane
= new JSplitPane();
754 jSplitPane
.setDividerLocation(200);
755 jSplitPane
.setLeftComponent(getJPanel4());
756 jSplitPane
.setRightComponent(getJPanel5());
757 jSplitPane
.setPreferredSize(new java
.awt
.Dimension(202,200));
763 * This method initializes jPanel4
765 * @return javax.swing.JPanel
767 private JPanel
getJPanel4() {
768 if (jPanel4
== null) {
769 jLabel1
= new JLabel();
770 jLabel1
.setText("Library Classes Uninstantiated");
771 jPanel4
= new JPanel();
772 jPanel4
.add(jLabel1
, null);
773 jPanel4
.add(getJScrollPane3(), null);
779 * This method initializes jPanel5
781 * @return javax.swing.JPanel
783 private JPanel
getJPanel5() {
784 if (jPanel5
== null) {
785 jLabel2
= new JLabel();
786 jLabel2
.setText("Instances Available");
787 jPanel5
= new JPanel();
788 jPanel5
.add(jLabel2
, null);
789 jPanel5
.add(getJScrollPane4(), null);
795 * This method initializes jScrollPane2
797 * @return javax.swing.JScrollPane
799 private JScrollPane
getJScrollPane2() {
800 if (jScrollPane2
== null) {
801 jScrollPane2
= new JScrollPane();
802 jScrollPane2
.setPreferredSize(new java
.awt
.Dimension(453,150));
803 jScrollPane2
.setViewportView(getJTable1());
809 * This method initializes jTable1
811 * @return javax.swing.JTable
813 private JTable
getJTable1() {
814 if (jTable1
== null) {
815 model1
= new LibraryTableModel();
816 model1
.addColumn("Name");
817 model1
.addColumn("ModuleGUID");
818 model1
.addColumn("ModuleVersion");
819 model1
.addColumn("PackageGUID");
820 model1
.addColumn("PackageVersion");
821 jTable1
= new JTable(model1
);
822 jTable1
.setRowHeight(20);
823 jTable1
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
824 jTable1
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
831 * This method initializes jScrollPane3
833 * @return javax.swing.JScrollPane
835 private JScrollPane
getJScrollPane3() {
836 if (jScrollPane3
== null) {
837 jScrollPane3
= new JScrollPane();
838 jScrollPane3
.setPreferredSize(new java
.awt
.Dimension(200,170));
839 jScrollPane3
.setViewportView(getJTable2());
845 * This method initializes jTable2
847 * @return javax.swing.JTable
849 private JTable
getJTable2() {
850 if (jTable2
== null) {
851 model2
= new LibraryTableModel();
852 model2
.addColumn("LibraryClass");
853 jTable2
= new JTable(model2
);
854 jTable2
.setRowHeight(20);
855 jTable2
.setShowGrid(false);
856 jTable2
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
857 jTable2
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
858 public void valueChanged(ListSelectionEvent e
) {
859 if (e
.getValueIsAdjusting()){
862 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
863 if (lsm
.isSelectionEmpty()) {
867 int selectedRow2
= lsm
.getMinSelectionIndex();
868 if (selectedRow2
< 0) {
872 // display potential lib instances according to class selection
874 model3
.setRowCount(0);
875 String cls
= model2
.getValueAt(selectedRow2
, 0).toString();
876 ArrayList
<String
> al
= classInstanceMap
.get(cls
);
877 ListIterator
<String
> li
= al
.listIterator();
878 while(li
.hasNext()) {
879 String instance
= li
.next();
880 String
[] s
= {"", "", "", "", ""};
881 if (getModuleId(instance
) != null) {
882 s
[0] = getModuleId(instance
).getName();
885 String
[] instancePart
= instance
.split(" ");
886 for (int i
= 0; i
< instancePart
.length
; ++i
){
887 s
[i
+1] = instancePart
[i
];
900 * This method initializes jScrollPane4
902 * @return javax.swing.JScrollPane
904 private JScrollPane
getJScrollPane4() {
905 if (jScrollPane4
== null) {
906 jScrollPane4
= new JScrollPane();
907 jScrollPane4
.setPreferredSize(new java
.awt
.Dimension(430,170));
908 jScrollPane4
.setViewportView(getJTable3());
914 * This method initializes jTable3
916 * @return javax.swing.JTable
918 private JTable
getJTable3() {
919 if (jTable3
== null) {
920 model3
= new LibraryTableModel();
921 model3
.addColumn("Name");
922 model3
.addColumn("ModuleGUID");
923 model3
.addColumn("ModuleVersion");
924 model3
.addColumn("PackageGUID");
925 model3
.addColumn("PackageVersion");
926 jTable3
= new JTable(model3
);
927 jTable3
.setRowHeight(20);
928 jTable3
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
929 jTable3
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
936 * This method initializes jPanel6
938 * @return javax.swing.JPanel
940 private JPanel
getJPanel6() {
941 if (jPanel6
== null) {
942 jPanel6
= new JPanel();
948 * This method initializes jPanel7
950 * @return javax.swing.JPanel
952 private JPanel
getJPanel7() {
953 if (jPanel7
== null) {
954 jLabel4
= new JLabel();
955 jLabel4
.setText("Instance Description");
956 jLabel3
= new JLabel();
957 jLabel3
.setText("Selected Instances");
958 jPanel7
= new JPanel();
959 jPanel7
.add(jLabel4
, null);
960 jPanel7
.add(getJScrollPane5(), null);
961 jPanel7
.add(getJButton(), null);
962 jPanel7
.add(getJButton1(), null);
963 jPanel7
.add(jLabel3
, null);
964 jPanel7
.add(getJScrollPane2(), null);
970 * This method initializes jScrollPane5
972 * @return javax.swing.JScrollPane
974 private JScrollPane
getJScrollPane5() {
975 if (jScrollPane5
== null) {
976 jScrollPane5
= new JScrollPane();
977 jScrollPane5
.setPreferredSize(new java
.awt
.Dimension(300,50));
978 jScrollPane5
.setViewportView(getJTextArea1());
984 * This method initializes jTextArea1
986 * @return javax.swing.JTextArea
988 private JTextArea
getJTextArea1() {
989 if (jTextArea1
== null) {
990 jTextArea1
= new JTextArea();
991 jTextArea1
.setEditable(false);
997 * This method initializes jButton
999 * @return javax.swing.JButton
1001 private JButton
getJButton() {
1002 if (jButton
== null) {
1003 jButton
= new JButton();
1004 jButton
.setPreferredSize(new java
.awt
.Dimension(80,20));
1005 jButton
.setText("Add");
1006 jButton
.addActionListener(new java
.awt
.event
.ActionListener() {
1007 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1008 int row
= jTable3
.getSelectedRow();
1012 docConsole
.setSaved(false);
1013 Object
[] s
= {model3
.getValueAt(row
, 0), model3
.getValueAt(row
, 1),
1014 model3
.getValueAt(row
, 2), model3
.getValueAt(row
, 3),
1015 model3
.getValueAt(row
, 4)};
1017 String instanceValue
= model3
.getValueAt(row
, 1) + " " +
1018 model3
.getValueAt(row
, 2) + " " +
1019 model3
.getValueAt(row
, 3) + " " +
1020 model3
.getValueAt(row
, 4);
1021 ModuleIdentification libMi
= getModuleId(instanceValue
);
1022 ffc
.genLibraryInstance(libMi
, moduleKey
);
1024 // Add pcd information of selected instance to current moduleSA
1027 ffc
.addFrameworkModulesPcdBuildDefs(libMi
, null, ffc
.getModuleSA(moduleKey
));
1029 catch (Exception exception
) {
1030 JOptionPane
.showMessageDialog(frame
, "PCD Insertion Fail. " + exception
.getMessage());
1032 resolveLibraryInstances(instanceValue
);
1040 * This method initializes jButton1
1042 * @return javax.swing.JButton
1044 private JButton
getJButton1() {
1045 if (jButton1
== null) {
1046 jButton1
= new JButton();
1047 jButton1
.setPreferredSize(new java
.awt
.Dimension(80,20));
1048 jButton1
.setText("Delete");
1049 jButton1
.addActionListener(new java
.awt
.event
.ActionListener() {
1050 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1051 int row
= jTable1
.getSelectedRow();
1055 docConsole
.setSaved(false);
1056 removeInstance(model1
.getValueAt(row
, 1) + " " +
1057 model1
.getValueAt(row
, 2) + " " +
1058 model1
.getValueAt(row
, 3) + " " +
1059 model1
.getValueAt(row
, 4));
1060 ffc
.removeLibraryInstance(moduleKey
, row
);
1061 model1
.removeRow(row
);
1070 * This method initializes jButton2
1072 * @return javax.swing.JButton
1074 private JButton
getJButton2() {
1075 if (jButton2
== null) {
1076 jButton2
= new JButton();
1077 jButton2
.setPreferredSize(new java
.awt
.Dimension(80,20));
1078 jButton2
.setText("Ok");
1079 jButton2
.addActionListener(this);
1085 * This method initializes jButton3
1087 * @return javax.swing.JButton
1089 private JButton
getJButton3() {
1090 if (jButton3
== null) {
1091 jButton3
= new JButton();
1092 jButton3
.setPreferredSize(new java
.awt
.Dimension(80,20));
1093 jButton3
.setText("Cancel");
1094 jButton3
.setVisible(false);
1098 public void actionPerformed(ActionEvent arg0
) {
1100 if (arg0
.getSource() == jButton2
) {
1101 if (jTable4
.isEditing()) {
1102 jTable4
.getCellEditor().stopCellEditing();
1104 this.setVisible(false);
1108 * This method initializes jPanel8
1110 * @return javax.swing.JPanel
1112 private JPanel
getJPanel8() {
1113 if (jPanel8
== null) {
1114 jLabel12
= new JLabel();
1115 jLabel12
.setText("");
1116 jLabel12
.setPreferredSize(new java
.awt
.Dimension(250,16));
1117 FlowLayout flowLayout4
= new FlowLayout();
1118 flowLayout4
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1119 jLabel8
= new JLabel();
1120 jLabel8
.setText("FFS Format Key");
1121 jLabel8
.setPreferredSize(new java
.awt
.Dimension(90,16));
1122 jLabel7
= new JLabel();
1123 jLabel7
.setText("FFS File GUID");
1124 jLabel7
.setPreferredSize(new java
.awt
.Dimension(90,16));
1125 jLabel6
= new JLabel();
1126 jLabel6
.setText("FV Binding");
1127 jLabel6
.setPreferredSize(new java
.awt
.Dimension(90,16));
1128 jPanel8
= new JPanel();
1129 jPanel8
.setLayout(flowLayout4
);
1130 jPanel8
.add(jLabel6
, null);
1131 jPanel8
.add(getJTextFieldFvBinding(), null);
1132 jPanel8
.add(jLabel7
, null);
1133 jPanel8
.add(getJTextFieldFileGuid(), null);
1134 jPanel8
.add(jLabel8
, null);
1135 jPanel8
.add(getJTextFieldFfsKey(), null);
1136 jPanel8
.add(getJScrollPane6(), null);
1137 jPanel8
.add(jLabel12
, null);
1138 jPanel8
.add(getJButton4(), null);
1139 jPanel8
.add(getJButton5(), null);
1140 jPanel8
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
1141 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
1142 initModuleSAOptions(moduleKey
);
1149 * This method initializes jTextField
1151 * @return javax.swing.JTextField
1153 private JTextField
getJTextFieldFvBinding() {
1154 if (jTextFieldFvBinding
== null) {
1155 jTextFieldFvBinding
= new JTextField();
1156 jTextFieldFvBinding
.setPreferredSize(new java
.awt
.Dimension(150,20));
1157 jTextFieldFvBinding
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1158 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1159 String originalFvBinding
= ffc
.getFvBinding(moduleKey
);
1160 String newFvBinding
= jTextFieldFvBinding
.getText();
1161 if (newFvBinding
.equals(originalFvBinding
)) {
1164 if (newFvBinding
.length() == 0 && originalFvBinding
== null) {
1167 docConsole
.setSaved(false);
1168 ffc
.setFvBinding(moduleKey
, newFvBinding
);
1173 return jTextFieldFvBinding
;
1176 * This method initializes jTextField1
1178 * @return javax.swing.JTextField
1180 private JTextField
getJTextFieldFileGuid() {
1181 if (jTextFieldFileGuid
== null) {
1182 jTextFieldFileGuid
= new JTextField();
1183 jTextFieldFileGuid
.setPreferredSize(new java
.awt
.Dimension(300,20));
1184 jTextFieldFileGuid
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1185 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1186 String originalFileGuid
= ffc
.getFfsFileNameGuid(moduleKey
);
1187 String newFileGuid
= jTextFieldFileGuid
.getText();
1188 if (newFileGuid
.equals(originalFileGuid
)) {
1191 if (newFileGuid
.length() == 0 && originalFileGuid
== null) {
1194 if (newFileGuid
.length() > 0) {
1195 if (!DataValidation
.isGuid(newFileGuid
)) {
1196 JOptionPane
.showMessageDialog(frame
, "FFS File Guid is NOT GUID Type.");
1201 docConsole
.setSaved(false);
1202 if (newFileGuid
.length() == 0) {
1205 ffc
.setFfsFileNameGuid(moduleKey
, newFileGuid
);
1210 return jTextFieldFileGuid
;
1213 * This method initializes jTextFieldFfsKey
1215 * @return javax.swing.JTextField
1217 private JTextField
getJTextFieldFfsKey() {
1218 if (jTextFieldFfsKey
== null) {
1219 jTextFieldFfsKey
= new JTextField();
1220 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(150,20));
1221 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1222 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1223 String originalFfsKey
= ffc
.getFfsFormatKey(moduleKey
);
1224 String newFfsKey
= jTextFieldFfsKey
.getText();
1225 if (newFfsKey
.equals(originalFfsKey
)) {
1228 if (newFfsKey
.length() == 0 && originalFfsKey
== null) {
1231 docConsole
.setSaved(false);
1232 ffc
.setFfsFormatKey(moduleKey
, newFfsKey
);
1237 return jTextFieldFfsKey
;
1240 * This method initializes jScrollPane6
1242 * @return javax.swing.JScrollPane
1244 private JScrollPane
getJScrollPane6() {
1245 if (jScrollPane6
== null) {
1246 jScrollPane6
= new JScrollPane();
1247 jScrollPane6
.setPreferredSize(new java
.awt
.Dimension(600,200));
1248 jScrollPane6
.setViewportView(getJTable4());
1250 return jScrollPane6
;
1253 * This method initializes jTable4
1255 * @return javax.swing.JTable
1257 private JTable
getJTable4() {
1258 if (jTable4
== null) {
1259 optionsTableModel
= new DefaultTableModel();
1260 optionsTableModel
.addColumn("BuildTargets");
1261 optionsTableModel
.addColumn("ToolChainFamily");
1262 optionsTableModel
.addColumn("TagName");
1263 optionsTableModel
.addColumn("ToolCode");
1264 optionsTableModel
.addColumn("SupportedArchs");
1265 optionsTableModel
.addColumn("Contents");
1266 jTable4
= new JTable(optionsTableModel
);
1267 jTable4
.setRowHeight(20);
1268 Vector
<String
> vArch
= new Vector
<String
>();
1275 jTable4
.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch
));
1276 jTable4
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1277 jTable4
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
1278 jTable4
.getModel().addTableModelListener(new TableModelListener() {
1279 public void tableChanged(TableModelEvent arg0
) {
1280 // TODO Auto-generated method stub
1281 int row
= arg0
.getFirstRow();
1282 TableModel m
= (TableModel
)arg0
.getSource();
1284 if (arg0
.getType() == TableModelEvent
.UPDATE
){
1285 //ToDo Data Validition check.
1286 String targets
= m
.getValueAt(row
, 0) + "";
1287 Vector
<Object
> targetName
= null;
1288 if (targets
.length() > 0) {
1289 targetName
= new Vector
<Object
>();
1290 String
[] sArray
= targets
.split(" ");
1291 for (int i
= 0; i
< sArray
.length
; ++i
) {
1292 targetName
.add(sArray
[i
]);
1296 String toolChain
= m
.getValueAt(row
, 1) + "";
1297 String tagName
= m
.getValueAt(row
, 2) + "";
1298 String toolCode
= m
.getValueAt(row
, 3) + "";
1299 String archs
= m
.getValueAt(row
, 4) + "";
1300 Vector
<Object
> supArch
= null;
1301 if (archs
.length() > 0) {
1302 supArch
= new Vector
<Object
>();
1303 String
[] sArray1
= archs
.split(" ");
1304 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1305 supArch
.add(sArray1
[i
]);
1309 String contents
= m
.getValueAt(row
, 5) + "";
1310 docConsole
.setSaved(false);
1311 ffc
.updateModuleSAOptionsOpt(moduleKey
, row
, targetName
, toolChain
, tagName
, toolCode
, supArch
, contents
);
1319 * This method initializes jButton4
1321 * @return javax.swing.JButton
1323 private JButton
getJButton4() {
1324 if (jButton4
== null) {
1325 jButton4
= new JButton();
1326 jButton4
.setPreferredSize(new java
.awt
.Dimension(80,20));
1327 jButton4
.setText("New");
1328 jButton4
.addActionListener(new java
.awt
.event
.ActionListener() {
1329 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1330 String
[] row
= {"", "", "", "", "", ""};
1331 optionsTableModel
.addRow(row
);
1332 Vector
<Object
> v
= new Vector
<Object
>();
1333 Vector
<Object
> v1
= null;
1334 docConsole
.setSaved(false);
1335 ffc
.genModuleSAOptionsOpt(moduleKey
, v
, "", "", "", v1
, "");
1342 * This method initializes jButton5
1344 * @return javax.swing.JButton
1346 private JButton
getJButton5() {
1347 if (jButton5
== null) {
1348 jButton5
= new JButton();
1349 jButton5
.setPreferredSize(new java
.awt
.Dimension(80,20));
1350 jButton5
.setText("Delete");
1351 jButton5
.addActionListener(new java
.awt
.event
.ActionListener() {
1352 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1353 if (jTable4
.getSelectedRow() < 0) {
1356 docConsole
.setSaved(false);
1357 ffc
.removeModuleSAOptionsOpt(moduleKey
, jTable4
.getSelectedRow());
1358 optionsTableModel
.removeRow(jTable4
.getSelectedRow());
1366 Start the window at the center of screen
1369 protected void centerWindow(int intWidth
, int intHeight
) {
1370 Dimension d
= Toolkit
.getDefaultToolkit().getScreenSize();
1371 this.setLocation((d
.width
- intWidth
) / 2, (d
.height
- intHeight
) / 2);
1375 Start the window at the center of screen
1378 protected void centerWindow() {
1379 centerWindow(this.getSize().width
, this.getSize().height
);
1382 * This method initializes jPanel9
1384 * @return javax.swing.JPanel
1386 private JPanel
getJPanel9() {
1387 if (jPanel9
== null) {
1388 GridLayout gridLayout
= new GridLayout();
1389 gridLayout
.setRows(3);
1390 gridLayout
.setColumns(2);
1391 jPanel9
= new JPanel();
1392 jPanel9
.setLayout(gridLayout
);
1393 jPanel9
.setPreferredSize(new java
.awt
.Dimension(600,90));
1394 jPanel9
.add(getJPanel12(), null);
1395 jPanel9
.add(getJPanel10(), null);
1396 jPanel9
.add(getJPanel11(), null);
1401 * This method initializes jPanel10
1403 * @return javax.swing.JPanel
1405 private JPanel
getJPanel10() {
1406 if (jPanel10
== null) {
1407 FlowLayout flowLayout2
= new FlowLayout();
1408 flowLayout2
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1409 jLabel10
= new JLabel();
1410 jLabel10
.setText("Max Datum Size");
1411 jPanel10
= new JPanel();
1412 jPanel10
.setLayout(flowLayout2
);
1413 jPanel10
.add(jLabel10
, null);
1414 jPanel10
.add(getJTextField3(), null);
1419 * This method initializes jPanel11
1421 * @return javax.swing.JPanel
1423 private JPanel
getJPanel11() {
1424 if (jPanel11
== null) {
1425 FlowLayout flowLayout3
= new FlowLayout();
1426 flowLayout3
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1427 jLabel11
= new JLabel();
1428 jLabel11
.setText("Default Value");
1429 jLabel11
.setPreferredSize(new java
.awt
.Dimension(91,16));
1430 jPanel11
= new JPanel();
1431 jPanel11
.setLayout(flowLayout3
);
1432 jPanel11
.add(jLabel11
, null);
1433 jPanel11
.add(getJTextField4(), null);
1434 jPanel11
.add(getJComboBox1(), null);
1439 * This method initializes jPanel12
1441 * @return javax.swing.JPanel
1443 private JPanel
getJPanel12() {
1444 if (jPanel12
== null) {
1445 FlowLayout flowLayout1
= new FlowLayout();
1446 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1447 jLabel9
= new JLabel();
1448 jLabel9
.setText("Item Type");
1449 jLabel9
.setPreferredSize(new java
.awt
.Dimension(91,16));
1450 jPanel12
= new JPanel();
1451 jPanel12
.setLayout(flowLayout1
);
1452 jPanel12
.add(jLabel9
, null);
1453 jPanel12
.add(getJComboBox(), null);
1454 jPanel12
.add(getJButton6(), null);
1459 * This method initializes jComboBox
1461 * @return javax.swing.JComboBox
1463 private JComboBox
getJComboBox() {
1464 if (jComboBox
== null) {
1465 jComboBox
= new JComboBox();
1466 jComboBox
.setPreferredSize(new java
.awt
.Dimension(200,20));
1467 jComboBox
.addItemListener(new java
.awt
.event
.ItemListener() {
1468 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
1469 int row
= jTable
.getSelectedRow();
1470 if (row
< 0 || jTable
.getValueAt(row
, 2).equals(jComboBox
.getSelectedItem())) {
1473 if (jComboBox
.getItemCount() == 3) {
1474 if (!jComboBox
.getSelectedItem().equals("DYNAMIC")) {
1475 pcdDynamicToNonDynamic(jTable
.getValueAt(row
, 0)+"", jTable
.getValueAt(row
, 1)+"");
1478 pcdNonDynamicToDynamic(jTable
.getValueAt(row
, 0)+"", jTable
.getValueAt(row
, 1)+"");
1487 private void pcdDynamicToNonDynamic(String cName
, String tsGuid
) {
1488 String
[][] saa
= new String
[ffc
.getDynamicPcdBuildDataCount()][5];
1489 ffc
.getDynamicPcdBuildData(saa
);
1490 String maxSize
= "";
1492 for (int i
= 0; i
< saa
.length
; ++i
) {
1493 if (saa
[i
][0].equals(cName
) && saa
[i
][2].equals(tsGuid
)) {
1494 maxSize
= saa
[i
][3];
1495 value
= ffc
.getDynamicPcdBuildDataValue(i
);
1500 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1501 for (int i
= 0; i
< al
.size(); ++i
) {
1502 String
[] s
= al
.get(i
).split(" ");
1503 String mKey
= s
[0] + s
[1] + s
[2] + s
[3];
1504 ffc
.updatePcdData(mKey
, cName
, tsGuid
, jComboBox
.getSelectedItem()+"", maxSize
, value
);
1505 s
[4] = jComboBox
.getSelectedItem()+"";
1506 al
.set(i
, s
[0]+" "+s
[1]+" "+s
[2]+" "+s
[3]+" "+s
[4]);
1509 ffc
.removeDynamicPcdBuildData(cName
, tsGuid
);
1512 private void pcdNonDynamicToDynamic(String cName
, String tsGuid
) {
1513 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1514 for (int i
= 0; i
< al
.size(); ++i
) {
1515 String
[] s
= al
.get(i
).split(" ");
1516 String mKey
= s
[0] + " " + s
[1]+ " " + s
[2] + " " + s
[3];
1517 ffc
.updatePcdData(mKey
, cName
, tsGuid
, jComboBox
.getSelectedItem()+"", jTextField3
.getText(), jTextField4
.isVisible() ? jTextField4
.getText() : jComboBox1
.getSelectedItem()+"");
1518 s
[4] = jComboBox
.getSelectedItem()+"";
1519 al
.set(i
, s
[0]+" "+s
[1]+" "+s
[2]+" "+s
[3]+" "+s
[4]);
1522 ffc
.addDynamicPcdBuildData(cName
, jTable
.getValueAt(jTable
.getSelectedRow(), 3), tsGuid
, "DYNAMIC", jTable
.getValueAt(jTable
.getSelectedRow(), 5)+"", jTextField4
.isVisible() ? jTextField4
.getText() : jComboBox1
.getSelectedItem()+"");
1525 JOptionPane
.showMessageDialog(frame
, "PCD value format: " + e
.getMessage());
1529 * This method initializes jTextField3
1531 * @return javax.swing.JTextField
1533 private JTextField
getJTextField3() {
1534 if (jTextField3
== null) {
1535 jTextField3
= new JTextField();
1536 jTextField3
.setPreferredSize(new java
.awt
.Dimension(200,20));
1541 * This method initializes jTextField4
1543 * @return javax.swing.JTextField
1545 private JTextField
getJTextField4() {
1546 if (jTextField4
== null) {
1547 jTextField4
= new JTextField();
1548 jTextField4
.setPreferredSize(new java
.awt
.Dimension(200,20));
1553 * This method initializes jButton6
1555 * @return javax.swing.JButton
1557 private JButton
getJButton6() {
1558 if (jButton6
== null) {
1559 jButton6
= new JButton();
1560 jButton6
.setPreferredSize(new java
.awt
.Dimension(150,20));
1561 jButton6
.setText("Update PCD Data");
1562 jButton6
.addActionListener(new java
.awt
.event
.ActionListener() {
1563 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1564 int row
= jTable
.getSelectedRow();
1568 docConsole
.setSaved(false);
1569 model
.setValueAt(jComboBox
.getSelectedItem(), row
, 2);
1570 model
.setValueAt(jTextField3
.getText(), row
, 4);
1571 model
.setValueAt(jTextField4
.isVisible()? jTextField4
.getText():jComboBox1
.getSelectedItem(), row
, 6);
1572 ffc
.updatePcdData(moduleKey
, model
.getValueAt(row
, 0)+"", model
.getValueAt(row
, 1)+"", model
.getValueAt(row
, 2)+"", model
.getValueAt(row
, 4)+"", model
.getValueAt(row
, 6)+"");
1579 * This method initializes jComboBox1
1581 * @return javax.swing.JComboBox
1583 private JComboBox
getJComboBox1() {
1584 if (jComboBox1
== null) {
1585 jComboBox1
= new JComboBox();
1586 jComboBox1
.setPreferredSize(new java
.awt
.Dimension(100,20));
1587 jComboBox1
.setVisible(false);
1588 jComboBox1
.addItem("true");
1589 jComboBox1
.addItem("false");
1595 } // @jve:decl-index=0:visual-constraint="10,10"
1597 class PartialEditableTableModel
extends DefaultTableModel
{
1601 private static final long serialVersionUID
= 1L;
1603 public boolean isCellEditable(int row
, int col
) {
1614 class LibraryTableModel
extends DefaultTableModel
{
1618 private static final long serialVersionUID
= 1L;
1620 public boolean isCellEditable(int row
, int col
) {