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(key
, 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 ffc
.genLibraryInstance(model3
.getValueAt(row
, 1)+"", model3
.getValueAt(row
, 2)+"", model3
.getValueAt(row
, 3)+"", model3
.getValueAt(row
, 4)+"", moduleKey
);
1023 // Add pcd information of selected instance to current moduleSA
1026 ffc
.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue
), null, ffc
.getModuleSA(moduleKey
));
1028 catch (Exception exception
) {
1029 JOptionPane
.showMessageDialog(frame
, "PCD Insertion Fail. " + exception
.getMessage());
1031 resolveLibraryInstances(instanceValue
);
1039 * This method initializes jButton1
1041 * @return javax.swing.JButton
1043 private JButton
getJButton1() {
1044 if (jButton1
== null) {
1045 jButton1
= new JButton();
1046 jButton1
.setPreferredSize(new java
.awt
.Dimension(80,20));
1047 jButton1
.setText("Delete");
1048 jButton1
.addActionListener(new java
.awt
.event
.ActionListener() {
1049 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1050 int row
= jTable1
.getSelectedRow();
1054 docConsole
.setSaved(false);
1055 removeInstance(model1
.getValueAt(row
, 1) + " " +
1056 model1
.getValueAt(row
, 2) + " " +
1057 model1
.getValueAt(row
, 3) + " " +
1058 model1
.getValueAt(row
, 4));
1059 ffc
.removeLibraryInstance(moduleKey
, row
);
1060 model1
.removeRow(row
);
1069 * This method initializes jButton2
1071 * @return javax.swing.JButton
1073 private JButton
getJButton2() {
1074 if (jButton2
== null) {
1075 jButton2
= new JButton();
1076 jButton2
.setPreferredSize(new java
.awt
.Dimension(80,20));
1077 jButton2
.setText("Ok");
1078 jButton2
.addActionListener(this);
1084 * This method initializes jButton3
1086 * @return javax.swing.JButton
1088 private JButton
getJButton3() {
1089 if (jButton3
== null) {
1090 jButton3
= new JButton();
1091 jButton3
.setPreferredSize(new java
.awt
.Dimension(80,20));
1092 jButton3
.setText("Cancel");
1093 jButton3
.setVisible(false);
1097 public void actionPerformed(ActionEvent arg0
) {
1099 if (arg0
.getSource() == jButton2
) {
1100 if (jTable4
.isEditing()) {
1101 jTable4
.getCellEditor().stopCellEditing();
1103 this.setVisible(false);
1107 * This method initializes jPanel8
1109 * @return javax.swing.JPanel
1111 private JPanel
getJPanel8() {
1112 if (jPanel8
== null) {
1113 jLabel12
= new JLabel();
1114 jLabel12
.setText("");
1115 jLabel12
.setPreferredSize(new java
.awt
.Dimension(250,16));
1116 FlowLayout flowLayout4
= new FlowLayout();
1117 flowLayout4
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1118 jLabel8
= new JLabel();
1119 jLabel8
.setText("FFS Format Key");
1120 jLabel8
.setPreferredSize(new java
.awt
.Dimension(90,16));
1121 jLabel7
= new JLabel();
1122 jLabel7
.setText("FFS File GUID");
1123 jLabel7
.setPreferredSize(new java
.awt
.Dimension(90,16));
1124 jLabel6
= new JLabel();
1125 jLabel6
.setText("FV Binding");
1126 jLabel6
.setPreferredSize(new java
.awt
.Dimension(90,16));
1127 jPanel8
= new JPanel();
1128 jPanel8
.setLayout(flowLayout4
);
1129 jPanel8
.add(jLabel6
, null);
1130 jPanel8
.add(getJTextFieldFvBinding(), null);
1131 jPanel8
.add(jLabel7
, null);
1132 jPanel8
.add(getJTextFieldFileGuid(), null);
1133 jPanel8
.add(jLabel8
, null);
1134 jPanel8
.add(getJTextFieldFfsKey(), null);
1135 jPanel8
.add(getJScrollPane6(), null);
1136 jPanel8
.add(jLabel12
, null);
1137 jPanel8
.add(getJButton4(), null);
1138 jPanel8
.add(getJButton5(), null);
1139 jPanel8
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
1140 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
1141 initModuleSAOptions(moduleKey
);
1148 * This method initializes jTextField
1150 * @return javax.swing.JTextField
1152 private JTextField
getJTextFieldFvBinding() {
1153 if (jTextFieldFvBinding
== null) {
1154 jTextFieldFvBinding
= new JTextField();
1155 jTextFieldFvBinding
.setPreferredSize(new java
.awt
.Dimension(150,20));
1156 jTextFieldFvBinding
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1157 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1158 String originalFvBinding
= ffc
.getFvBinding(moduleKey
);
1159 String newFvBinding
= jTextFieldFvBinding
.getText();
1160 if (newFvBinding
.equals(originalFvBinding
)) {
1163 if (newFvBinding
.length() == 0 && originalFvBinding
== null) {
1166 docConsole
.setSaved(false);
1167 ffc
.setFvBinding(moduleKey
, newFvBinding
);
1172 return jTextFieldFvBinding
;
1175 * This method initializes jTextField1
1177 * @return javax.swing.JTextField
1179 private JTextField
getJTextFieldFileGuid() {
1180 if (jTextFieldFileGuid
== null) {
1181 jTextFieldFileGuid
= new JTextField();
1182 jTextFieldFileGuid
.setPreferredSize(new java
.awt
.Dimension(300,20));
1183 jTextFieldFileGuid
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1184 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1185 String originalFileGuid
= ffc
.getFfsFileNameGuid(moduleKey
);
1186 String newFileGuid
= jTextFieldFileGuid
.getText();
1187 if (newFileGuid
.equals(originalFileGuid
)) {
1190 if (newFileGuid
.length() == 0 && originalFileGuid
== null) {
1193 if (newFileGuid
.length() > 0) {
1194 if (!DataValidation
.isGuid(newFileGuid
)) {
1195 JOptionPane
.showMessageDialog(frame
, "FFS File Guid is NOT GUID Type.");
1200 docConsole
.setSaved(false);
1201 if (newFileGuid
.length() == 0) {
1204 ffc
.setFfsFileNameGuid(moduleKey
, newFileGuid
);
1209 return jTextFieldFileGuid
;
1212 * This method initializes jTextFieldFfsKey
1214 * @return javax.swing.JTextField
1216 private JTextField
getJTextFieldFfsKey() {
1217 if (jTextFieldFfsKey
== null) {
1218 jTextFieldFfsKey
= new JTextField();
1219 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(150,20));
1220 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1221 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1222 String originalFfsKey
= ffc
.getFfsFormatKey(moduleKey
);
1223 String newFfsKey
= jTextFieldFfsKey
.getText();
1224 if (newFfsKey
.equals(originalFfsKey
)) {
1227 if (newFfsKey
.length() == 0 && originalFfsKey
== null) {
1230 docConsole
.setSaved(false);
1231 ffc
.setFfsFormatKey(moduleKey
, newFfsKey
);
1236 return jTextFieldFfsKey
;
1239 * This method initializes jScrollPane6
1241 * @return javax.swing.JScrollPane
1243 private JScrollPane
getJScrollPane6() {
1244 if (jScrollPane6
== null) {
1245 jScrollPane6
= new JScrollPane();
1246 jScrollPane6
.setPreferredSize(new java
.awt
.Dimension(600,200));
1247 jScrollPane6
.setViewportView(getJTable4());
1249 return jScrollPane6
;
1252 * This method initializes jTable4
1254 * @return javax.swing.JTable
1256 private JTable
getJTable4() {
1257 if (jTable4
== null) {
1258 optionsTableModel
= new DefaultTableModel();
1259 optionsTableModel
.addColumn("BuildTargets");
1260 optionsTableModel
.addColumn("ToolChainFamily");
1261 optionsTableModel
.addColumn("TagName");
1262 optionsTableModel
.addColumn("ToolCode");
1263 optionsTableModel
.addColumn("SupportedArchs");
1264 optionsTableModel
.addColumn("Contents");
1265 jTable4
= new JTable(optionsTableModel
);
1266 jTable4
.setRowHeight(20);
1267 Vector
<String
> vArch
= new Vector
<String
>();
1274 jTable4
.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch
));
1275 jTable4
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1276 jTable4
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
1277 jTable4
.getModel().addTableModelListener(new TableModelListener() {
1278 public void tableChanged(TableModelEvent arg0
) {
1279 // TODO Auto-generated method stub
1280 int row
= arg0
.getFirstRow();
1281 TableModel m
= (TableModel
)arg0
.getSource();
1283 if (arg0
.getType() == TableModelEvent
.UPDATE
){
1284 //ToDo Data Validition check.
1285 String targets
= m
.getValueAt(row
, 0) + "";
1286 Vector
<Object
> targetName
= null;
1287 if (targets
.length() > 0) {
1288 targetName
= new Vector
<Object
>();
1289 String
[] sArray
= targets
.split(" ");
1290 for (int i
= 0; i
< sArray
.length
; ++i
) {
1291 targetName
.add(sArray
[i
]);
1295 String toolChain
= m
.getValueAt(row
, 1) + "";
1296 String tagName
= m
.getValueAt(row
, 2) + "";
1297 String toolCode
= m
.getValueAt(row
, 3) + "";
1298 String archs
= m
.getValueAt(row
, 4) + "";
1299 Vector
<Object
> supArch
= null;
1300 if (archs
.length() > 0) {
1301 supArch
= new Vector
<Object
>();
1302 String
[] sArray1
= archs
.split(" ");
1303 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1304 supArch
.add(sArray1
[i
]);
1308 String contents
= m
.getValueAt(row
, 5) + "";
1309 docConsole
.setSaved(false);
1310 ffc
.updateModuleSAOptionsOpt(moduleKey
, row
, targetName
, toolChain
, tagName
, toolCode
, supArch
, contents
);
1318 * This method initializes jButton4
1320 * @return javax.swing.JButton
1322 private JButton
getJButton4() {
1323 if (jButton4
== null) {
1324 jButton4
= new JButton();
1325 jButton4
.setPreferredSize(new java
.awt
.Dimension(80,20));
1326 jButton4
.setText("New");
1327 jButton4
.addActionListener(new java
.awt
.event
.ActionListener() {
1328 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1329 String
[] row
= {"", "", "", "", "", ""};
1330 optionsTableModel
.addRow(row
);
1331 Vector
<Object
> v
= new Vector
<Object
>();
1332 Vector
<Object
> v1
= null;
1333 docConsole
.setSaved(false);
1334 ffc
.genModuleSAOptionsOpt(moduleKey
, v
, "", "", "", v1
, "");
1341 * This method initializes jButton5
1343 * @return javax.swing.JButton
1345 private JButton
getJButton5() {
1346 if (jButton5
== null) {
1347 jButton5
= new JButton();
1348 jButton5
.setPreferredSize(new java
.awt
.Dimension(80,20));
1349 jButton5
.setText("Delete");
1350 jButton5
.addActionListener(new java
.awt
.event
.ActionListener() {
1351 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1352 if (jTable4
.getSelectedRow() < 0) {
1355 docConsole
.setSaved(false);
1356 ffc
.removeModuleSAOptionsOpt(moduleKey
, jTable4
.getSelectedRow());
1357 optionsTableModel
.removeRow(jTable4
.getSelectedRow());
1365 Start the window at the center of screen
1368 protected void centerWindow(int intWidth
, int intHeight
) {
1369 Dimension d
= Toolkit
.getDefaultToolkit().getScreenSize();
1370 this.setLocation((d
.width
- intWidth
) / 2, (d
.height
- intHeight
) / 2);
1374 Start the window at the center of screen
1377 protected void centerWindow() {
1378 centerWindow(this.getSize().width
, this.getSize().height
);
1381 * This method initializes jPanel9
1383 * @return javax.swing.JPanel
1385 private JPanel
getJPanel9() {
1386 if (jPanel9
== null) {
1387 GridLayout gridLayout
= new GridLayout();
1388 gridLayout
.setRows(3);
1389 gridLayout
.setColumns(2);
1390 jPanel9
= new JPanel();
1391 jPanel9
.setLayout(gridLayout
);
1392 jPanel9
.setPreferredSize(new java
.awt
.Dimension(600,90));
1393 jPanel9
.add(getJPanel12(), null);
1394 jPanel9
.add(getJPanel10(), null);
1395 jPanel9
.add(getJPanel11(), null);
1400 * This method initializes jPanel10
1402 * @return javax.swing.JPanel
1404 private JPanel
getJPanel10() {
1405 if (jPanel10
== null) {
1406 FlowLayout flowLayout2
= new FlowLayout();
1407 flowLayout2
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1408 jLabel10
= new JLabel();
1409 jLabel10
.setText("Max Datum Size");
1410 jPanel10
= new JPanel();
1411 jPanel10
.setLayout(flowLayout2
);
1412 jPanel10
.add(jLabel10
, null);
1413 jPanel10
.add(getJTextField3(), null);
1418 * This method initializes jPanel11
1420 * @return javax.swing.JPanel
1422 private JPanel
getJPanel11() {
1423 if (jPanel11
== null) {
1424 FlowLayout flowLayout3
= new FlowLayout();
1425 flowLayout3
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1426 jLabel11
= new JLabel();
1427 jLabel11
.setText("Default Value");
1428 jLabel11
.setPreferredSize(new java
.awt
.Dimension(91,16));
1429 jPanel11
= new JPanel();
1430 jPanel11
.setLayout(flowLayout3
);
1431 jPanel11
.add(jLabel11
, null);
1432 jPanel11
.add(getJTextField4(), null);
1433 jPanel11
.add(getJComboBox1(), null);
1438 * This method initializes jPanel12
1440 * @return javax.swing.JPanel
1442 private JPanel
getJPanel12() {
1443 if (jPanel12
== null) {
1444 FlowLayout flowLayout1
= new FlowLayout();
1445 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1446 jLabel9
= new JLabel();
1447 jLabel9
.setText("Item Type");
1448 jLabel9
.setPreferredSize(new java
.awt
.Dimension(91,16));
1449 jPanel12
= new JPanel();
1450 jPanel12
.setLayout(flowLayout1
);
1451 jPanel12
.add(jLabel9
, null);
1452 jPanel12
.add(getJComboBox(), null);
1453 jPanel12
.add(getJButton6(), null);
1458 * This method initializes jComboBox
1460 * @return javax.swing.JComboBox
1462 private JComboBox
getJComboBox() {
1463 if (jComboBox
== null) {
1464 jComboBox
= new JComboBox();
1465 jComboBox
.setPreferredSize(new java
.awt
.Dimension(200,20));
1466 jComboBox
.addItemListener(new java
.awt
.event
.ItemListener() {
1467 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
1468 int row
= jTable
.getSelectedRow();
1469 if (row
< 0 || jTable
.getValueAt(row
, 2).equals(jComboBox
.getSelectedItem())) {
1472 if (jComboBox
.getItemCount() == 3) {
1473 if (!jComboBox
.getSelectedItem().equals("DYNAMIC")) {
1474 pcdDynamicToNonDynamic(jTable
.getValueAt(row
, 0)+"", jTable
.getValueAt(row
, 1)+"");
1477 pcdNonDynamicToDynamic(jTable
.getValueAt(row
, 0)+"", jTable
.getValueAt(row
, 1)+"");
1486 private void pcdDynamicToNonDynamic(String cName
, String tsGuid
) {
1487 String
[][] saa
= new String
[ffc
.getDynamicPcdBuildDataCount()][5];
1488 ffc
.getDynamicPcdBuildData(saa
);
1489 String maxSize
= "";
1491 for (int i
= 0; i
< saa
.length
; ++i
) {
1492 if (saa
[i
][0].equals(cName
) && saa
[i
][2].equals(tsGuid
)) {
1493 maxSize
= saa
[i
][3];
1494 value
= ffc
.getDynamicPcdBuildDataValue(i
);
1499 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1500 for (int i
= 0; i
< al
.size(); ++i
) {
1501 String
[] s
= al
.get(i
).split(" ");
1502 String mKey
= s
[0] + s
[1] + s
[2] + s
[3];
1503 ffc
.updatePcdData(mKey
, cName
, tsGuid
, jComboBox
.getSelectedItem()+"", maxSize
, value
);
1504 s
[4] = jComboBox
.getSelectedItem()+"";
1505 al
.set(i
, s
[0]+" "+s
[1]+" "+s
[2]+" "+s
[3]+" "+s
[4]);
1508 ffc
.removeDynamicPcdBuildData(cName
, tsGuid
);
1511 private void pcdNonDynamicToDynamic(String cName
, String tsGuid
) {
1512 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1513 for (int i
= 0; i
< al
.size(); ++i
) {
1514 String
[] s
= al
.get(i
).split(" ");
1515 String mKey
= s
[0] + " " + s
[1]+ " " + s
[2] + " " + s
[3];
1516 ffc
.updatePcdData(mKey
, cName
, tsGuid
, jComboBox
.getSelectedItem()+"", jTextField3
.getText(), jTextField4
.isVisible() ? jTextField4
.getText() : jComboBox1
.getSelectedItem()+"");
1517 s
[4] = jComboBox
.getSelectedItem()+"";
1518 al
.set(i
, s
[0]+" "+s
[1]+" "+s
[2]+" "+s
[3]+" "+s
[4]);
1521 ffc
.addDynamicPcdBuildData(cName
, jTable
.getValueAt(jTable
.getSelectedRow(), 3), tsGuid
, "DYNAMIC", jTable
.getValueAt(jTable
.getSelectedRow(), 5)+"", jTextField4
.isVisible() ? jTextField4
.getText() : jComboBox1
.getSelectedItem()+"");
1524 JOptionPane
.showMessageDialog(frame
, "PCD value format: " + e
.getMessage());
1528 * This method initializes jTextField3
1530 * @return javax.swing.JTextField
1532 private JTextField
getJTextField3() {
1533 if (jTextField3
== null) {
1534 jTextField3
= new JTextField();
1535 jTextField3
.setPreferredSize(new java
.awt
.Dimension(200,20));
1540 * This method initializes jTextField4
1542 * @return javax.swing.JTextField
1544 private JTextField
getJTextField4() {
1545 if (jTextField4
== null) {
1546 jTextField4
= new JTextField();
1547 jTextField4
.setPreferredSize(new java
.awt
.Dimension(200,20));
1552 * This method initializes jButton6
1554 * @return javax.swing.JButton
1556 private JButton
getJButton6() {
1557 if (jButton6
== null) {
1558 jButton6
= new JButton();
1559 jButton6
.setPreferredSize(new java
.awt
.Dimension(150,20));
1560 jButton6
.setText("Update PCD Data");
1561 jButton6
.addActionListener(new java
.awt
.event
.ActionListener() {
1562 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1563 int row
= jTable
.getSelectedRow();
1567 docConsole
.setSaved(false);
1568 model
.setValueAt(jComboBox
.getSelectedItem(), row
, 2);
1569 model
.setValueAt(jTextField3
.getText(), row
, 4);
1570 model
.setValueAt(jTextField4
.isVisible()? jTextField4
.getText():jComboBox1
.getSelectedItem(), row
, 6);
1571 ffc
.updatePcdData(moduleKey
, model
.getValueAt(row
, 0)+"", model
.getValueAt(row
, 1)+"", model
.getValueAt(row
, 2)+"", model
.getValueAt(row
, 4)+"", model
.getValueAt(row
, 6)+"");
1578 * This method initializes jComboBox1
1580 * @return javax.swing.JComboBox
1582 private JComboBox
getJComboBox1() {
1583 if (jComboBox1
== null) {
1584 jComboBox1
= new JComboBox();
1585 jComboBox1
.setPreferredSize(new java
.awt
.Dimension(100,20));
1586 jComboBox1
.setVisible(false);
1587 jComboBox1
.addItem("true");
1588 jComboBox1
.addItem("false");
1594 } // @jve:decl-index=0:visual-constraint="10,10"
1596 class PartialEditableTableModel
extends DefaultTableModel
{
1600 private static final long serialVersionUID
= 1L;
1602 public boolean isCellEditable(int row
, int col
) {
1613 class LibraryTableModel
extends DefaultTableModel
{
1617 private static final long serialVersionUID
= 1L;
1619 public boolean isCellEditable(int row
, int col
) {