X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fplatform%2Fui%2FFpdModuleSA.java;h=0265fb8f8011ebe4f71578e238213fc12f5f6fb6;hb=71baa24b6912dffc15058abc683eb6161a88a62f;hp=58c181dcd38fe4a2d710d719e4d142382061146c;hpb=1800d80f22f225e931a318c785646f581562d608;p=mirror_edk2.git 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 58c181dcd3..0265fb8f80 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 @@ -1,6 +1,8 @@ package org.tianocore.frameworkwizard.platform.ui; import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.JOptionPane; @@ -134,7 +136,10 @@ public class FpdModuleSA extends JDialog implements ActionListener { model.addRow(saa[i]); } } - + // + // display library classes that need to be resolved. also potential instances for them. + // + resolveLibraryInstances(key); // // display lib instances already selected for key // @@ -144,17 +149,22 @@ 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) { - if (getModuleId(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]) != null) { - saa[i][0] = getModuleId(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]).getName(); + ModuleIdentification mi = 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(); + saa[i][4] = mi.getPackage().getVersion(); + // + // 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]); + model1.addRow(saa[i]); } - model1.addRow(saa[i]); + } } - // - // display library classes that need to be resolved. also potential instances for them. - // - resolveLibraryInstances(key); + // // display module SA options // @@ -326,14 +336,16 @@ public class FpdModuleSA extends JDialog implements ActionListener { while(ispi.hasNext()) { PackageIdentification pi = (PackageIdentification)ispi.next(); - if ( !pi.getGuid().equals(keyPart[2]) || !pi.getVersion().equals(keyPart[3])){ + if ( !pi.getGuid().equals(keyPart[2])){ +// || !pi.getVersion().equals(keyPart[3])){ continue; } Set smi = GlobalData.getModules(pi); Iterator ismi = smi.iterator(); while(ismi.hasNext()) { ModuleIdentification mi = (ModuleIdentification)ismi.next(); - if (mi.getGuid().equals(keyPart[0]) && mi.getVersion().equals(keyPart[1])){ + if (mi.getGuid().equals(keyPart[0])){ +// && mi.getVersion().equals(keyPart[1])){ return mi; } } @@ -398,6 +410,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { */ private void initialize() { this.setSize(664, 515); + this.centerWindow(); this.setModal(true); this.setTitle("Module Settings"); this.setContentPane(getJContentPane()); @@ -471,6 +484,7 @@ public class FpdModuleSA extends JDialog implements ActionListener { jPanel1.add(getJPanel7(), java.awt.BorderLayout.CENTER); jPanel1.addComponentListener(new java.awt.event.ComponentAdapter() { public void componentShown(java.awt.event.ComponentEvent e) { + init(moduleKey); } }); } @@ -499,6 +513,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (jTable == null) { model = new PartialEditableTableModel(); jTable = new JTable(model); + jTable.setRowHeight(20); + jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); model.addColumn("CName"); model.addColumn("TokenSpaceGUID"); model.addColumn("ItemType"); @@ -682,7 +698,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { model1.addColumn("PackageGUID"); model1.addColumn("PackageVersion"); jTable1 = new JTable(model1); - + jTable1.setRowHeight(20); + jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ public void valueChanged(ListSelectionEvent e) { @@ -731,7 +748,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { model2 = new LibraryTableModel(); model2.addColumn("LibraryClass"); jTable2 = new JTable(model2); - + jTable2.setRowHeight(20); + jTable2.setShowGrid(false); jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable2.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ public void valueChanged(ListSelectionEvent e) { @@ -803,7 +821,8 @@ public class FpdModuleSA extends JDialog implements ActionListener { model3.addColumn("PackageGUID"); model3.addColumn("PackageVersion"); jTable3 = new JTable(model3); - + jTable3.setRowHeight(20); + jTable3.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ public void valueChanged(ListSelectionEvent e) { @@ -1017,6 +1036,11 @@ public class FpdModuleSA extends JDialog implements ActionListener { jPanel8.add(getJScrollPane6(), null); jPanel8.add(getJButton4(), null); jPanel8.add(getJButton5(), null); + jPanel8.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent e) { + init(moduleKey); + } + }); } return jPanel8; } @@ -1099,7 +1123,17 @@ public class FpdModuleSA extends JDialog implements ActionListener { optionsTableModel.addColumn("SupportedArchs"); optionsTableModel.addColumn("Contents"); jTable4 = new JTable(optionsTableModel); + jTable4.setRowHeight(20); + Vector vArch = new Vector(); + vArch.add("IA32"); + vArch.add("X64"); + vArch.add("IPF"); + vArch.add("EBC"); + vArch.add("ARM"); + vArch.add("PPC"); + jTable4.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch)); jTable4.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + jTable4.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); jTable4.getModel().addTableModelListener(new TableModelListener() { public void tableChanged(TableModelEvent arg0) { // TODO Auto-generated method stub @@ -1109,23 +1143,28 @@ public class FpdModuleSA extends JDialog implements ActionListener { if (arg0.getType() == TableModelEvent.UPDATE){ //ToDo Data Validition check. String targets = m.getValueAt(row, 0) + ""; - Vector targetName = new Vector(); - String[] sArray = targets.split(" "); - for (int i = 0; i < sArray.length; ++i) { - targetName.add(sArray[i]); + Vector targetName = null; + if (targets.length() > 0) { + targetName = new Vector(); + String[] sArray = targets.split(" "); + for (int i = 0; i < sArray.length; ++i) { + targetName.add(sArray[i]); + } } + String toolChain = m.getValueAt(row, 1) + ""; String tagName = m.getValueAt(row, 2) + ""; String toolCode = m.getValueAt(row, 3) + ""; String archs = m.getValueAt(row, 4) + ""; - Vector supArch = new Vector(); - String[] sArray1 = archs.split(" "); - for (int i = 0; i < sArray1.length; ++i) { - supArch.add(sArray1[i]); - } - if (supArch.size() == 0) { - supArch.add("IA32"); + Vector supArch = null; + if (archs.length() > 0) { + supArch = new Vector(); + String[] sArray1 = archs.split(" "); + for (int i = 0; i < sArray1.length; ++i) { + supArch.add(sArray1[i]); + } } + String contents = m.getValueAt(row, 5) + ""; ffc.updateModuleSAOptionsOpt(moduleKey, row, targetName, toolChain, tagName, toolCode, supArch, contents); @@ -1181,6 +1220,24 @@ public class FpdModuleSA extends JDialog implements ActionListener { } return jButton5; } + + /** + Start the window at the center of screen + + **/ + protected void centerWindow(int intWidth, int intHeight) { + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); + this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2); + } + + /** + Start the window at the center of screen + + **/ + protected void centerWindow() { + centerWindow(this.getSize().width, this.getSize().height); + } + } // @jve:decl-index=0:visual-constraint="10,10"