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
.JOptionPane
;
8 import javax
.swing
.JPanel
;
9 import javax
.swing
.JDialog
;
10 import javax
.swing
.JTabbedPane
;
11 import javax
.swing
.JLabel
;
12 import javax
.swing
.JScrollPane
;
13 import javax
.swing
.JTable
;
14 import javax
.swing
.JTextArea
;
15 import javax
.swing
.JSplitPane
;
16 import javax
.swing
.JButton
;
17 import javax
.swing
.ListSelectionModel
;
18 import javax
.swing
.event
.ListSelectionEvent
;
19 import javax
.swing
.event
.ListSelectionListener
;
20 import javax
.swing
.event
.TableModelEvent
;
21 import javax
.swing
.event
.TableModelListener
;
22 import javax
.swing
.table
.DefaultTableModel
;
23 import javax
.swing
.table
.TableColumn
;
24 import javax
.swing
.table
.TableModel
;
26 import org
.tianocore
.frameworkwizard
.FrameworkWizardUI
;
27 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
28 import org
.tianocore
.frameworkwizard
.common
.GlobalData
;
29 import org
.tianocore
.frameworkwizard
.common
.IDefaultTableModel
;
30 import org
.tianocore
.frameworkwizard
.common
.Identifications
.OpeningPlatformType
;
31 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.LibraryClassDescriptor
;
32 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.WorkspaceProfile
;
33 import org
.tianocore
.frameworkwizard
.platform
.ui
.global
.SurfaceAreaQuery
;
34 import org
.tianocore
.frameworkwizard
.module
.Identifications
.ModuleIdentification
;
35 import org
.tianocore
.frameworkwizard
.packaging
.PackageIdentification
;
37 import java
.awt
.FlowLayout
;
38 import java
.awt
.event
.ActionEvent
;
39 import java
.awt
.event
.ActionListener
;
40 import java
.util
.ArrayList
;
41 import java
.util
.HashMap
;
42 import java
.util
.Iterator
;
43 import java
.util
.ListIterator
;
44 import java
.util
.Vector
;
46 import javax
.swing
.JTextField
;
47 import java
.awt
.GridLayout
;
48 import javax
.swing
.JComboBox
;
50 public class FpdModuleSA
extends JDialog
implements ActionListener
{
55 private static final long serialVersionUID
= 1L;
56 private JPanel jContentPane
= null;
57 private JTabbedPane jTabbedPane
= null;
58 private JPanel jPanelPcd
= null;
59 private JPanel jPanelLibrary
= null;
60 private JLabel jLabelPcdData
= null;
61 private JScrollPane jScrollPaneTablePcd
= null;
62 private JTable jTablePcd
= null;
63 private JPanel jPanelPcdSouth
= null;
64 private JScrollPane jScrollPanePcdHelp
= null;
65 private JTextArea jTextAreaPcdHelp
= null;
66 private JPanel jPanelContentPaneSouth
= null;
67 private JSplitPane jSplitPane
= null;
68 private JPanel jPanelLibraryLeft
= null;
69 private JPanel jPanelLibraryRight
= null;
70 private JLabel jLabelLibClass
= null;
71 private JLabel jLabelQualifiedInstance
= null;
72 private JScrollPane jScrollPaneSelectedInstances
= null;
73 private JTable jTableSelectedInstances
= null;
74 private JScrollPane jScrollPaneLibClass
= null;
75 private JTable jTableLibClass
= null;
76 private JScrollPane jScrollPaneQualifiedInstance
= null;
77 private JTable jTableLibInstances
= null;
78 private JPanel jPanelLibrarySouth
= null;
79 private JPanel jPanelLibraryCenter
= null;
80 private JScrollPane jScrollPaneInstanceHelp
= null;
81 private JTextArea jTextAreaInstanceHelp
= null;
82 private JLabel jLabelSelectedInstances
= null;
83 private JLabel jLabelInstanceHelp
= null;
84 private JButton jButtonAdd
= null;
85 private JButton jButtonDeleteInstance
= null;
86 private JLabel jLabelPcdHelp
= null;
87 private JButton jButtonOk
= null;
88 private JButton jButtonCancel
= null;
89 private IDefaultTableModel model
= null;
90 private IDefaultTableModel selectedInstancesTableModel
= null;
91 private IDefaultTableModel libClassTableModel
= null;
92 private IDefaultTableModel libInstanceTableModel
= null;
93 private DefaultTableModel optionsTableModel
= null;
94 private FpdFileContents ffc
= null;
95 private String moduleKey
= null;
96 private ModuleIdentification moduleId
= null;
97 private int moduleSaNum
= -1;
98 private HashMap
<LibraryClassDescriptor
, ArrayList
<String
>> classInstanceMap
= null;
100 // map of <{libName, supArch, supMod}, list of Module information>
102 private HashMap
<LibraryClassDescriptor
, ArrayList
<String
>> classConsumed
= null;
103 private HashMap
<LibraryClassDescriptor
, ArrayList
<String
>> classProduced
= null;
105 private JPanel jPanelModuleSaOpts
= null;
106 private JLabel jLabelFvBinding
= null;
107 private JTextField jTextFieldFvBinding
= null;
108 private JLabel jLabelFfsFileGuid
= null;
109 private JTextField jTextFieldFileGuid
= null;
110 private JLabel jLabelFfsFormatKey
= null;
111 private JTextField jTextFieldFfsKey
= null;
112 private JScrollPane jScrollPaneModuleSaOptions
= null;
113 private JTable jTableModuleSaOptions
= null;
114 private JButton jButtonNew
= null;
115 private JButton jButtonDeleteOption
= null;
116 private JPanel jPanelPcdFields
= null;
117 private JPanel jPanelPcdFieldsSecondRow
= null;
118 private JPanel jPanelPcdFieldsThirdRow
= null;
119 private JPanel jPanelPcdFieldsFirstRow
= null;
120 private JLabel jLabelItemType
= null;
121 private JComboBox jComboBoxItemType
= null;
122 private JLabel jLabelMaxDatumSize
= null;
123 private JTextField jTextFieldMaxDatumSize
= null;
124 private JLabel jLabelPcdDefaultValue
= null;
125 private JTextField jTextFieldPcdDefault
= null;
126 private JButton jButtonUpdatePcd
= null;
127 private JComboBox jComboBoxFeatureFlagValue
= null;
128 private OpeningPlatformType docConsole
= null;
129 private JPanel jPanelCustomToolChain
= null;
130 private JPanel jPanelToolchainS
= null;
131 private JPanel jPanelLibraryCenterN
= null;
132 private JPanel jPanelLibraryCenterC
= null; // @jve:decl-index=0:visual-constraint="20,224"
134 private final int buildTargetWidth
= 150;
135 private final int toolChainFamilyWidth
= 150;
136 private final int supportArchWidth
= 150;
137 private final int toolCmdCodeWidth
= 200;
138 private final int tagNameWidth
= 150;
139 private final int argWidth
= 400;
142 * This is the default constructor
144 public FpdModuleSA() {
145 super(FrameworkWizardUI
.getInstance());
148 public FpdModuleSA(FpdFileContents ffc
) {
153 public void setKey(String k
, int i
, OpeningPlatformType dc
){
156 this.docConsole
= dc
;
157 classInstanceMap
= null;
158 classProduced
= null;
159 classConsumed
= null;
160 jTabbedPane
.setSelectedIndex(0);
161 initPcdBuildDefinition(i
);
162 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(moduleKey
);
166 int tabIndex
= jTabbedPane
.indexOfTab("Libraries");
167 if (mi
.isLibrary()) {
168 jTabbedPane
.setEnabledAt(tabIndex
, false);
171 jTabbedPane
.setEnabledAt(tabIndex
, true);
176 init will be called each time FpdModuleSA object is to be shown.
177 @param key Module information.
179 public void initPcdBuildDefinition(int i
) {
181 // display pcd for key.
183 model
.setRowCount(0);
184 jTextAreaPcdHelp
.setText("");
185 jComboBoxItemType
.setSelectedIndex(-1);
186 jTextFieldMaxDatumSize
.setText("");
187 jTextFieldPcdDefault
.setText("");
188 int pcdCount
= ffc
.getPcdDataCount(i
);
190 String
[][] saa
= new String
[pcdCount
][7];
191 ffc
.getPcdData(i
, saa
);
192 for (int j
= 0; j
< saa
.length
; ++j
) {
193 model
.addRow(saa
[j
]);
198 public void initLibraries(String key
) {
199 libClassTableModel
.setRowCount(0);
200 libInstanceTableModel
.setRowCount(0);
201 selectedInstancesTableModel
.setRowCount(0);
202 moduleId
= WorkspaceProfile
.getModuleId(moduleKey
);
203 Vector
<String
> errorMsg
= new Vector
<String
>();
206 // display library classes that need to be resolved. also potential instances for them.
208 resolveLibraryInstances(moduleKey
, errorMsg
);
209 } catch (Exception e
) {
210 String exceptionMsg
= e
.getCause() + " " + e
.getMessage();
211 errorMsg
.add(exceptionMsg
);
212 JOptionPane
.showMessageDialog(FrameworkWizardUI
.getInstance(), exceptionMsg
);
215 // display lib instances already selected for key
218 int instanceCount
= ffc
.getLibraryInstancesCount(key
);
219 if (instanceCount
!= 0) {
220 String
[][] saa
= new String
[instanceCount
][5];
221 ffc
.getLibraryInstances(key
, saa
);
222 for (int i
= 0; i
< saa
.length
; ++i
) {
223 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3]
227 // ToDo: verify this instance first.
229 saa
[i
][0] = mi
.getName();
230 saa
[i
][2] = mi
.getVersion();
231 saa
[i
][4] = mi
.getPackageId().getVersion();
233 // re-evaluate lib instance usage when adding a already-selected lib instance.
236 resolveLibraryInstances(saa
[i
][1] + " " + saa
[i
][2] + " " + saa
[i
][3] + " " + saa
[i
][4], errorMsg
);
237 } catch (Exception e
) {
238 String exceptionMsg
= e
.getCause() + " " + e
.getMessage();
239 if (!errorMsg
.contains(exceptionMsg
)) {
240 JOptionPane
.showMessageDialog(FrameworkWizardUI
.getInstance(), e
.getCause() + " " + e
.getMessage());
243 selectedInstancesTableModel
.addRow(saa
[i
]);
248 if (errorMsg
.size() > 0) {
250 for (int i
= 0; i
< errorMsg
.size(); ++i
) {
251 errors
+= " " + errorMsg
.get(i
) + "\n";
253 JOptionPane
.showMessageDialog(FrameworkWizardUI
.getInstance(), errors
);
255 showClassToResolved();
258 public void initFvInfo (String key
) {
260 // display module SA options
262 jTextFieldFvBinding
.setText("");
263 String fvBinding
= ffc
.getFvBinding(key
);
264 if (fvBinding
!= null) {
265 jTextFieldFvBinding
.setText(fvBinding
);
267 jTextFieldFileGuid
.setText("");
268 String fileGuid
= ffc
.getFfsFileNameGuid(key
);
269 if (fileGuid
!= null) {
270 jTextFieldFileGuid
.setText(fileGuid
);
272 jTextFieldFfsKey
.setText("");
273 String ffsKey
= ffc
.getFfsFormatKey(key
);
274 if (ffsKey
!= null) {
275 jTextFieldFfsKey
.setText(ffsKey
);
279 public void initToolChainOptions(String key
) {
281 optionsTableModel
.setRowCount(0);
282 String
[][] saa
= new String
[ffc
.getModuleSAOptionsCount(key
)][6];
283 ffc
.getModuleSAOptions(key
, saa
);
284 for (int i
= 0; i
< saa
.length
; ++i
) {
285 optionsTableModel
.addRow(saa
[i
]);
289 private void filterClassConsumedByArch (Vector
<LibraryClassDescriptor
> v
) {
290 String
[] moduleInfo
= moduleKey
.split(" ");
291 Vector
<String
> vModuleArchs
= new Vector
<String
>();
293 // Skip guid, version information, get archs to check.
295 for (int i
= 4; i
< moduleInfo
.length
; ++i
) {
296 vModuleArchs
.add(moduleInfo
[i
]);
299 // if module will be built on all platforms, no filter needed for lib classes.
301 if (vModuleArchs
.size() == 0) {
305 Iterator
<LibraryClassDescriptor
> iter
= v
.iterator();
306 while (iter
.hasNext()) {
307 LibraryClassDescriptor libInfo
= iter
.next();
309 Vector
<String
> vSupArchs
= libInfo
.getVectorFromString(libInfo
.supArchs
);
311 if (vSupArchs
.size() == 0 || (vSupArchs
.size() == 1 && vSupArchs
.get(0).equalsIgnoreCase(""))) {
313 // update lib info to module archs only.
315 libInfo
.supArchs
= "";
316 for (int i
= 0; i
< vModuleArchs
.size(); ++i
) {
317 libInfo
.supArchs
+= vModuleArchs
.get(i
);
318 libInfo
.supArchs
+= " ";
320 libInfo
.supArchs
.trim();
324 // only retain those lib class used by module archs.
326 vSupArchs
.retainAll(vModuleArchs
);
327 if (vSupArchs
.size() > 0) {
329 // update lib info to reflect which kind of arch need to select instance.
331 libInfo
.supArchs
= "";
332 for (int i
= 0; i
< vSupArchs
.size(); ++i
) {
333 libInfo
.supArchs
+= vSupArchs
.get(i
);
334 libInfo
.supArchs
+= " ";
336 libInfo
.supArchs
.trim();
340 // remove this lib definition if it supports no archs module will be built under.
346 private void resolveLibraryInstances(String key
, Vector
<String
> errorMsg
) throws MultipleInstanceException
, NoInstanceException
{
347 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(key
);
348 PackageIdentification
[] depPkgList
= null;
351 // Get dependency pkg list into which we will search lib instances.
353 depPkgList
= SurfaceAreaQuery
.getDependencePkg(null, mi
);
355 // Get the lib class consumed, produced by this module itself.
357 Vector
<LibraryClassDescriptor
> vClassConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED", mi
);
358 for (int i
= 0; i
< vClassConsumed
.size(); ++i
) {
359 vClassConsumed
.get(i
).supModTypes
= WorkspaceProfile
.getModuleType(moduleId
);
361 filterClassConsumedByArch(vClassConsumed
);
362 if (this.classConsumed
== null) {
363 this.classConsumed
= new HashMap
<LibraryClassDescriptor
, ArrayList
<String
>>();
366 for (int i
= 0; i
< vClassConsumed
.size(); ++i
) {
367 ArrayList
<String
> consumedBy
= this.classConsumed
.get(vClassConsumed
.get(i
));
368 if (consumedBy
== null) {
369 consumedBy
= new ArrayList
<String
>();
372 this.classConsumed
.put(vClassConsumed
.get(i
), consumedBy
);
375 Vector
<LibraryClassDescriptor
> vClassProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED", mi
);
376 if (this.classProduced
== null) {
377 this.classProduced
= new HashMap
<LibraryClassDescriptor
, ArrayList
<String
>>();
379 for (int i
= 0; i
< vClassProduced
.size(); ++i
) {
380 ArrayList
<String
> producedBy
= this.classProduced
.get(vClassProduced
.get(i
));
381 if (producedBy
== null) {
382 producedBy
= new ArrayList
<String
>();
385 // class already produced by previous module (lib instance).
387 if (producedBy.size() == 1) {
388 String instanceKey = producedBy.get(0);
389 ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey);
390 throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName());
392 Iterator<LibraryClassDescriptor> lcdi = this.classProduced.keySet().iterator();
393 while (lcdi.hasNext()) {
394 LibraryClassDescriptor lcd = lcdi.next();
395 if (vClassProduced.get(i).hasInterSectionWith(lcd)) {
396 ArrayList<String> alreadyProducedBy = this.classProduced.get(lcd);
397 String instanceKey = alreadyProducedBy.get(0);
398 ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey);
399 throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName());
406 this.classProduced
.put(vClassProduced
.get(i
), producedBy
);
411 // find potential instances in all pkgs for classes still in classConsumed.
413 if (classInstanceMap
== null) {
414 classInstanceMap
= new HashMap
<LibraryClassDescriptor
, ArrayList
<String
>>();
416 Iterator
<LibraryClassDescriptor
> lic
= this.classConsumed
.keySet().iterator();
417 while (lic
.hasNext()) {
418 LibraryClassDescriptor cls
= lic
.next();
419 if (isBoundedClass(cls
)) {
422 ArrayList
<String
> instances
= getInstancesForClass(cls
, depPkgList
);
423 if (instances
.size() == 0) {
424 // throw new NoInstanceException (cls.className);
425 String exceptionMsg
= new NoInstanceException (cls
.className
).getMessage();
426 if (!errorMsg
.contains(exceptionMsg
)) {
427 errorMsg
.add(exceptionMsg
);
431 classInstanceMap
.put(cls
, instances
);
434 // showClassToResolved();
437 /**Search classProduced map to see if this class has been produced by some instance (module).
441 private boolean isBoundedClass (LibraryClassDescriptor cls
) {
442 if (this.classProduced
.containsKey(cls
)) {
445 Iterator
<LibraryClassDescriptor
> lcdi
= this.classProduced
.keySet().iterator();
446 while (lcdi
.hasNext()) {
447 LibraryClassDescriptor lcd
= lcdi
.next();
448 if (cls
.isSubSetByArchs(lcd
) && cls
.isSubSetByModTypes(lcd
)) {
456 private ArrayList
<String
> getInstancesForClass(LibraryClassDescriptor cls
, PackageIdentification
[] depPkgList
){
457 ArrayList
<String
> al
= new ArrayList
<String
>();
459 // for (int i = 0; i < depPkgList.length; ++i) {
460 Iterator ismi
= GlobalData
.vModuleList
.iterator();
461 while(ismi
.hasNext()) {
462 ModuleIdentification mi
= (ModuleIdentification
)ismi
.next();
463 // if (!mi.getPackageId().getGuid().equalsIgnoreCase(depPkgList[i].getGuid())) {
466 Vector
<LibraryClassDescriptor
> clsProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED", mi
);
468 boolean isPotential
= false;
469 Iterator
<LibraryClassDescriptor
> lcdi
= clsProduced
.iterator();
470 while (lcdi
.hasNext()) {
471 LibraryClassDescriptor lcd
= lcdi
.next();
472 if (cls
.isSubSetByArchs(lcd
) && cls
.isSubSetByModTypes(lcd
)){
476 if (hasBeenProduced(lcd
)) {
482 al
.add(mi
.getGuid() + " " + mi
.getVersion() + " " +
483 mi
.getPackageId().getGuid() + " " + mi
.getPackageId().getVersion());
491 private boolean hasBeenProduced (LibraryClassDescriptor cls
) {
492 Iterator
<LibraryClassDescriptor
> lcdi
= this.classProduced
.keySet().iterator();
493 while (lcdi
.hasNext()) {
494 LibraryClassDescriptor lcd
= lcdi
.next();
495 if (cls
.hasInterSectionWith(lcd
)) {
502 private ArrayList
<String
> getConsumedBy (String className
) {
503 Iterator
<LibraryClassDescriptor
> lcdi
= this.classConsumed
.keySet().iterator();
504 while (lcdi
.hasNext()) {
505 LibraryClassDescriptor lcd
= lcdi
.next();
506 if ((lcd
.className
!= null) && lcd
.className
.equals(className
)) {
507 return this.classConsumed
.get(lcd
);
513 private void removeInstance(String key
) {
514 ModuleIdentification mi
= WorkspaceProfile
.getModuleId(key
);
516 // remove pcd information of instance from current ModuleSA
518 ffc
.removePcdData(moduleKey
, mi
);
520 // remove class produced by this instance and add back these produced class to be bound.
522 Vector
<LibraryClassDescriptor
> clsProduced
= getClassProduced(mi
);
523 for (int i
= 0; i
< clsProduced
.size(); ++i
) {
525 classProduced
.remove(clsProduced
.get(i
));
528 // remove class consumed by this instance. we do not need to bound it now.
530 String
[] clsConsumed
= getClassConsumed(mi
);
531 for (int i
= 0; i
< clsConsumed
.length
; ++i
) {
532 ArrayList
<String
> al
= getConsumedBy (clsConsumed
[i
]);
541 showClassToResolved();
546 private Vector
<LibraryClassDescriptor
> getClassProduced(ModuleIdentification mi
){
548 Vector
<LibraryClassDescriptor
> clsProduced
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_PRODUCED", mi
);
550 // String[] sClassProduced = new String[clsProduced.size()];
551 // for (int i = 0; i < clsProduced.size(); ++i) {
552 // sClassProduced[i] = clsProduced.get(i).className;
554 // return sClassProduced;
557 private String
[] getClassConsumed(ModuleIdentification mi
){
559 Vector
<LibraryClassDescriptor
> clsConsumed
= SurfaceAreaQuery
.getLibraryClasses("ALWAYS_CONSUMED", mi
);
560 String
[] sClassConsumed
= new String
[clsConsumed
.size()];
561 for (int i
= 0; i
< clsConsumed
.size(); ++i
) {
562 sClassConsumed
[i
] = clsConsumed
.get(i
).className
;
564 return sClassConsumed
;
567 private void showClassToResolved(){
568 libClassTableModel
.setRowCount(0);
569 libInstanceTableModel
.setRowCount(0);
570 if (classConsumed
== null || classConsumed
.size() == 0) {
573 Iterator
<LibraryClassDescriptor
> li
= classConsumed
.keySet().iterator();
575 LibraryClassDescriptor lcd
= li
.next();
576 String
[] s
= {lcd
.className
, lcd
.supArchs
, lcd
.supModTypes
};
577 if (classConsumed
.get(lcd
) == null || classConsumed
.get(lcd
).size() == 0) {
581 if (!isBoundedClass(lcd
)){
582 libClassTableModel
.addRow(s
);
588 private String
getModuleArch () {
590 String
[] moduleInfo
= moduleKey
.split(" ");
591 for (int i
= 4; i
< moduleInfo
.length
; ++i
) {
592 arch
+= moduleInfo
[i
];
597 private void addLibInstance (ModuleIdentification libMi
) throws Exception
{
600 // Add pcd information of selected instance to current moduleSA
602 ffc
.addFrameworkModulesPcdBuildDefs(libMi
, getModuleArch(), ffc
.getModuleSA(moduleKey
));
604 ffc
.genLibraryInstance(libMi
, moduleKey
);
607 * This method initializes this
611 private void initialize() {
612 this.setSize(877, 555);
613 this.setResizable(false);
616 this.setTitle("Module Settings");
617 this.setContentPane(getJContentPane());
621 * This method initializes jContentPane
623 * @return javax.swing.JPanel
625 private JPanel
getJContentPane() {
626 if (jContentPane
== null) {
627 jContentPane
= new JPanel();
628 jContentPane
.setLayout(new BorderLayout());
629 jContentPane
.add(getJTabbedPane(), java
.awt
.BorderLayout
.CENTER
);
630 jContentPane
.add(getJPanelContentPaneSouth(), java
.awt
.BorderLayout
.SOUTH
);
636 * This method initializes jTabbedPane
638 * @return javax.swing.JTabbedPane
640 private JTabbedPane
getJTabbedPane() {
641 if (jTabbedPane
== null) {
642 jTabbedPane
= new JTabbedPane();
643 jTabbedPane
.addTab("PCD Build Definition", null, getJPanelPcd(), null);
644 jTabbedPane
.addTab("Libraries", null, getJPanelLibrary(), null);
645 jTabbedPane
.addTab("FV Info", null, getJPanelModuleSaOpts(), null);
646 jTabbedPane
.addTab("Custom Toolchain", null, getJPanelCustomToolChain(), null);
653 * This method initializes jPanelPcd
655 * @return javax.swing.JPanel
657 private JPanel
getJPanelPcd() {
658 if (jPanelPcd
== null) {
659 jLabelPcdData
= new JLabel();
660 jLabelPcdData
.setText(" PCD Data");
661 jPanelPcd
= new JPanel();
662 jPanelPcd
.setLayout(new BorderLayout());
663 jPanelPcd
.add(jLabelPcdData
, java
.awt
.BorderLayout
.NORTH
);
664 jPanelPcd
.add(getJScrollPaneTablePcd(), java
.awt
.BorderLayout
.CENTER
);
665 jPanelPcd
.add(getJPanelPcdSouth(), java
.awt
.BorderLayout
.SOUTH
);
666 jPanelPcd
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
667 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
668 initPcdBuildDefinition(moduleSaNum
);
677 * This method initializes jPanelLibrary
679 * @return javax.swing.JPanel
681 private JPanel
getJPanelLibrary() {
682 if (jPanelLibrary
== null) {
683 jPanelLibrary
= new JPanel();
684 jPanelLibrary
.setLayout(new BorderLayout());
685 jPanelLibrary
.add(getJSplitPane(), java
.awt
.BorderLayout
.NORTH
);
686 jPanelLibrary
.add(getJPanelLibrarySouth(), java
.awt
.BorderLayout
.SOUTH
);
687 jPanelLibrary
.add(getJPanelLibraryCenter(), java
.awt
.BorderLayout
.CENTER
);
688 jPanelLibrary
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
689 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
690 initLibraries(moduleKey
);
694 return jPanelLibrary
;
698 * This method initializes jScrollPaneTablePcd
700 * @return javax.swing.JScrollPane
702 private JScrollPane
getJScrollPaneTablePcd() {
703 if (jScrollPaneTablePcd
== null) {
704 jScrollPaneTablePcd
= new JScrollPane();
705 jScrollPaneTablePcd
.setViewportView(getJTablePcd());
707 return jScrollPaneTablePcd
;
711 * This method initializes jTable
713 * @return javax.swing.JTable
715 private JTable
getJTablePcd() {
716 if (jTablePcd
== null) {
717 model
= new IDefaultTableModel();
718 jTablePcd
= new JTable(model
);
719 jTablePcd
.setRowHeight(20);
720 jTablePcd
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_ALL_COLUMNS
);
721 model
.addColumn("CName");
722 model
.addColumn("TokenSpaceGUID");
723 model
.addColumn("ItemType");
724 model
.addColumn("Token");
725 model
.addColumn("MaxDatumSize");
726 model
.addColumn("DataType");
727 model
.addColumn("DefaultValue");
729 jTablePcd
.getColumnModel().getColumn(0).setMinWidth(250);
731 TableColumn tokenColumn
= jTablePcd
.getColumnModel().getColumn(3);
732 jTablePcd
.removeColumn(tokenColumn
);
734 jTablePcd
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
735 jTablePcd
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
736 public void valueChanged(ListSelectionEvent e
) {
738 if (e
.getValueIsAdjusting()){
741 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
742 if (lsm
.isSelectionEmpty()) {
746 int selectedRow
= lsm
.getMinSelectionIndex();
747 String cName
= model
.getValueAt(selectedRow
, 0)+"";
748 String tsGuid
= model
.getValueAt(selectedRow
, 1)+"";
749 String itemType
= model
.getValueAt(selectedRow
, 2)+"";
751 // array for pcd related information: helpText, itemType, moduleType.
753 String
[] pcdInfo
= {"", "", ""};
754 Vector
<String
> validPcdTypes
= new Vector
<String
>();
755 getPcdInfo(moduleKey
, cName
, tsGuid
, pcdInfo
, validPcdTypes
);
756 jTextAreaPcdHelp
.setText(pcdInfo
[0]);
757 initComboBox(pcdInfo
[1], pcdInfo
[2], validPcdTypes
);
758 jComboBoxItemType
.setSelectedItem(itemType
);
759 jTextFieldMaxDatumSize
.setEnabled(true);
760 jTextFieldMaxDatumSize
.setVisible(true);
761 jTextFieldMaxDatumSize
.setText(model
.getValueAt(selectedRow
, 4)+"");
762 jTextFieldPcdDefault
.setEnabled(true);
763 jTextFieldPcdDefault
.setText(model
.getValueAt(selectedRow
, 6)+"");
764 if ((model
.getValueAt(selectedRow
, 5) != null) && model
.getValueAt(selectedRow
, 5).equals("VOID*")) {
765 if (pcdInfo
[1].equals("FEATURE_FLAG")) {
766 jTextFieldMaxDatumSize
.setVisible(false);
768 else if (pcdInfo
[1].equals("FIXED_AT_BUILD")) {
770 jTextFieldMaxDatumSize
.setEnabled(false);
771 jTextFieldMaxDatumSize
.setText(ffc
.setMaxSizeForPointer(model
.getValueAt(selectedRow
, 6)+"")+"");
773 catch(Exception except
){
774 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "Unacceptable PCD Value: " + except
.getMessage());
778 jTextFieldMaxDatumSize
.setText(model
.getValueAt(selectedRow
, 4)+"");
782 jTextFieldMaxDatumSize
.setEnabled(false);
785 if (!model
.getValueAt(selectedRow
, 2).equals("DYNAMIC") && !model
.getValueAt(selectedRow
, 2).equals("DYNAMIC_EX")) {
786 jTextFieldPcdDefault
.setText(model
.getValueAt(selectedRow
, 6)+"");
787 if (model
.getValueAt(selectedRow
, 2).equals("FEATURE_FLAG")){
788 jTextFieldPcdDefault
.setVisible(false);
789 jComboBoxFeatureFlagValue
.setVisible(true);
790 jComboBoxFeatureFlagValue
.setSelectedItem(model
.getValueAt(selectedRow
, 6)+"");
793 jTextFieldPcdDefault
.setVisible(true);
794 jTextFieldPcdDefault
.setEnabled(true);
795 jComboBoxFeatureFlagValue
.setVisible(false);
799 jTextFieldPcdDefault
.setEnabled(false);
811 private void initComboBox(String originalType
, String mType
, Vector
<String
> validPcdTypes
) {
812 jComboBoxItemType
.removeAllItems();
814 if (originalType
.equals("DYNAMIC")) {
815 for (int i
= 0; i
< validPcdTypes
.size(); ++i
) {
816 jComboBoxItemType
.addItem(validPcdTypes
.get(i
));
820 jComboBoxItemType
.addItem(originalType
);
827 * @param sa sa[0]: HelpText; sa[1]: itemType in Msa; sa[2]: isBinary;
829 private void getPcdInfo(String moduleKey
, String cName
, String tsGuid
, String
[] sa
, Vector
<String
> validPcdTypes
) {
830 String
[][] saa
= new String
[ffc
.getLibraryInstancesCount(moduleKey
)][5];
831 ffc
.getLibraryInstances(moduleKey
, saa
);
834 if (ffc
.getPcdBuildDataInfo(WorkspaceProfile
.getModuleId(moduleKey
), cName
, tsGuid
, sa
, validPcdTypes
)) {
837 for (int j
= 0; j
< saa
.length
; ++j
) {
838 if (ffc
.getPcdBuildDataInfo(WorkspaceProfile
.getModuleId(saa
[j
][1] + " " + saa
[j
][2] + " " + saa
[j
][3] + " " + saa
[j
][4]),
839 cName
, tsGuid
, sa
, validPcdTypes
)) {
845 JOptionPane
.showMessageDialog(this, "Get PCD details fail: " + e
.getMessage());
850 * This method initializes jPanelPcdSouth
852 * @return javax.swing.JPanel
854 private JPanel
getJPanelPcdSouth() {
855 if (jPanelPcdSouth
== null) {
856 jLabelPcdHelp
= new JLabel();
857 jLabelPcdHelp
.setText("PCD Description");
858 jPanelPcdSouth
= new JPanel();
859 jPanelPcdSouth
.setPreferredSize(new java
.awt
.Dimension(607,200));
860 jPanelPcdSouth
.add(jLabelPcdHelp
, null);
861 jPanelPcdSouth
.add(getJScrollPanePcdHelp(), null);
862 jPanelPcdSouth
.add(getJPanelPcdFields(), null);
864 return jPanelPcdSouth
;
868 * This method initializes jScrollPanePcdHelp
870 * @return javax.swing.JScrollPane
872 private JScrollPane
getJScrollPanePcdHelp() {
873 if (jScrollPanePcdHelp
== null) {
874 jScrollPanePcdHelp
= new JScrollPane();
875 jScrollPanePcdHelp
.setPreferredSize(new java
.awt
.Dimension(500,100));
876 jScrollPanePcdHelp
.setViewportView(getJTextAreaPcdHelp());
878 return jScrollPanePcdHelp
;
882 * This method initializes jTextAreaPcdHelp
884 * @return javax.swing.JTextArea
886 private JTextArea
getJTextAreaPcdHelp() {
887 if (jTextAreaPcdHelp
== null) {
888 jTextAreaPcdHelp
= new JTextArea();
889 jTextAreaPcdHelp
.setEditable(false);
891 return jTextAreaPcdHelp
;
895 * This method initializes jPanelContentPaneSouth
897 * @return javax.swing.JPanel
899 private JPanel
getJPanelContentPaneSouth() {
900 if (jPanelContentPaneSouth
== null) {
901 FlowLayout flowLayout
= new FlowLayout();
902 flowLayout
.setAlignment(java
.awt
.FlowLayout
.RIGHT
);
903 jPanelContentPaneSouth
= new JPanel();
904 jPanelContentPaneSouth
.setLayout(flowLayout
);
905 jPanelContentPaneSouth
.add(getJButtonOk(), null);
906 jPanelContentPaneSouth
.add(getJButtonCancel(), null);
908 return jPanelContentPaneSouth
;
912 * This method initializes jSplitPane
914 * @return javax.swing.JSplitPane
916 private JSplitPane
getJSplitPane() {
917 if (jSplitPane
== null) {
918 jSplitPane
= new JSplitPane();
919 jSplitPane
.setDividerLocation(200);
920 jSplitPane
.setLeftComponent(getJPanelLibraryLeft());
921 jSplitPane
.setRightComponent(getJPanelLibraryRight());
922 jSplitPane
.setPreferredSize(new java
.awt
.Dimension(202,200));
928 * This method initializes jPanelLibraryLeft
930 * @return javax.swing.JPanel
932 private JPanel
getJPanelLibraryLeft() {
933 if (jPanelLibraryLeft
== null) {
934 jLabelLibClass
= new JLabel();
935 jLabelLibClass
.setText("Library Classes Uninstantiated");
936 jPanelLibraryLeft
= new JPanel();
937 jPanelLibraryLeft
.add(jLabelLibClass
, null);
938 jPanelLibraryLeft
.add(getJScrollPaneLibClass(), null);
940 return jPanelLibraryLeft
;
944 * This method initializes jPanelLibraryRight
946 * @return javax.swing.JPanel
948 private JPanel
getJPanelLibraryRight() {
949 if (jPanelLibraryRight
== null) {
950 jLabelQualifiedInstance
= new JLabel();
951 jLabelQualifiedInstance
.setText("Instances Available");
952 jPanelLibraryRight
= new JPanel();
953 jPanelLibraryRight
.add(jLabelQualifiedInstance
, null);
954 jPanelLibraryRight
.add(getJScrollPaneQualifiedInstance(), null);
956 return jPanelLibraryRight
;
960 * This method initializes jScrollPaneSelectedInstances
962 * @return javax.swing.JScrollPane
964 private JScrollPane
getJScrollPaneSelectedInstances() {
965 if (jScrollPaneSelectedInstances
== null) {
966 jScrollPaneSelectedInstances
= new JScrollPane();
967 jScrollPaneSelectedInstances
.setPreferredSize(new java
.awt
.Dimension(600,150));
968 jScrollPaneSelectedInstances
.setViewportView(getJTableSelectedInstances());
970 return jScrollPaneSelectedInstances
;
974 * This method initializes jTableSelectedInstances
976 * @return javax.swing.JTable
978 private JTable
getJTableSelectedInstances() {
979 if (jTableSelectedInstances
== null) {
980 selectedInstancesTableModel
= new IDefaultTableModel();
981 selectedInstancesTableModel
.addColumn("Name");
982 selectedInstancesTableModel
.addColumn("ModuleGUID");
983 selectedInstancesTableModel
.addColumn("ModuleVersion");
984 selectedInstancesTableModel
.addColumn("PackageGUID");
985 selectedInstancesTableModel
.addColumn("PackageVersion");
986 jTableSelectedInstances
= new JTable(selectedInstancesTableModel
);
987 jTableSelectedInstances
.setRowHeight(20);
989 jTableSelectedInstances
.getColumnModel().getColumn(0).setMinWidth(250);
991 jTableSelectedInstances
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_SUBSEQUENT_COLUMNS
);
992 jTableSelectedInstances
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
995 return jTableSelectedInstances
;
999 * This method initializes jScrollPaneLibClass
1001 * @return javax.swing.JScrollPane
1003 private JScrollPane
getJScrollPaneLibClass() {
1004 if (jScrollPaneLibClass
== null) {
1005 jScrollPaneLibClass
= new JScrollPane();
1006 jScrollPaneLibClass
.setPreferredSize(new java
.awt
.Dimension(200,170));
1007 jScrollPaneLibClass
.setViewportView(getJTableLibClass());
1009 return jScrollPaneLibClass
;
1013 * This method initializes jTableLibClass
1015 * @return javax.swing.JTable
1017 private JTable
getJTableLibClass() {
1018 if (jTableLibClass
== null) {
1019 libClassTableModel
= new IDefaultTableModel();
1020 libClassTableModel
.addColumn("LibraryClass");
1021 libClassTableModel
.addColumn("Arch");
1022 libClassTableModel
.addColumn("ModType");
1023 jTableLibClass
= new JTable(libClassTableModel
);
1024 jTableLibClass
.setRowHeight(20);
1025 jTableLibClass
.setShowGrid(false);
1026 jTableLibClass
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1028 TableColumn column
= jTableLibClass
.getColumnModel().getColumn(1);
1029 jTableLibClass
.getColumnModel().removeColumn(column
);
1030 column
= jTableLibClass
.getColumnModel().getColumn(1);
1031 jTableLibClass
.getColumnModel().removeColumn(column
);
1033 jTableLibClass
.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
1034 public void valueChanged(ListSelectionEvent e
) {
1035 if (e
.getValueIsAdjusting()){
1038 ListSelectionModel lsm
= (ListSelectionModel
)e
.getSource();
1039 if (lsm
.isSelectionEmpty()) {
1043 int selectedRow2
= lsm
.getMinSelectionIndex();
1044 if (selectedRow2
< 0) {
1048 // display potential lib instances according to class selection
1050 libInstanceTableModel
.setRowCount(0);
1051 String cls
= libClassTableModel
.getValueAt(selectedRow2
, 0).toString();
1052 String arch
= libClassTableModel
.getValueAt(selectedRow2
, 1).toString();
1053 String modType
= libClassTableModel
.getValueAt(selectedRow2
, 2).toString();
1054 ArrayList
<String
> al
= classInstanceMap
.get(new LibraryClassDescriptor(cls
, arch
, modType
));
1058 ListIterator
<String
> li
= al
.listIterator();
1059 while(li
.hasNext()) {
1060 String instance
= li
.next();
1061 String
[] s
= {"", "", "", "", ""};
1062 if (WorkspaceProfile
.getModuleId(instance
) != null) {
1063 s
[0] = WorkspaceProfile
.getModuleId(instance
).getName();
1066 String
[] instancePart
= instance
.split(" ");
1067 for (int i
= 0; i
< instancePart
.length
; ++i
){
1068 s
[i
+1] = instancePart
[i
];
1070 libInstanceTableModel
.addRow(s
);
1077 return jTableLibClass
;
1081 * This method initializes jScrollPaneQualifiedInstance
1083 * @return javax.swing.JScrollPane
1085 private JScrollPane
getJScrollPaneQualifiedInstance() {
1086 if (jScrollPaneQualifiedInstance
== null) {
1087 jScrollPaneQualifiedInstance
= new JScrollPane();
1088 jScrollPaneQualifiedInstance
.setPreferredSize(new java
.awt
.Dimension(600,170));
1089 jScrollPaneQualifiedInstance
.setViewportView(getJTableLibInstances());
1091 return jScrollPaneQualifiedInstance
;
1095 * This method initializes jTableLibInstances
1097 * @return javax.swing.JTable
1099 private JTable
getJTableLibInstances() {
1100 if (jTableLibInstances
== null) {
1101 libInstanceTableModel
= new IDefaultTableModel();
1102 libInstanceTableModel
.addColumn("Name");
1103 libInstanceTableModel
.addColumn("ModuleGUID");
1104 libInstanceTableModel
.addColumn("ModuleVersion");
1105 libInstanceTableModel
.addColumn("PackageGUID");
1106 libInstanceTableModel
.addColumn("PackageVersion");
1107 jTableLibInstances
= new JTable(libInstanceTableModel
);
1108 jTableLibInstances
.setRowHeight(20);
1110 jTableLibInstances
.getColumnModel().getColumn(0).setMinWidth(250);
1112 jTableLibInstances
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_SUBSEQUENT_COLUMNS
);
1113 jTableLibInstances
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1116 return jTableLibInstances
;
1120 * This method initializes jPanelLibrarySouth
1122 * @return javax.swing.JPanel
1124 private JPanel
getJPanelLibrarySouth() {
1125 if (jPanelLibrarySouth
== null) {
1126 jPanelLibrarySouth
= new JPanel();
1128 return jPanelLibrarySouth
;
1132 * This method initializes jPanelLibraryCenter
1134 * @return javax.swing.JPanel
1136 private JPanel
getJPanelLibraryCenter() {
1137 if (jPanelLibraryCenter
== null) {
1138 jLabelInstanceHelp
= new JLabel();
1139 jLabelInstanceHelp
.setText("Instance Description");
1140 jLabelSelectedInstances
= new JLabel();
1141 jLabelSelectedInstances
.setText("Selected Instances");
1142 jPanelLibraryCenter
= new JPanel();
1143 jPanelLibraryCenter
.setLayout(new BorderLayout());
1145 jPanelLibraryCenter
.add(getJPanelLibraryCenterC(), java
.awt
.BorderLayout
.CENTER
);
1146 jPanelLibraryCenter
.add(getJPanelLibraryCenterN(), java
.awt
.BorderLayout
.NORTH
);
1149 return jPanelLibraryCenter
;
1153 * This method initializes jScrollPaneInstanceHelp
1155 * @return javax.swing.JScrollPane
1157 private JScrollPane
getJScrollPaneInstanceHelp() {
1158 if (jScrollPaneInstanceHelp
== null) {
1159 jScrollPaneInstanceHelp
= new JScrollPane();
1160 jScrollPaneInstanceHelp
.setPreferredSize(new java
.awt
.Dimension(400,50));
1161 jScrollPaneInstanceHelp
.setViewportView(getJTextAreaInstanceHelp());
1163 return jScrollPaneInstanceHelp
;
1167 * This method initializes jTextAreaInstanceHelp
1169 * @return javax.swing.JTextArea
1171 private JTextArea
getJTextAreaInstanceHelp() {
1172 if (jTextAreaInstanceHelp
== null) {
1173 jTextAreaInstanceHelp
= new JTextArea();
1174 jTextAreaInstanceHelp
.setEditable(false);
1176 return jTextAreaInstanceHelp
;
1180 * This method initializes jButtonAdd
1182 * @return javax.swing.JButton
1184 private JButton
getJButtonAdd() {
1185 if (jButtonAdd
== null) {
1186 jButtonAdd
= new JButton();
1187 jButtonAdd
.setPreferredSize(new java
.awt
.Dimension(80,20));
1188 jButtonAdd
.setText("Add");
1189 jButtonAdd
.addActionListener(new java
.awt
.event
.ActionListener() {
1190 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1191 int row
= jTableLibInstances
.getSelectedRow();
1196 String instanceValue
= libInstanceTableModel
.getValueAt(row
, 1) + " " +
1197 libInstanceTableModel
.getValueAt(row
, 2) + " " +
1198 libInstanceTableModel
.getValueAt(row
, 3) + " " +
1199 libInstanceTableModel
.getValueAt(row
, 4);
1200 ModuleIdentification libMi
= WorkspaceProfile
.getModuleId(instanceValue
);
1202 addLibInstance (libMi
);
1204 catch (Exception exception
) {
1205 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "Adding Instance " + libMi
.getName() + " : \n"+ exception
.getMessage());
1208 docConsole
.setSaved(false);
1209 Object
[] s
= {libInstanceTableModel
.getValueAt(row
, 0), libInstanceTableModel
.getValueAt(row
, 1),
1210 libInstanceTableModel
.getValueAt(row
, 2), libInstanceTableModel
.getValueAt(row
, 3),
1211 libInstanceTableModel
.getValueAt(row
, 4)};
1212 selectedInstancesTableModel
.addRow(s
);
1214 Vector
<String
> errorMsg
= new Vector
<String
>();
1216 resolveLibraryInstances(instanceValue
, errorMsg
);
1218 catch (Exception exp
) {
1219 JOptionPane
.showMessageDialog(FpdModuleSA
.this, exp
.getMessage());
1222 if (errorMsg
.size() > 0) {
1224 for (int i
= 0; i
< errorMsg
.size(); ++i
) {
1225 errors
+= " " + errorMsg
.get(i
) + "\n";
1227 JOptionPane
.showMessageDialog(FpdModuleSA
.this, errors
);
1229 showClassToResolved();
1237 * This method initializes jButton1
1239 * @return javax.swing.JButton
1241 private JButton
getJButtonDeleteInstance() {
1242 if (jButtonDeleteInstance
== null) {
1243 jButtonDeleteInstance
= new JButton();
1244 jButtonDeleteInstance
.setPreferredSize(new java
.awt
.Dimension(80,20));
1245 jButtonDeleteInstance
.setText("Delete");
1246 jButtonDeleteInstance
.addActionListener(new java
.awt
.event
.ActionListener() {
1247 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1248 int row
= jTableSelectedInstances
.getSelectedRow();
1252 docConsole
.setSaved(false);
1253 removeInstance(selectedInstancesTableModel
.getValueAt(row
, 1) + " " +
1254 selectedInstancesTableModel
.getValueAt(row
, 2) + " " +
1255 selectedInstancesTableModel
.getValueAt(row
, 3) + " " +
1256 selectedInstancesTableModel
.getValueAt(row
, 4));
1257 ffc
.removeLibraryInstance(moduleKey
, row
);
1258 selectedInstancesTableModel
.removeRow(row
);
1263 return jButtonDeleteInstance
;
1267 * This method initializes jButton2
1269 * @return javax.swing.JButton
1271 private JButton
getJButtonOk() {
1272 if (jButtonOk
== null) {
1273 jButtonOk
= new JButton();
1274 jButtonOk
.setPreferredSize(new java
.awt
.Dimension(80,20));
1275 jButtonOk
.setText("Close");
1276 jButtonOk
.addActionListener(this);
1282 * This method initializes jButton3
1284 * @return javax.swing.JButton
1286 private JButton
getJButtonCancel() {
1287 if (jButtonCancel
== null) {
1288 jButtonCancel
= new JButton();
1289 jButtonCancel
.setPreferredSize(new java
.awt
.Dimension(80,20));
1290 jButtonCancel
.setText("Cancel");
1291 jButtonCancel
.setVisible(false);
1293 return jButtonCancel
;
1295 public void actionPerformed(ActionEvent arg0
) {
1297 if (arg0
.getSource() == jButtonOk
) {
1298 if (jTableModuleSaOptions
.isEditing()) {
1299 jTableModuleSaOptions
.getCellEditor().stopCellEditing();
1301 this.setVisible(false);
1305 * This method initializes jPanelModuleSaOpts
1307 * @return javax.swing.JPanel
1309 private JPanel
getJPanelModuleSaOpts() {
1310 if (jPanelModuleSaOpts
== null) {
1311 FlowLayout flowLayout4
= new FlowLayout();
1312 flowLayout4
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1313 jLabelFfsFormatKey
= new JLabel();
1314 jLabelFfsFormatKey
.setText("FFS Format Key");
1315 jLabelFfsFormatKey
.setPreferredSize(new java
.awt
.Dimension(90,16));
1316 jLabelFfsFileGuid
= new JLabel();
1317 jLabelFfsFileGuid
.setText("FFS File GUID");
1318 jLabelFfsFileGuid
.setPreferredSize(new java
.awt
.Dimension(90,16));
1319 jLabelFfsFileGuid
.setVisible(false);
1320 jLabelFvBinding
= new JLabel();
1321 jLabelFvBinding
.setText("FV Binding");
1322 jLabelFvBinding
.setPreferredSize(new java
.awt
.Dimension(90,16));
1323 jPanelModuleSaOpts
= new JPanel();
1324 jPanelModuleSaOpts
.setLayout(flowLayout4
);
1325 jPanelModuleSaOpts
.add(jLabelFvBinding
, null);
1326 jPanelModuleSaOpts
.add(getJTextFieldFvBinding(), null);
1327 jPanelModuleSaOpts
.add(jLabelFfsFileGuid
, null);
1328 jPanelModuleSaOpts
.add(getJTextFieldFileGuid(), null);
1329 jPanelModuleSaOpts
.add(jLabelFfsFormatKey
, null);
1330 jPanelModuleSaOpts
.add(getJTextFieldFfsKey(), null);
1331 jPanelModuleSaOpts
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
1332 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
1333 initFvInfo(moduleKey
);
1337 return jPanelModuleSaOpts
;
1340 private Vector
<String
> getVectorFromString (String s
) {
1341 if (s
== null || s
.equals("null")) {
1344 String
[] sa1
= s
.split(" ");
1345 Vector
<String
> v
= new Vector
<String
>();
1346 for (int i
= 0; i
< sa1
.length
; ++i
) {
1353 * This method initializes jTextField
1355 * @return javax.swing.JTextField
1357 private JTextField
getJTextFieldFvBinding() {
1358 if (jTextFieldFvBinding
== null) {
1359 jTextFieldFvBinding
= new JTextField();
1360 jTextFieldFvBinding
.setPreferredSize(new java
.awt
.Dimension(400,20));
1361 jTextFieldFvBinding
.setEditable(true);
1362 jTextFieldFvBinding
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1363 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1364 String originalFvBinding
= ffc
.getFvBinding(moduleKey
);
1365 String newFvBinding
= jTextFieldFvBinding
.getText();
1366 if (newFvBinding
.equals(originalFvBinding
)) {
1369 if (newFvBinding
.length() == 0 && originalFvBinding
== null) {
1373 Vector
<String
> oldFvList
= getVectorFromString (originalFvBinding
);
1374 Vector
<String
> newFvList
= getVectorFromString (newFvBinding
);
1375 String moduleInfo
[] = moduleKey
.split(" ");
1376 ffc
.setFvBinding(moduleKey
, newFvBinding
);
1378 // remove module from Fvs that not in newFvList now.
1380 oldFvList
.removeAll(newFvList
);
1381 for (int j
= 0; j
< oldFvList
.size(); ++j
) {
1382 ffc
.removeModuleInBuildOptionsUserExtensions(oldFvList
.get(j
), "IMAGES", 1, moduleInfo
[0], moduleInfo
[1], moduleInfo
[2], moduleInfo
[3], moduleInfo
[4]);
1385 // add module to Fvs that were not in oldFvList.
1387 oldFvList
= getVectorFromString (originalFvBinding
);
1388 newFvList
.removeAll(oldFvList
);
1389 for (int i
= 0; i
< newFvList
.size(); ++i
) {
1390 ffc
.addModuleIntoBuildOptionsUserExtensions(newFvList
.get(i
), "IMAGES", 1, moduleInfo
[0], moduleInfo
[1], moduleInfo
[2], moduleInfo
[3], moduleInfo
[4]);
1392 docConsole
.setSaved(false);
1397 return jTextFieldFvBinding
;
1400 * This method initializes jTextField1
1402 * @return javax.swing.JTextField
1404 private JTextField
getJTextFieldFileGuid() {
1405 if (jTextFieldFileGuid
== null) {
1406 jTextFieldFileGuid
= new JTextField();
1407 jTextFieldFileGuid
.setPreferredSize(new java
.awt
.Dimension(300,20));
1408 jTextFieldFileGuid
.setVisible(false);
1409 jTextFieldFileGuid
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1410 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1411 String originalFileGuid
= ffc
.getFfsFileNameGuid(moduleKey
);
1412 String newFileGuid
= jTextFieldFileGuid
.getText();
1413 if (newFileGuid
.equals(originalFileGuid
)) {
1416 if (newFileGuid
.length() == 0 && originalFileGuid
== null) {
1419 if (newFileGuid
.length() > 0) {
1420 if (!DataValidation
.isGuid(newFileGuid
)) {
1421 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "FFS File Guid is NOT GUID Type.");
1426 docConsole
.setSaved(false);
1427 if (newFileGuid
.length() == 0) {
1430 ffc
.setFfsFileNameGuid(moduleKey
, newFileGuid
);
1435 return jTextFieldFileGuid
;
1438 * This method initializes jTextFieldFfsKey
1440 * @return javax.swing.JTextField
1442 private JTextField
getJTextFieldFfsKey() {
1443 if (jTextFieldFfsKey
== null) {
1444 jTextFieldFfsKey
= new JTextField();
1445 jTextFieldFfsKey
.setPreferredSize(new java
.awt
.Dimension(250,20));
1446 jTextFieldFfsKey
.addFocusListener(new java
.awt
.event
.FocusAdapter() {
1447 public void focusLost(java
.awt
.event
.FocusEvent e
) {
1448 String originalFfsKey
= ffc
.getFfsFormatKey(moduleKey
);
1449 String newFfsKey
= jTextFieldFfsKey
.getText();
1450 if (newFfsKey
.equals(originalFfsKey
)) {
1453 if (newFfsKey
.length() == 0 && originalFfsKey
== null) {
1456 docConsole
.setSaved(false);
1457 ffc
.setFfsFormatKey(moduleKey
, newFfsKey
);
1462 return jTextFieldFfsKey
;
1465 * This method initializes jScrollPaneModuleSaOptions
1467 * @return javax.swing.JScrollPane
1469 private JScrollPane
getJScrollPaneModuleSaOptions() {
1470 if (jScrollPaneModuleSaOptions
== null) {
1471 jScrollPaneModuleSaOptions
= new JScrollPane();
1472 jScrollPaneModuleSaOptions
.setPreferredSize(new java
.awt
.Dimension(600,350));
1473 jScrollPaneModuleSaOptions
.setViewportView(getJTableModuleSaOptions());
1475 return jScrollPaneModuleSaOptions
;
1478 * This method initializes jTableModuleSaOptions
1480 * @return javax.swing.JTable
1482 private JTable
getJTableModuleSaOptions() {
1483 if (jTableModuleSaOptions
== null) {
1484 optionsTableModel
= new DefaultTableModel();
1485 optionsTableModel
.addColumn("BuildTargets");
1486 optionsTableModel
.addColumn("ToolChainFamily");
1487 optionsTableModel
.addColumn("TagName");
1488 optionsTableModel
.addColumn("ToolCode");
1489 optionsTableModel
.addColumn("SupportedArchs");
1490 optionsTableModel
.addColumn("Contents");
1491 jTableModuleSaOptions
= new JTable(optionsTableModel
);
1492 jTableModuleSaOptions
.setRowHeight(20);
1494 jTableModuleSaOptions
.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth
);
1495 jTableModuleSaOptions
.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth
);
1496 jTableModuleSaOptions
.getColumnModel().getColumn(2).setMinWidth(tagNameWidth
);
1497 jTableModuleSaOptions
.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth
);
1498 jTableModuleSaOptions
.getColumnModel().getColumn(4).setMinWidth(supportArchWidth
);
1499 jTableModuleSaOptions
.getColumnModel().getColumn(5).setMinWidth(argWidth
);
1500 // javax.swing.table.TableColumn toolFamilyCol = jTableModuleSaOptions.getColumnModel().getColumn(1);
1501 // JComboBox cb = new JComboBox();
1502 // cb.addItem("MSFT");
1503 // cb.addItem("GCC");
1504 // cb.addItem("CYGWIN");
1505 // cb.addItem("INTEL");
1506 // cb.addItem("USER_DEFINED");
1507 // toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
1509 Vector
<String
> vArch
= new Vector
<String
>();
1516 jTableModuleSaOptions
.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch
, FrameworkWizardUI
.getInstance()));
1518 jTableModuleSaOptions
.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor(FrameworkWizardUI
.getInstance()));
1520 jTableModuleSaOptions
.setSelectionMode(ListSelectionModel
.SINGLE_SELECTION
);
1521 jTableModuleSaOptions
.setAutoResizeMode(javax
.swing
.JTable
.AUTO_RESIZE_OFF
);
1522 jTableModuleSaOptions
.getModel().addTableModelListener(new TableModelListener() {
1523 public void tableChanged(TableModelEvent arg0
) {
1524 // TODO Auto-generated method stub
1525 int row
= arg0
.getFirstRow();
1526 TableModel m
= (TableModel
)arg0
.getSource();
1528 if (arg0
.getType() == TableModelEvent
.UPDATE
){
1529 //ToDo Data Validition check.
1530 String targets
= m
.getValueAt(row
, 0) + "";
1531 Vector
<Object
> targetName
= null;
1532 if (targets
.length() > 0) {
1533 targetName
= new Vector
<Object
>();
1534 String
[] sArray
= targets
.split(" ");
1535 for (int i
= 0; i
< sArray
.length
; ++i
) {
1536 targetName
.add(sArray
[i
]);
1540 String toolChain
= m
.getValueAt(row
, 1) + "";
1541 String tagName
= m
.getValueAt(row
, 2) + "";
1542 String toolCode
= m
.getValueAt(row
, 3) + "";
1543 String archs
= m
.getValueAt(row
, 4) + "";
1544 Vector
<Object
> supArch
= null;
1545 if (archs
.length() > 0) {
1546 supArch
= new Vector
<Object
>();
1547 String
[] sArray1
= archs
.split(" ");
1548 for (int i
= 0; i
< sArray1
.length
; ++i
) {
1549 supArch
.add(sArray1
[i
]);
1553 String contents
= m
.getValueAt(row
, 5) + "";
1554 docConsole
.setSaved(false);
1555 ffc
.updateModuleSAOptionsOpt(moduleKey
, row
, targetName
, toolChain
, tagName
, toolCode
, supArch
, contents
);
1560 return jTableModuleSaOptions
;
1563 * This method initializes jButtonNew
1565 * @return javax.swing.JButton
1567 private JButton
getJButtonNew() {
1568 if (jButtonNew
== null) {
1569 jButtonNew
= new JButton();
1570 jButtonNew
.setPreferredSize(new java
.awt
.Dimension(80,20));
1571 jButtonNew
.setText("New");
1572 jButtonNew
.addActionListener(new java
.awt
.event
.ActionListener() {
1573 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1574 String
[] row
= {"", "", "", "", "", ""};
1575 optionsTableModel
.addRow(row
);
1576 Vector
<Object
> v
= null;
1577 Vector
<Object
> v1
= null;
1578 docConsole
.setSaved(false);
1579 ffc
.genModuleSAOptionsOpt(moduleKey
, v
, "", "", "", v1
, "");
1586 * This method initializes jButtonDelete
1588 * @return javax.swing.JButton
1590 private JButton
getJButtonDeleteOption() {
1591 if (jButtonDeleteOption
== null) {
1592 jButtonDeleteOption
= new JButton();
1593 jButtonDeleteOption
.setPreferredSize(new java
.awt
.Dimension(80,20));
1594 jButtonDeleteOption
.setText("Delete");
1595 jButtonDeleteOption
.addActionListener(new java
.awt
.event
.ActionListener() {
1596 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1597 if (jTableModuleSaOptions
.getSelectedRow() < 0) {
1600 docConsole
.setSaved(false);
1601 ffc
.removeModuleSAOptionsOpt(moduleKey
, jTableModuleSaOptions
.getSelectedRow());
1602 optionsTableModel
.removeRow(jTableModuleSaOptions
.getSelectedRow());
1606 return jButtonDeleteOption
;
1610 Start the window at the center of screen
1613 protected void centerWindow(int intWidth
, int intHeight
) {
1614 Dimension d
= Toolkit
.getDefaultToolkit().getScreenSize();
1615 this.setLocation((d
.width
- intWidth
) / 2, (d
.height
- intHeight
) / 2);
1619 Start the window at the center of screen
1622 protected void centerWindow() {
1623 centerWindow(this.getSize().width
, this.getSize().height
);
1626 * This method initializes jPanelPcdFields
1628 * @return javax.swing.JPanel
1630 private JPanel
getJPanelPcdFields() {
1631 if (jPanelPcdFields
== null) {
1632 GridLayout gridLayout
= new GridLayout();
1633 gridLayout
.setRows(3);
1634 gridLayout
.setColumns(2);
1635 jPanelPcdFields
= new JPanel();
1636 jPanelPcdFields
.setLayout(gridLayout
);
1637 jPanelPcdFields
.setPreferredSize(new java
.awt
.Dimension(600,90));
1638 jPanelPcdFields
.add(getJPanelPcdFieldsFirstRow(), null);
1639 jPanelPcdFields
.add(getJPanelPcdFieldsSecondRow(), null);
1640 jPanelPcdFields
.add(getJPanelPcdFieldsThirdRow(), null);
1642 return jPanelPcdFields
;
1645 * This method initializes jPanelPcdFieldsSecondRow
1647 * @return javax.swing.JPanel
1649 private JPanel
getJPanelPcdFieldsSecondRow() {
1650 if (jPanelPcdFieldsSecondRow
== null) {
1651 FlowLayout flowLayout2
= new FlowLayout();
1652 flowLayout2
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1653 jLabelMaxDatumSize
= new JLabel();
1654 jLabelMaxDatumSize
.setText("Max Datum Size");
1655 jPanelPcdFieldsSecondRow
= new JPanel();
1656 jPanelPcdFieldsSecondRow
.setLayout(flowLayout2
);
1657 jPanelPcdFieldsSecondRow
.add(jLabelMaxDatumSize
, null);
1658 jPanelPcdFieldsSecondRow
.add(getJTextFieldMaxDatumSize(), null);
1660 return jPanelPcdFieldsSecondRow
;
1663 * This method initializes jPanelPcdFieldsThirdRow
1665 * @return javax.swing.JPanel
1667 private JPanel
getJPanelPcdFieldsThirdRow() {
1668 if (jPanelPcdFieldsThirdRow
== null) {
1669 FlowLayout flowLayout3
= new FlowLayout();
1670 flowLayout3
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1671 jLabelPcdDefaultValue
= new JLabel();
1672 jLabelPcdDefaultValue
.setText("Default Value");
1673 jLabelPcdDefaultValue
.setPreferredSize(new java
.awt
.Dimension(91,16));
1674 jPanelPcdFieldsThirdRow
= new JPanel();
1675 jPanelPcdFieldsThirdRow
.setLayout(flowLayout3
);
1676 jPanelPcdFieldsThirdRow
.add(jLabelPcdDefaultValue
, null);
1677 jPanelPcdFieldsThirdRow
.add(getJTextFieldPcdDefault(), null);
1678 jPanelPcdFieldsThirdRow
.add(getJComboBoxFeatureFlagValue(), null);
1679 jPanelPcdFieldsThirdRow
.add(getJButtonUpdatePcd(), null);
1681 return jPanelPcdFieldsThirdRow
;
1684 * This method initializes jPanelPcdFieldsFirstRow
1686 * @return javax.swing.JPanel
1688 private JPanel
getJPanelPcdFieldsFirstRow() {
1689 if (jPanelPcdFieldsFirstRow
== null) {
1690 FlowLayout flowLayout1
= new FlowLayout();
1691 flowLayout1
.setAlignment(java
.awt
.FlowLayout
.LEFT
);
1692 jLabelItemType
= new JLabel();
1693 jLabelItemType
.setText("Item Type");
1694 jLabelItemType
.setPreferredSize(new java
.awt
.Dimension(91,16));
1695 jPanelPcdFieldsFirstRow
= new JPanel();
1696 jPanelPcdFieldsFirstRow
.setLayout(flowLayout1
);
1697 jPanelPcdFieldsFirstRow
.add(jLabelItemType
, null);
1698 jPanelPcdFieldsFirstRow
.add(getJComboBoxItemType(), null);
1700 return jPanelPcdFieldsFirstRow
;
1703 * This method initializes jComboBoxItemType
1705 * @return javax.swing.JComboBox
1707 private JComboBox
getJComboBoxItemType() {
1708 if (jComboBoxItemType
== null) {
1709 jComboBoxItemType
= new JComboBox();
1710 jComboBoxItemType
.setPreferredSize(new java
.awt
.Dimension(200,20));
1711 jComboBoxItemType
.addItemListener(new java
.awt
.event
.ItemListener() {
1712 public void itemStateChanged(java
.awt
.event
.ItemEvent e
) {
1714 int row
= jTablePcd
.getSelectedRow();
1719 if (jComboBoxItemType
.getSelectedItem() != null && jComboBoxItemType
.getSelectedItem().equals("FIXED_AT_BUILD")) {
1720 jTextFieldPcdDefault
.setEnabled(true);
1723 jTextFieldPcdDefault
.setEnabled(false);
1728 return jComboBoxItemType
;
1731 private void pcdDynamicToNonDynamic(String cName
, String tsGuid
) {
1732 String
[][] saa
= new String
[ffc
.getDynamicPcdBuildDataCount()][5];
1733 ffc
.getDynamicPcdBuildData(saa
);
1734 String maxSize
= "";
1736 for (int i
= 0; i
< saa
.length
; ++i
) {
1737 if (saa
[i
][0].equals(cName
) && saa
[i
][2].equals(tsGuid
)) {
1738 maxSize
= saa
[i
][3];
1739 value
= ffc
.getDynamicPcdBuildDataValue(i
);
1744 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1745 for (int i
= 0; i
< al
.size(); ++i
) {
1746 String mKey
= moduleInfo (al
.get(i
));
1748 String itemType
= jComboBoxItemType
.getSelectedItem()+"";
1749 ffc
.updatePcdData(mKey
, cName
, tsGuid
, itemType
, maxSize
, value
);
1750 al
.set(i
, mKey
+ " " + itemType
);
1753 ffc
.removeDynamicPcdBuildData(cName
, tsGuid
);
1756 private void pcdNonDynamicToDynamic(String cName
, String tsGuid
) {
1757 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1758 for (int i
= 0; i
< al
.size(); ++i
) {
1759 String mKey
= moduleInfo (al
.get(i
));
1760 String itemType
= jComboBoxItemType
.getSelectedItem()+"";
1761 ffc
.updatePcdData(mKey
, cName
, tsGuid
, itemType
, jTextFieldMaxDatumSize
.getText(), jTextFieldPcdDefault
.isVisible() ? jTextFieldPcdDefault
.getText() : jComboBoxFeatureFlagValue
.getSelectedItem()+"");
1762 al
.set(i
, mKey
+ " " + itemType
);
1765 ffc
.addDynamicPcdBuildData(cName
, model
.getValueAt(jTablePcd
.getSelectedRow(), 3), tsGuid
, "DYNAMIC", model
.getValueAt(jTablePcd
.getSelectedRow(), 5)+"", jTextFieldPcdDefault
.isVisible() ? jTextFieldPcdDefault
.getText() : jComboBoxFeatureFlagValue
.getSelectedItem()+"");
1768 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "PCD value format: " + e
.getMessage());
1772 private void changePcdTypeWithinSameCategory (String cName
, String tsGuid
) {
1773 ArrayList
<String
> al
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1774 for (int i
= 0; i
< al
.size(); ++i
) {
1775 String mKey
= moduleInfo (al
.get(i
));
1776 String itemType
= jComboBoxItemType
.getSelectedItem()+"";
1777 ffc
.updatePcdData(mKey
, cName
, tsGuid
, itemType
, null, null);
1778 al
.set(i
, mKey
+ " " + itemType
);
1782 private String
moduleInfo (String pcdInfo
) {
1784 return pcdInfo
.substring(0, pcdInfo
.lastIndexOf(" "));
1788 * This method initializes jTextFieldMaxDatumSize
1790 * @return javax.swing.JTextField
1792 private JTextField
getJTextFieldMaxDatumSize() {
1793 if (jTextFieldMaxDatumSize
== null) {
1794 jTextFieldMaxDatumSize
= new JTextField();
1795 jTextFieldMaxDatumSize
.setPreferredSize(new java
.awt
.Dimension(200,20));
1797 return jTextFieldMaxDatumSize
;
1800 * This method initializes jTextField4
1802 * @return javax.swing.JTextField
1804 private JTextField
getJTextFieldPcdDefault() {
1805 if (jTextFieldPcdDefault
== null) {
1806 jTextFieldPcdDefault
= new JTextField();
1807 jTextFieldPcdDefault
.setPreferredSize(new java
.awt
.Dimension(200,20));
1809 return jTextFieldPcdDefault
;
1812 * This method initializes jButton6
1814 * @return javax.swing.JButton
1816 private JButton
getJButtonUpdatePcd() {
1817 if (jButtonUpdatePcd
== null) {
1818 jButtonUpdatePcd
= new JButton();
1819 jButtonUpdatePcd
.setPreferredSize(new java
.awt
.Dimension(150,20));
1820 jButtonUpdatePcd
.setText("Update PCD Data");
1821 jButtonUpdatePcd
.addActionListener(new java
.awt
.event
.ActionListener() {
1822 public void actionPerformed(java
.awt
.event
.ActionEvent e
) {
1823 int row
= jTablePcd
.getSelectedRow();
1828 String cName
= model
.getValueAt(row
, 0)+"";
1829 String tsGuid
= model
.getValueAt(row
, 1)+"";
1830 String oldItemType
= model
.getValueAt(row
, 2)+"";
1831 String dataType
= model
.getValueAt(row
, 5)+"";
1832 String newItemType
= jComboBoxItemType
.getSelectedItem()+"";
1833 String newValue
= jTextFieldPcdDefault
.isVisible()? jTextFieldPcdDefault
.getText():jComboBoxFeatureFlagValue
.getSelectedItem()+"";
1834 if (newValue
.length() == 0){
1836 if (dataType
.equals("UINT8") || dataType
.equals("UINT16") || dataType
.equals("UINT32") || dataType
.equals("UINT64")) {
1839 if (dataType
.equals("BOOLEAN")){
1842 if (dataType
.equals("VOID*")) {
1847 String
[] pcdInfo
= {"", "", ""};
1848 Vector
<String
> validPcdTypes
= new Vector
<String
>();
1849 getPcdInfo (moduleKey
, cName
, tsGuid
, pcdInfo
, validPcdTypes
);
1850 if (pcdInfo
[1].equals("FIXED_AT_BUILD") && model
.getValueAt(row
, 5).equals("VOID*")) {
1852 jTextFieldMaxDatumSize
.setText(ffc
.setMaxSizeForPointer(newValue
)+"");
1854 catch (Exception exp
) {
1855 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "PCD Value MalFormed: " + exp
.getMessage());
1859 String newMaxDatumSize
= jTextFieldMaxDatumSize
.getText();
1861 if (!newItemType
.equals(oldItemType
)) {
1862 Vector
<ModuleIdentification
> moduleInfo
= new Vector
<ModuleIdentification
>();
1864 boolean changable
= itemTypeCouldBeChanged (cName
, tsGuid
, newItemType
, moduleInfo
);
1866 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "Can NOT Change Pcd Type in: " + moduleInfo
.get(0).getName() + " contained in package " + moduleInfo
.get(0).getPackageId().getName());
1870 catch (Exception exp
) {
1871 JOptionPane
.showMessageDialog(FpdModuleSA
.this, "Can NOT Change Pcd Type in: " + moduleInfo
.get(0).getName() + " contained in package " + moduleInfo
.get(0).getPackageId().getName() + " " + exp
.getMessage());
1875 if ((oldItemType
.equals("DYNAMIC") || oldItemType
.equals("DYNAMIC_EX")) && !newItemType
.equals("DYNAMIC") && !newItemType
.equals("DYNAMIC_EX")) {
1876 pcdDynamicToNonDynamic(cName
, tsGuid
);
1878 if (!oldItemType
.equals("DYNAMIC") && !oldItemType
.equals("DYNAMIC_EX") && (newItemType
.equals("DYNAMIC") || newItemType
.equals("DYNAMIC_EX"))) {
1879 pcdNonDynamicToDynamic(cName
, tsGuid
);
1882 changePcdTypeWithinSameCategory (cName
, tsGuid
);
1884 model
.setValueAt(newItemType
, row
, 2);
1887 ffc
.updatePcdData(moduleKey
, cName
, tsGuid
, model
.getValueAt(row
, 2)+"", newMaxDatumSize
, newValue
);
1888 docConsole
.setSaved(false);
1889 model
.setValueAt(newValue
, row
, 6);
1890 model
.setValueAt(newMaxDatumSize
, row
, 4);
1895 return jButtonUpdatePcd
;
1898 private boolean itemTypeCouldBeChanged (String cName
, String tsGuid
, String newItemType
, Vector
<ModuleIdentification
> mi
) throws Exception
{
1899 ArrayList
<String
> pcdConsumers
= ffc
.getDynPcdMapValue(cName
+ " " + tsGuid
);
1900 for (int i
= 0; i
< pcdConsumers
.size(); ++i
) {
1901 String consumerInfo
= moduleInfo (pcdConsumers
.get(i
));
1902 mi
.removeAllElements();
1903 mi
.add(WorkspaceProfile
.getModuleId(consumerInfo
));
1904 String
[] sa
= {"", "", ""};
1905 Vector
<String
> validPcdTypes
= new Vector
<String
>();
1906 getPcdInfo (consumerInfo
, cName
, tsGuid
, sa
, validPcdTypes
);
1907 if (validPcdTypes
.size() == 0) {
1910 if (!sa
[1].equals("DYNAMIC")) {
1913 if (!validPcdTypes
.contains(newItemType
)) {
1921 * This method initializes jComboBoxFeatureFlagValue
1923 * @return javax.swing.JComboBox
1925 private JComboBox
getJComboBoxFeatureFlagValue() {
1926 if (jComboBoxFeatureFlagValue
== null) {
1927 jComboBoxFeatureFlagValue
= new JComboBox();
1928 jComboBoxFeatureFlagValue
.setPreferredSize(new java
.awt
.Dimension(100,20));
1929 jComboBoxFeatureFlagValue
.setVisible(false);
1930 jComboBoxFeatureFlagValue
.addItem("TRUE");
1931 jComboBoxFeatureFlagValue
.addItem("FALSE");
1933 return jComboBoxFeatureFlagValue
;
1936 * This method initializes jPanelCustomToolChain
1938 * @return javax.swing.JPanel
1940 private JPanel
getJPanelCustomToolChain() {
1941 if (jPanelCustomToolChain
== null) {
1942 jPanelCustomToolChain
= new JPanel();
1943 jPanelCustomToolChain
.setLayout(new BorderLayout());
1944 jPanelCustomToolChain
.add(getJPanelToolchainS(), java
.awt
.BorderLayout
.SOUTH
);
1945 jPanelCustomToolChain
.add(getJScrollPaneModuleSaOptions(), java
.awt
.BorderLayout
.CENTER
);
1946 jPanelCustomToolChain
.addComponentListener(new java
.awt
.event
.ComponentAdapter() {
1947 public void componentShown(java
.awt
.event
.ComponentEvent e
) {
1948 initToolChainOptions(moduleKey
);
1952 return jPanelCustomToolChain
;
1955 * This method initializes jPanelToolchainS
1957 * @return javax.swing.JPanel
1959 private JPanel
getJPanelToolchainS() {
1960 if (jPanelToolchainS
== null) {
1961 jPanelToolchainS
= new JPanel();
1962 jPanelToolchainS
.add(getJButtonNew(), null);
1963 jPanelToolchainS
.add(getJButtonDeleteOption(), null);
1965 return jPanelToolchainS
;
1969 * This method initializes jPanelLibraryCenterN
1971 * @return javax.swing.JPanel
1973 private JPanel
getJPanelLibraryCenterN() {
1974 if (jPanelLibraryCenterN
== null) {
1975 FlowLayout flowLayout5
= new FlowLayout();
1976 flowLayout5
.setAlignment(java
.awt
.FlowLayout
.CENTER
);
1977 flowLayout5
.setHgap(10);
1978 jPanelLibraryCenterN
= new JPanel();
1979 jPanelLibraryCenterN
.setLayout(flowLayout5
);
1980 jPanelLibraryCenterN
.add(jLabelInstanceHelp
, null);
1981 jPanelLibraryCenterN
.add(getJScrollPaneInstanceHelp(), null);
1982 jPanelLibraryCenterN
.add(getJButtonAdd(), null);
1983 jPanelLibraryCenterN
.add(getJButtonDeleteInstance(), null);
1985 return jPanelLibraryCenterN
;
1988 * This method initializes jPanelLibraryCenterC
1990 * @return javax.swing.JPanel
1992 private JPanel
getJPanelLibraryCenterC() {
1993 if (jPanelLibraryCenterC
== null) {
1994 jPanelLibraryCenterC
= new JPanel();
1995 jPanelLibraryCenterC
.add(jLabelSelectedInstances
, null);
1996 jPanelLibraryCenterC
.add(getJScrollPaneSelectedInstances(), null);
1998 return jPanelLibraryCenterC
;
2002 } // @jve:decl-index=0:visual-constraint="10,10"
2004 class MultipleInstanceException
extends Exception
{
2009 private static final long serialVersionUID
= -9148463005930920297L;
2010 private String className
= null;
2011 private String libInstance1
= null;
2012 private String libInstance2
= null;
2014 MultipleInstanceException (String libClass
, String instance1
, String instance2
) {
2016 className
= libClass
;
2017 libInstance1
= instance1
;
2018 libInstance2
= instance2
;
2022 * @see java.lang.Throwable#getMessage()
2025 public String
getMessage() {
2026 // TODO Auto-generated method stub
2027 return " Library Class " + className
+ "is Produced by Two Instances: "
2028 + libInstance1
+ " and " + libInstance2
+ ". Platform Build will Fail.";
2033 class NoInstanceException
extends Exception
{
2038 private static final long serialVersionUID
= 1987122786598970598L;
2040 private String className
= null;
2042 NoInstanceException (String libClass
) {
2043 className
= libClass
;
2046 public String
getMessage() {
2047 return "No Applicable Instance for Library Class " + className
2048 + ", Platform Build will Fail.";