X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdModuleSA.java;h=ed3b6e20297bbcea4b09bf9c5d18b647dc0a7320;hp=d2ef9997b2f495a95358916a9f4afbd90975e1a4;hb=1bf9fa5abde935c519bf1f1ba809a7d50ab98f0a;hpb=2a23019dfda45cc1116facb50ed37cbec43578ce diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java index d2ef9997b2..ed3b6e2029 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java @@ -23,10 +23,9 @@ import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; -import org.apache.xmlbeans.XmlObject; import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType; -import org.tianocore.frameworkwizard.platform.ui.global.GlobalData; +import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile; import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery; import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification; import org.tianocore.frameworkwizard.platform.ui.id.PackageIdentification; @@ -38,7 +37,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.ListIterator; -import java.util.Map; import java.util.Set; import java.util.Vector; @@ -153,6 +151,10 @@ public class FpdModuleSA extends JDialog implements ActionListener { // display pcd for key. // model.setRowCount(0); + jTextAreaPcdHelp.setText(""); + jComboBoxItemType.setSelectedIndex(-1); + jTextFieldMaxDatumSize.setText(""); + jTextFieldPcdDefault.setText(""); int pcdCount = ffc.getPcdDataCount(i); if (pcdCount != 0) { String[][] saa = new String[pcdCount][7]; @@ -177,7 +179,7 @@ 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 = GlobalData.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) { saa[i][0] = mi.getName(); saa[i][2] = mi.getVersion(); @@ -223,51 +225,41 @@ public class FpdModuleSA extends JDialog implements ActionListener { } private void resolveLibraryInstances(String key) { - ModuleIdentification mi = GlobalData.getModuleId(key); + ModuleIdentification mi = WorkspaceProfile.getModuleId(key); PackageIdentification[] depPkgList = null; try{ - Map m = GlobalData.getNativeMsa(mi); - SurfaceAreaQuery.setDoc(m); // // Get dependency pkg list into which we will search lib instances. // - depPkgList = SurfaceAreaQuery.getDependencePkg(null); + depPkgList = SurfaceAreaQuery.getDependencePkg(null, mi); // // Get the lib class consumed, produced by this module itself. // - String[] classConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED"); + Vector vClassConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi); if (this.classConsumed == null) { this.classConsumed = new HashMap>(); } - for(int i = 0; i < classConsumed.length; ++i){ - ArrayList consumedBy = this.classConsumed.get(classConsumed[i]); + 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(classConsumed[i], consumedBy); + this.classConsumed.put(vClassConsumed.get(i), consumedBy); } - String[] classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED"); + Vector vClassProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi); if (this.classProduced == null) { this.classProduced = new ArrayList(); } - for(int i = 0; i < classProduced.length; ++i){ - if (!this.classProduced.contains(classProduced[i])){ - this.classProduced.add(classProduced[i]); + for(int i = 0; i < vClassProduced.size(); ++i){ + if (!this.classProduced.contains(vClassProduced.get(i))){ + this.classProduced.add(vClassProduced.get(i)); } } - // - // Get classes unresolved - // -// Iterator lip = this.classProduced.listIterator(); -// while(lip.hasNext()){ -// String clsProduced = lip.next(); -// this.classConsumed.remove(clsProduced); -// -// } + // // find potential instances in all dependency pkgs for classes still in classConsumed. // @@ -300,7 +292,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { ArrayList al = new ArrayList(); for (int i = 0; i < depPkgList.length; ++i) { - Set smi = GlobalData.getModules(depPkgList[i]); + Set smi = WorkspaceProfile.getModules(depPkgList[i]); Iterator ismi = smi.iterator(); while(ismi.hasNext()) { ModuleIdentification mi = (ModuleIdentification)ismi.next(); @@ -331,7 +323,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { } private void removeInstance(String key) { - ModuleIdentification mi = GlobalData.getModuleId(key); + ModuleIdentification mi = WorkspaceProfile.getModuleId(key); // // remove pcd information of instance from current ModuleSA // @@ -370,10 +362,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { private String[] getClassProduced(ModuleIdentification mi){ try{ - Map m = GlobalData.getNativeMsa(mi); - SurfaceAreaQuery.setDoc(m); - String[] clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED"); - return clsProduced; + 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(); @@ -384,16 +378,17 @@ public class FpdModuleSA extends JDialog implements ActionListener { private String[] getClassConsumed(ModuleIdentification mi){ - String[] clsConsumed = null; try{ - Map m = GlobalData.getNativeMsa(mi); - SurfaceAreaQuery.setDoc(m); - clsConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED"); - + 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(); } - return clsConsumed; + return new String[0]; } private void showClassToResolved(){ @@ -405,12 +400,12 @@ public class FpdModuleSA extends JDialog implements ActionListener { while(li.hasNext()){ String[] s = {li.next()}; - if (classConsumed.get(s[0]) == null) { - continue; - } - if (classConsumed.get(s[0]).size() == 0) { - continue; - } +// if (classConsumed.get(s[0]) == null) { +// continue; +// } +// if (classConsumed.get(s[0]).size() == 0) { +// continue; +// } if (!classProduced.contains(s[0])){ libClassTableModel.addRow(s); } @@ -551,8 +546,9 @@ public class FpdModuleSA extends JDialog implements ActionListener { else{ int selectedRow = lsm.getMinSelectionIndex(); String cName = jTablePcd.getValueAt(selectedRow, 0)+""; + String tsGuid = jTablePcd.getValueAt(selectedRow, 1)+""; String[] pcdInfo = {"", ""}; - getPcdInfo(cName, pcdInfo); + getPcdInfo(cName, tsGuid, pcdInfo); jTextAreaPcdHelp.setText(pcdInfo[0]); initComboBox(pcdInfo[1]); jComboBoxItemType.setSelectedItem(pcdInfo[1]); @@ -632,17 +628,17 @@ public class FpdModuleSA extends JDialog implements ActionListener { } } - private void getPcdInfo(String cName, String[] sa) { + private void getPcdInfo(String cName, String tsGuid, String[] sa) { String[][] saa = new String[ffc.getLibraryInstancesCount(moduleKey)][5]; ffc.getLibraryInstances(moduleKey, saa); try{ - if (ffc.getPcdBuildDataInfo(GlobalData.getModuleId(moduleKey), cName, sa)) { + if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(moduleKey), cName, tsGuid, sa)) { return; } for (int j = 0; j < saa.length; ++j) { - if (ffc.getPcdBuildDataInfo(GlobalData.getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]), - cName, sa)) { + if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]), + cName, tsGuid, sa)) { return; } } @@ -849,8 +845,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { while(li.hasNext()) { String instance = li.next(); String[] s = {"", "", "", "", ""}; - if (GlobalData.getModuleId(instance) != null) { - s[0] = GlobalData.getModuleId(instance).getName(); + if (WorkspaceProfile.getModuleId(instance) != null) { + s[0] = WorkspaceProfile.getModuleId(instance).getName(); } String[] instancePart = instance.split(" "); @@ -989,7 +985,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { libInstanceTableModel.getValueAt(row, 2) + " " + libInstanceTableModel.getValueAt(row, 3) + " " + libInstanceTableModel.getValueAt(row, 4); - ModuleIdentification libMi = GlobalData.getModuleId(instanceValue); + ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceValue); ffc.genLibraryInstance(libMi, moduleKey); // // Add pcd information of selected instance to current moduleSA @@ -1093,6 +1089,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { jLabelFfsFileGuid = new JLabel(); jLabelFfsFileGuid.setText("FFS File GUID"); jLabelFfsFileGuid.setPreferredSize(new java.awt.Dimension(90,16)); + jLabelFfsFileGuid.setVisible(false); jLabelFvBinding = new JLabel(); jLabelFvBinding.setText("FV Binding"); jLabelFvBinding.setPreferredSize(new java.awt.Dimension(90,16)); @@ -1152,6 +1149,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (jTextFieldFileGuid == null) { jTextFieldFileGuid = new JTextField(); jTextFieldFileGuid.setPreferredSize(new java.awt.Dimension(300,20)); + jTextFieldFileGuid.setVisible(false); jTextFieldFileGuid.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent e) { String originalFileGuid = ffc.getFfsFileNameGuid(moduleKey); @@ -1444,6 +1442,10 @@ private JComboBox getJComboBoxItemType() { if (jComboBoxItemType.getItemCount() == 3) { if (!jComboBoxItemType.getSelectedItem().equals("DYNAMIC")) { pcdDynamicToNonDynamic(jTablePcd.getValueAt(row, 0)+"", jTablePcd.getValueAt(row, 1)+""); + if (jComboBoxItemType.getSelectedItem().equals("FIXED_AT_BUILD")) { + jTextFieldPcdDefault.setText(""); + jTextFieldPcdDefault.setEnabled(true); + } } else{ pcdNonDynamicToDynamic(jTablePcd.getValueAt(row, 0)+"", jTablePcd.getValueAt(row, 1)+"");