]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
1. only show ModuleName, version, PackageName, version, supported Arch, path in table...
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdModuleSA.java
index 7fd914adcc8e6b3432e525eead793e15f351624b..80369a09a1e639716e6ba42b527c806c84ed0535 100644 (file)
@@ -131,6 +131,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     \r
     public void setKey(String k, int i){\r
         this.moduleKey = k;\r
+        \r
         jTabbedPane.setSelectedIndex(0);\r
         initPcdBuildDefinition(i);\r
     }\r
@@ -158,7 +159,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         //\r
         // display library classes that need to be resolved. also potential instances for them.\r
         //\r
-        resolveLibraryInstances(key);\r
+        resolveLibraryInstances(moduleKey);\r
         //\r
         // display lib instances already selected for key\r
         //\r
@@ -201,6 +202,13 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (ffsKey != null) {\r
             jTextField2.setText(ffsKey);\r
         }\r
+        \r
+        optionsTableModel.setRowCount(0);\r
+        String[][] saa = new String[ffc.getModuleSAOptionsCount(key)][6];\r
+        ffc.getModuleSAOptions(key, saa);\r
+        for (int i = 0; i < saa.length; ++i) {\r
+            optionsTableModel.addRow(saa[i]);\r
+        }\r
     }\r
     \r
     private void resolveLibraryInstances(String key) {\r
@@ -316,7 +324,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         //\r
         // remove pcd information of instance from current ModuleSA\r
         //\r
-        ffc.removePcdData(moduleKey, mi);\r
+        ffc.removePcdData(key, mi);\r
         //\r
         // remove class produced by this instance and add back these produced class to be bound.\r
         //\r
@@ -349,7 +357,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     \r
     private ModuleIdentification getModuleId(String key){\r
         //\r
-        // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion into string array.\r
+        // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.\r
         //\r
         String[] keyPart = key.split(" ");\r
         Set<PackageIdentification> spi = GlobalData.getPackageList();\r
@@ -357,16 +365,26 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         \r
         while(ispi.hasNext()) {\r
             PackageIdentification pi = (PackageIdentification)ispi.next();\r
-            if ( !pi.getGuid().equals(keyPart[2])){\r
-//                            || !pi.getVersion().equals(keyPart[3])){\r
+            if ( !pi.getGuid().equals(keyPart[2])){ \r
+\r
                 continue;\r
             }\r
+            if (keyPart[3] != null && keyPart[3].length() > 0 && !keyPart[3].equals("null")){\r
+                if(!pi.getVersion().equals(keyPart[3])){\r
+                    continue;\r
+                }\r
+            }\r
             Set<ModuleIdentification> smi = GlobalData.getModules(pi);\r
             Iterator ismi = smi.iterator();\r
             while(ismi.hasNext()) {\r
                 ModuleIdentification mi = (ModuleIdentification)ismi.next();\r
                 if (mi.getGuid().equals(keyPart[0])){\r
-//                                && mi.getVersion().equals(keyPart[1])){\r
+                    if (keyPart[1] != null && keyPart[1].length() > 0 && !keyPart[1].equals("null")){\r
+                        if(!mi.getVersion().equals(keyPart[1])){\r
+                            continue;\r
+                        }\r
+                    }\r
+\r
                     return mi;\r
                 }\r
             }\r
@@ -745,7 +763,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     private JPanel getJPanel4() {\r
         if (jPanel4 == null) {\r
             jLabel1 = new JLabel();\r
-            jLabel1.setText("Library Classes Consumed");\r
+            jLabel1.setText("Library Classes Uninstantiated");\r
             jPanel4 = new JPanel();\r
             jPanel4.add(jLabel1, null);\r
             jPanel4.add(getJScrollPane3(), null);\r
@@ -1000,7 +1018,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     // Add pcd information of selected instance to current moduleSA\r
                     //\r
                     try{\r
-                        ffc.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue), ffc.getModuleSA(moduleKey));\r
+                        ffc.addFrameworkModulesPcdBuildDefs(getModuleId(instanceValue), null, ffc.getModuleSA(moduleKey));\r
                     }\r
                     catch (Exception exception) {\r
                         JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());\r
@@ -1073,14 +1091,12 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     public void actionPerformed(ActionEvent arg0) {\r
 \r
         if (arg0.getSource() == jButton2) {\r
-//            ffc.removeLibraryInstances(moduleKey);\r
-//            for (int i = 0; i < model1.getRowCount(); ++i) {\r
-//                String mg = model1.getValueAt(i, 1)+"";\r
-//                String mv = model1.getValueAt(i, 2)+"";\r
-//                String pg = model1.getValueAt(i, 3)+"";\r
-//                String pv = model1.getValueAt(i, 4)+"";\r
-//                ffc.genLibraryInstance(mg, mv, pg, pv, moduleKey);\r
-//            }\r
+            if (jTable4.isEditing()) {\r
+                jTable4.getCellEditor().stopCellEditing();\r
+            }\r
+            ffc.setFvBinding(moduleKey, jTextField.getText());\r
+            ffc.setFfsFileNameGuid(moduleKey, jTextField1.getText());\r
+            ffc.setFfsFormatKey(moduleKey, jTextField2.getText());\r
             this.setVisible(false);\r
         }\r
     }\r
@@ -1124,11 +1140,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTextField == null) {\r
             jTextField = new JTextField();\r
             jTextField.setPreferredSize(new java.awt.Dimension(100,20));\r
-            jTextField.addFocusListener(new java.awt.event.FocusAdapter() {\r
-                public void focusLost(java.awt.event.FocusEvent e) {\r
-                    ffc.setFvBinding(moduleKey, jTextField.getText());\r
-                }\r
-            });\r
+            \r
         }\r
         return jTextField;\r
     }\r
@@ -1141,11 +1153,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTextField1 == null) {\r
             jTextField1 = new JTextField();\r
             jTextField1.setPreferredSize(new java.awt.Dimension(100,20));\r
-            jTextField1.addFocusListener(new java.awt.event.FocusAdapter() {\r
-                public void focusLost(java.awt.event.FocusEvent e) {\r
-                    ffc.setFfsFileNameGuid(moduleKey, jTextField1.getText());\r
-                }\r
-            });\r
+            \r
         }\r
         return jTextField1;\r
     }\r
@@ -1158,11 +1166,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTextField2 == null) {\r
             jTextField2 = new JTextField();\r
             jTextField2.setPreferredSize(new java.awt.Dimension(100,20));\r
-            jTextField2.addFocusListener(new java.awt.event.FocusAdapter() {\r
-                public void focusLost(java.awt.event.FocusEvent e) {\r
-                    ffc.setFfsFormatKey(moduleKey, jTextField2.getText());\r
-                }\r
-            });\r
+            \r
         }\r
         return jTextField2;\r
     }\r
@@ -1257,11 +1261,11 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jButton4.setText("New");\r
             jButton4.addActionListener(new java.awt.event.ActionListener() {\r
                 public void actionPerformed(java.awt.event.ActionEvent e) {\r
-                    String[] row = {"", "", "", "", "IA32", ""};\r
+                    String[] row = {"", "", "", "", "", ""};\r
                     optionsTableModel.addRow(row);\r
                     Vector<Object> v = new Vector<Object>();\r
-                    Vector<Object> v1 = new Vector<Object>();\r
-                    v1.add("IA32");\r
+                    Vector<Object> v1 = null;\r
+                    \r
                     ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, "");\r
                 }\r
             });\r
@@ -1443,7 +1447,7 @@ private void pcdNonDynamicToDynamic(String cName, String tsGuid) {
     ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);\r
     for (int i = 0; i < al.size(); ++i) {\r
         String[] s = al.get(i).split(" ");\r
-        String mKey = s[0] + s[1] + s[2] + s[3];\r
+        String mKey = s[0] + " " + s[1]+ " " + s[2] + " " + s[3];\r
         ffc.updatePcdData(mKey, cName, tsGuid, jComboBox.getSelectedItem()+"", jTextField3.getText(), jTextField4.isVisible() ? jTextField4.getText() : jComboBox1.getSelectedItem()+"");\r
         s[4] = jComboBox.getSelectedItem()+"";\r
         al.set(i, s[0]+" "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]);\r