X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FJava%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdModuleSA.java;h=18cb1603b9c50627297604f5ecb599d3de5ecfac;hp=4d23bec664352e10a53205b2cf7a0de167733bdc;hb=2cd33eaf8292e0ac7939019b02c06f0aafde559e;hpb=5a502bd47aaf312ee39560c6e59a353264a17113 diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java index 4d23bec664..18cb1603b9 100644 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java +++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java @@ -21,12 +21,14 @@ import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableColumn; import javax.swing.table.TableModel; import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.GlobalData; import org.tianocore.frameworkwizard.common.IDefaultTableModel; import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; +import org.tianocore.frameworkwizard.platform.ui.global.LibraryClassDescriptor; import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile; import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification; @@ -93,9 +95,13 @@ public class FpdModuleSA extends JDialog implements ActionListener { private FpdFileContents ffc = null; private String moduleKey = null; private int moduleSaNum = -1; - private HashMap> classInstanceMap = null; - private ArrayList classProduced = null; - private HashMap> classConsumed = null; + private HashMap> classInstanceMap = null; + // + // map of <{libName, supArch, supMod}, list of Module information> + // + private HashMap> classConsumed = null; + private HashMap> classProduced = null; + private JPanel jPanelModuleSaOpts = null; private JLabel jLabelFvBinding = null; private JTextField jTextFieldFvBinding = null; @@ -124,6 +130,14 @@ public class FpdModuleSA extends JDialog implements ActionListener { private JPanel jPanelToolchainS = null; private JPanel jPanelLibraryCenterN = null; private JPanel jPanelLibraryCenterC = null; // @jve:decl-index=0:visual-constraint="20,224" + + private final int buildTargetWidth = 150; + private final int toolChainFamilyWidth = 150; + private final int supportArchWidth = 150; + private final int toolCmdCodeWidth = 200; + private final int tagNameWidth = 150; + private final int argWidth = 400; + /** * This is the default constructor */ @@ -140,10 +154,19 @@ public class FpdModuleSA extends JDialog implements ActionListener { this.moduleKey = k; moduleSaNum = i; this.docConsole = dc; + classInstanceMap = null; classProduced = null; classConsumed = null; jTabbedPane.setSelectedIndex(0); initPcdBuildDefinition(i); + ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey); + int tabIndex = jTabbedPane.indexOfTab("Libraries"); + if (mi.isLibrary()) { + jTabbedPane.setEnabledAt(tabIndex, false); + } + else { + jTabbedPane.setEnabledAt(tabIndex, true); + } } /** @@ -170,10 +193,14 @@ public class FpdModuleSA extends JDialog implements ActionListener { } public void initLibraries(String key) { - // - // display library classes that need to be resolved. also potential instances for them. - // - resolveLibraryInstances(moduleKey); + try { + // + // display library classes that need to be resolved. also potential instances for them. + // + resolveLibraryInstances(moduleKey); + } catch (Exception e) { + JOptionPane.showMessageDialog(frame, e.getMessage()); + } // // display lib instances already selected for key // @@ -183,7 +210,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { String[][] saa = new String[instanceCount][5]; ffc.getLibraryInstances(key, saa); for (int i = 0; i < saa.length; ++i) { - ModuleIdentification mi = WorkspaceProfile.getModuleId(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]); + ModuleIdentification mi = WorkspaceProfile.getModuleId(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + + " " + saa[i][4]); if (mi != null) { // // ToDo: verify this instance first. @@ -194,11 +222,16 @@ public class FpdModuleSA extends JDialog implements ActionListener { // // re-evaluate lib instance usage when adding a already-selected lib instance. // - resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]); + try { + resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]); + } catch (Exception e) { + JOptionPane.showMessageDialog(frame, e.getMessage()); + } selectedInstancesTableModel.addRow(saa[i]); } } } + showClassToResolved(); } @@ -233,71 +266,165 @@ public class FpdModuleSA extends JDialog implements ActionListener { } } - private void resolveLibraryInstances(String key) { - ModuleIdentification mi = WorkspaceProfile.getModuleId(key); - PackageIdentification[] depPkgList = null; - try{ + private void filterClassConsumedByArch (Vector v) { + String[] moduleInfo = moduleKey.split(" "); + Vector vModuleArchs = new Vector(); + // + // Skip guid, version information, get archs to check. + // + for (int i = 4; i < moduleInfo.length; ++i) { + vModuleArchs.add(moduleInfo[i]); + } + // + // if module will be built on all platforms, no filter needed for lib classes. + // + if (vModuleArchs.size() == 0) { + return; + } + + for (int j = 0; j < v.size(); ++j) { + LibraryClassDescriptor libInfo = v.get(j); + + Vector vSupArchs = libInfo.getVectorFromString(libInfo.supArchs); + + if (vSupArchs.size() == 0 || (vSupArchs.size() == 1 && vSupArchs.get(0).equalsIgnoreCase(""))) { + // + // update lib info to module archs only. + // + libInfo.supArchs = ""; + for (int i = 0; i < vModuleArchs.size(); ++i) { + libInfo.supArchs += vModuleArchs.get(i); + libInfo.supArchs += " "; + } + libInfo.supArchs.trim(); + continue; + } // - // Get dependency pkg list into which we will search lib instances. + // only retain those lib class used by module archs. // - depPkgList = SurfaceAreaQuery.getDependencePkg(null, mi); + vSupArchs.retainAll(vModuleArchs); + if (vSupArchs.size() > 0) { + // + // update lib info to reflect which kind of arch need to select instance. + // + libInfo.supArchs = ""; + for (int i = 0; i < vSupArchs.size(); ++i) { + libInfo.supArchs += vSupArchs.get(i); + libInfo.supArchs += " "; + } + libInfo.supArchs.trim(); + continue; + } // - // Get the lib class consumed, produced by this module itself. + // remove this lib definition if it supports no archs module will be built under. // - Vector vClassConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi); - - if (this.classConsumed == null) { - this.classConsumed = new HashMap>(); + v.iterator().remove(); + } + } + + private void resolveLibraryInstances(String key) throws MultipleInstanceException, NoInstanceException{ + ModuleIdentification mi = WorkspaceProfile.getModuleId(key); + PackageIdentification[] depPkgList = null; + + // + // Get dependency pkg list into which we will search lib instances. + // + depPkgList = SurfaceAreaQuery.getDependencePkg(null, mi); + // + // Get the lib class consumed, produced by this module itself. + // + Vector vClassConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi); + filterClassConsumedByArch(vClassConsumed); + if (this.classConsumed == null) { + this.classConsumed = new HashMap>(); + } + + for (int i = 0; i < vClassConsumed.size(); ++i) { + ArrayList consumedBy = this.classConsumed.get(vClassConsumed.get(i)); + if (consumedBy == null) { + consumedBy = new ArrayList(); } - - for(int i = 0; i < vClassConsumed.size(); ++i){ - ArrayList consumedBy = this.classConsumed.get(vClassConsumed.get(i)); - if (consumedBy == null) { - consumedBy = new ArrayList(); - } - consumedBy.add(key); - this.classConsumed.put(vClassConsumed.get(i), consumedBy); + consumedBy.add(key); + this.classConsumed.put(vClassConsumed.get(i), consumedBy); + } + + Vector vClassProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); + if (this.classProduced == null) { + this.classProduced = new HashMap>(); + } + for (int i = 0; i < vClassProduced.size(); ++i) { + ArrayList producedBy = this.classProduced.get(vClassProduced.get(i)); + if (producedBy == null) { + producedBy = new ArrayList(); } - - Vector vClassProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); - if (this.classProduced == null) { - this.classProduced = new ArrayList(); + // + // class already produced by previous module (lib instance). + /* + if (producedBy.size() == 1) { + String instanceKey = producedBy.get(0); + ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey); + throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName()); } - for(int i = 0; i < vClassProduced.size(); ++i){ - if (!this.classProduced.contains(vClassProduced.get(i))){ - this.classProduced.add(vClassProduced.get(i)); + Iterator lcdi = this.classProduced.keySet().iterator(); + while (lcdi.hasNext()) { + LibraryClassDescriptor lcd = lcdi.next(); + if (vClassProduced.get(i).hasInterSectionWith(lcd)) { + ArrayList alreadyProducedBy = this.classProduced.get(lcd); + String instanceKey = alreadyProducedBy.get(0); + ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey); + throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName()); } } - - // - // find potential instances in all pkgs for classes still in classConsumed. + */ + // normal case. // - if (classInstanceMap == null){ - classInstanceMap = new HashMap>(); + producedBy.add(key); + this.classProduced.put(vClassProduced.get(i), producedBy); + + } + + // + // find potential instances in all pkgs for classes still in classConsumed. + // + if (classInstanceMap == null) { + classInstanceMap = new HashMap>(); + } + Iterator lic = this.classConsumed.keySet().iterator(); + while (lic.hasNext()) { + LibraryClassDescriptor cls = lic.next(); + if (isBoundedClass(cls)) { + continue; } - Iterator lic = this.classConsumed.keySet().iterator(); - while(lic.hasNext()){ - String cls = lic.next(); - if (this.classProduced.contains(cls) || classInstanceMap.containsKey(cls)) { - continue; - } - ArrayList instances = getInstancesForClass(cls, depPkgList); - if (instances.size() == 0){ - JOptionPane.showMessageDialog(frame, "No Applicable Instance for Library Class " + - cls + ", Platform Build will Fail."); - } - classInstanceMap.put(cls, instances); - + ArrayList instances = getInstancesForClass(cls, depPkgList); + if (instances.size() == 0) { + throw new NoInstanceException (cls.className); } - + classInstanceMap.put(cls, instances); + + } // showClassToResolved(); + } + + /**Search classProduced map to see if this class has been produced by some instance (module). + * @param cls + * @return + */ + private boolean isBoundedClass (LibraryClassDescriptor cls) { + if (this.classProduced.containsKey(cls)) { + return true; } - catch(Exception e) { - e.printStackTrace(); + Iterator lcdi = this.classProduced.keySet().iterator(); + while (lcdi.hasNext()) { + LibraryClassDescriptor lcd = lcdi.next(); + if (cls.isSubSetByArchs(lcd) && cls.isSubSetByModTypes(lcd)) { + return true; + } } + + return false; } - private ArrayList getInstancesForClass(String cls, PackageIdentification[] depPkgList) throws Exception{ + private ArrayList getInstancesForClass(LibraryClassDescriptor cls, PackageIdentification[] depPkgList){ ArrayList al = new ArrayList(); // for (int i = 0; i < depPkgList.length; ++i) { @@ -307,17 +434,17 @@ public class FpdModuleSA extends JDialog implements ActionListener { // if (!mi.getPackageId().getGuid().equalsIgnoreCase(depPkgList[i].getGuid())) { // continue; // } - String[] clsProduced = getClassProduced(mi); + Vector clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); boolean isPotential = false; - for (int j = 0; j < clsProduced.length; ++j) { - if (clsProduced[j] == null) { - continue; - } - if (clsProduced[j].equals(cls)){ + Iterator lcdi = clsProduced.iterator(); + while (lcdi.hasNext()) { + LibraryClassDescriptor lcd = lcdi.next(); + if (cls.isSubSetByArchs(lcd) && cls.isSubSetByModTypes(lcd)){ isPotential = true; } - if (classProduced.contains(clsProduced[j])) { + + if (hasBeenProduced(lcd)) { isPotential = false; break; } @@ -332,6 +459,28 @@ public class FpdModuleSA extends JDialog implements ActionListener { return al; } + private boolean hasBeenProduced (LibraryClassDescriptor cls) { + Iterator lcdi = this.classProduced.keySet().iterator(); + while (lcdi.hasNext()) { + LibraryClassDescriptor lcd = lcdi.next(); + if (cls.hasInterSectionWith(lcd)) { + return true; + } + } + return false; + } + + private ArrayList getConsumedBy (String className) { + Iterator lcdi = this.classConsumed.keySet().iterator(); + while (lcdi.hasNext()) { + LibraryClassDescriptor lcd = lcdi.next(); + if (lcd.className.equals(className)) { + return this.classConsumed.get(lcd); + } + } + return null; + } + private void removeInstance(String key) { ModuleIdentification mi = WorkspaceProfile.getModuleId(key); // @@ -341,82 +490,65 @@ public class FpdModuleSA extends JDialog implements ActionListener { // // remove class produced by this instance and add back these produced class to be bound. // - String[] clsProduced = getClassProduced(mi); - for (int i = 0; i < clsProduced.length; ++i) { + Vector clsProduced = getClassProduced(mi); + for (int i = 0; i < clsProduced.size(); ++i) { - classProduced.remove(clsProduced[i]); + classProduced.remove(clsProduced.get(i)); } // // remove class consumed by this instance. we do not need to bound it now. // String[] clsConsumed = getClassConsumed(mi); for (int i = 0; i < clsConsumed.length; ++i) { - ArrayList al = classConsumed.get(clsConsumed[i]); + ArrayList al = getConsumedBy (clsConsumed[i]); if (al == null ) { - classConsumed.remove(clsConsumed[i]); continue; } al.remove(key); - if (al.size() == 0) { - classConsumed.remove(clsConsumed[i]); - } - + } - + showClassToResolved(); } - private String[] getClassProduced(ModuleIdentification mi){ - - try{ - Vector clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); - String[] sClassProduced = new String[clsProduced.size()]; - for (int i = 0; i < clsProduced.size(); ++i) { - sClassProduced[i] = clsProduced.get(i); - } - return sClassProduced; - - }catch (Exception e) { - e.printStackTrace(); - } - return new String[0]; + private Vector getClassProduced(ModuleIdentification mi){ + Vector clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); + return clsProduced; +// String[] sClassProduced = new String[clsProduced.size()]; +// for (int i = 0; i < clsProduced.size(); ++i) { +// sClassProduced[i] = clsProduced.get(i).className; +// } +// return sClassProduced; } private String[] getClassConsumed(ModuleIdentification mi){ - try{ - Vector clsConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi); - String[] sClassConsumed = new String[clsConsumed.size()]; - for (int i = 0; i < clsConsumed.size(); ++i) { - sClassConsumed[i] = clsConsumed.get(i); - } - return sClassConsumed; - }catch (Exception e) { - e.printStackTrace(); + Vector clsConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi); + String[] sClassConsumed = new String[clsConsumed.size()]; + for (int i = 0; i < clsConsumed.size(); ++i) { + sClassConsumed[i] = clsConsumed.get(i).className; } - return new String[0]; + return sClassConsumed; } private void showClassToResolved(){ libClassTableModel.setRowCount(0); - if (classConsumed.size() == 0) { + if (classConsumed == null || classConsumed.size() == 0) { return; } - Iterator li = classConsumed.keySet().iterator(); + Iterator li = classConsumed.keySet().iterator(); while(li.hasNext()){ + LibraryClassDescriptor lcd = li.next(); + String[] s = {lcd.className, lcd.supArchs, lcd.supModTypes}; + if (classConsumed.get(lcd) == null || classConsumed.get(lcd).size() == 0) { + continue; + } - String[] s = {li.next()}; -// if (classConsumed.get(s[0]) == null) { -// continue; -// } -// if (classConsumed.get(s[0]).size() == 0) { -// continue; -// } - if (!classProduced.contains(s[0])){ + if (!isBoundedClass(lcd)){ libClassTableModel.addRow(s); } } @@ -556,6 +688,9 @@ public class FpdModuleSA extends JDialog implements ActionListener { model.addColumn("DefaultValue"); jTablePcd.getColumnModel().getColumn(0).setMinWidth(250); + + TableColumn tokenColumn = jTablePcd.getColumnModel().getColumn(3); + jTablePcd.removeColumn(tokenColumn); jTablePcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTablePcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ @@ -583,9 +718,9 @@ public class FpdModuleSA extends JDialog implements ActionListener { jComboBoxItemType.setSelectedItem(itemType); jTextFieldMaxDatumSize.setEnabled(true); jTextFieldMaxDatumSize.setVisible(true); - jTextFieldMaxDatumSize.setText(jTablePcd.getValueAt(selectedRow, 4)+""); + jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+""); jTextFieldPcdDefault.setEnabled(true); - jTextFieldPcdDefault.setText(jTablePcd.getValueAt(selectedRow, 6)+""); + jTextFieldPcdDefault.setText(model.getValueAt(selectedRow, 6)+""); if (model.getValueAt(selectedRow, 5).equals("VOID*")) { if (pcdInfo[1].equals("FEATURE_FLAG")) { jTextFieldMaxDatumSize.setVisible(false); @@ -593,14 +728,14 @@ public class FpdModuleSA extends JDialog implements ActionListener { else if (pcdInfo[1].equals("FIXED_AT_BUILD")) { try{ jTextFieldMaxDatumSize.setEnabled(false); - jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(jTablePcd.getValueAt(selectedRow, 6)+"")+""); + jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(selectedRow, 6)+"")+""); } catch(Exception except){ JOptionPane.showMessageDialog(frame, "Unacceptable PCD Value: " + except.getMessage()); } } else{ - jTextFieldMaxDatumSize.setText(jTablePcd.getValueAt(selectedRow, 4)+""); + jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+""); } } else { @@ -645,6 +780,11 @@ public class FpdModuleSA extends JDialog implements ActionListener { } } + /** + * @param cName + * @param tsGuid + * @param sa sa[0]: HelpText; sa[1]: itemType in Msa; sa[2]: isBinary; + */ private void getPcdInfo(String cName, String tsGuid, String[] sa) { String[][] saa = new String[ffc.getLibraryInstancesCount(moduleKey)][5]; ffc.getLibraryInstances(moduleKey, saa); @@ -837,10 +977,18 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (jTableLibClass == null) { libClassTableModel = new IDefaultTableModel(); libClassTableModel.addColumn("LibraryClass"); + libClassTableModel.addColumn("Arch"); + libClassTableModel.addColumn("ModType"); jTableLibClass = new JTable(libClassTableModel); jTableLibClass.setRowHeight(20); jTableLibClass.setShowGrid(false); jTableLibClass.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + TableColumn column = jTableLibClass.getColumnModel().getColumn(1); + jTableLibClass.getColumnModel().removeColumn(column); + column = jTableLibClass.getColumnModel().getColumn(1); + jTableLibClass.getColumnModel().removeColumn(column); + jTableLibClass.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()){ @@ -860,7 +1008,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { // libInstanceTableModel.setRowCount(0); String cls = libClassTableModel.getValueAt(selectedRow2, 0).toString(); - ArrayList al = classInstanceMap.get(cls); + String arch = libClassTableModel.getValueAt(selectedRow2, 1).toString(); + String modType = libClassTableModel.getValueAt(selectedRow2, 2).toString(); + ArrayList al = classInstanceMap.get(new LibraryClassDescriptor(cls, arch, modType)); + if (al == null) { + return; + } ListIterator li = al.listIterator(); while(li.hasNext()) { String instance = li.next(); @@ -1016,7 +1169,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { libInstanceTableModel.getValueAt(row, 2), libInstanceTableModel.getValueAt(row, 3), libInstanceTableModel.getValueAt(row, 4)}; selectedInstancesTableModel.addRow(s); - resolveLibraryInstances(instanceValue); + try { + resolveLibraryInstances(instanceValue); + } + catch (Exception exp) { + JOptionPane.showMessageDialog(frame, exp.getMessage()); + } showClassToResolved(); } }); @@ -1063,7 +1221,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (jButtonOk == null) { jButtonOk = new JButton(); jButtonOk.setPreferredSize(new java.awt.Dimension(80,20)); - jButtonOk.setText("Ok"); + jButtonOk.setText("Close"); jButtonOk.addActionListener(this); } return jButtonOk; @@ -1127,6 +1285,19 @@ public class FpdModuleSA extends JDialog implements ActionListener { } return jPanelModuleSaOpts; } + + private Vector getVectorFromString (String s) { + if (s == null || s.equals("null")) { + s = ""; + } + String[] sa1 = s.split(" "); + Vector v = new Vector(); + for (int i = 0; i < sa1.length; ++i) { + v.add(sa1[i]); + } + return v; + } + /** * This method initializes jTextField * @@ -1147,8 +1318,27 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (newFvBinding.length() == 0 && originalFvBinding == null) { return; } - docConsole.setSaved(false); + + Vector oldFvList = getVectorFromString (originalFvBinding); + Vector newFvList = getVectorFromString (newFvBinding); + String moduleInfo[] = moduleKey.split(" "); ffc.setFvBinding(moduleKey, newFvBinding); + // + // remove module from Fvs that not in newFvList now. + // + oldFvList.removeAll(newFvList); + for (int j = 0; j < oldFvList.size(); ++j) { + ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]); + } + // + // add module to Fvs that were not in oldFvList. + // + oldFvList = getVectorFromString (originalFvBinding); + newFvList.removeAll(oldFvList); + for (int i = 0; i < newFvList.size(); ++i) { + ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]); + } + docConsole.setSaved(false); } }); @@ -1250,6 +1440,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { jTableModuleSaOptions = new JTable(optionsTableModel); jTableModuleSaOptions.setRowHeight(20); + jTableModuleSaOptions.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth); + jTableModuleSaOptions.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth); + jTableModuleSaOptions.getColumnModel().getColumn(2).setMinWidth(tagNameWidth); + jTableModuleSaOptions.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth); + jTableModuleSaOptions.getColumnModel().getColumn(4).setMinWidth(supportArchWidth); + jTableModuleSaOptions.getColumnModel().getColumn(5).setMinWidth(argWidth); // javax.swing.table.TableColumn toolFamilyCol = jTableModuleSaOptions.getColumnModel().getColumn(1); // JComboBox cb = new JComboBox(); // cb.addItem("MSFT"); @@ -1326,7 +1522,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { public void actionPerformed(java.awt.event.ActionEvent e) { String[] row = {"", "", "", "", "", ""}; optionsTableModel.addRow(row); - Vector v = new Vector(); + Vector v = null; Vector v1 = null; docConsole.setSaved(false); ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, ""); @@ -1501,6 +1697,7 @@ private void pcdDynamicToNonDynamic(String cName, String tsGuid) { ArrayList al = ffc.getDynPcdMapValue(cName + " " + tsGuid); for (int i = 0; i < al.size(); ++i) { String mKey = moduleInfo (al.get(i)); + value = null; ffc.updatePcdData(mKey, cName, tsGuid, jComboBoxItemType.getSelectedItem()+"", maxSize, value); String itemType = jComboBoxItemType.getSelectedItem()+""; al.set(i, mKey + " " + itemType); @@ -1574,8 +1771,21 @@ private JButton getJButtonUpdatePcd() { String oldItemType = model.getValueAt(row, 2)+""; String newItemType = jComboBoxItemType.getSelectedItem()+""; model.setValueAt(newItemType, row, 2); - model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4); model.setValueAt(jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem(), row, 6); + + String[] pcdInfo = {"", "", ""}; + getPcdInfo (model.getValueAt(row, 0)+"", model.getValueAt(row, 1)+"", pcdInfo); + if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) { + try { + jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(row, 6)+"")+""); + } + catch (Exception exp) { + JOptionPane.showMessageDialog(frame, "PCD Value MalFormed: " + exp.getMessage()); + return; + } + } + model.setValueAt(jTextFieldMaxDatumSize.getText(), row, 4); + if (oldItemType.equals("DYNAMIC") && !newItemType.equals("DYNAMIC")) { pcdDynamicToNonDynamic(model.getValueAt(row, 0)+"", model.getValueAt(row, 1)+""); } @@ -1671,3 +1881,51 @@ private JPanel getJPanelLibraryCenterC() { } // @jve:decl-index=0:visual-constraint="10,10" + +class MultipleInstanceException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -9148463005930920297L; + private String className = null; + private String libInstance1 = null; + private String libInstance2 = null; + + MultipleInstanceException (String libClass, String instance1, String instance2) { + super(); + className = libClass; + libInstance1 = instance1; + libInstance2 = instance2; + } + + /* (non-Javadoc) + * @see java.lang.Throwable#getMessage() + */ + @Override + public String getMessage() { + // TODO Auto-generated method stub + return "Library Class " + className + "is Produced by Two Instances: " + + libInstance1 + " and " + libInstance2 + ". Platform Build will Fail."; + } + +} + +class NoInstanceException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1987122786598970598L; + + private String className = null; + + NoInstanceException (String libClass) { + className = libClass; + } + + public String getMessage() { + return "No Applicable Instance for Library Class " + className + + ", Platform Build will Fail."; + } +}