Remove empty attributes for build option.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Sep 2006 06:21:27 +0000 (06:21 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 29 Sep 2006 06:21:27 +0000 (06:21 +0000)
Fix keyboard tying search wrong-focus in FrameworkModules table.
Make FvBinding text field editable.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1640 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java

index 12058aa..39f65c7 100644 (file)
@@ -1864,7 +1864,7 @@ public class FpdBuildOptions extends IInternalFrame {
         if (bool[5]) {\r
             s += "PPC ";\r
         }\r
-        if (s == " ") {\r
+        if (s.equals(" ")) {\r
             s += "IA32";\r
         }\r
         return s.trim();\r
index 26d3d69..1e0a5cd 100644 (file)
@@ -2135,11 +2135,42 @@ public class FpdFileContents {
     \r
     private void setBuildOptionsOpt(Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents, OptionDocument.Option opt){\r
         opt.setStringValue(contents);\r
+        if (buildTargets != null) {\r
+            opt.setBuildTargets(buildTargets);\r
+        }\r
+        else {\r
+            if (opt.isSetBuildTargets()) {\r
+                opt.unsetBuildTargets();\r
+            }\r
+        }\r
+        \r
+        if (toolChain != null && toolChain.length() > 0) {\r
+            opt.setToolChainFamily(toolChain);\r
+        }\r
+        else {\r
+            if (opt.isSetToolChainFamily()) {\r
+                opt.unsetToolChainFamily();\r
+            }\r
+        }\r
+        \r
+        if (tagName != null && tagName.length() > 0) {\r
+            opt.setTagName(tagName);\r
+        }\r
+        else {\r
+            if (opt.isSetTagName()) {\r
+                opt.unsetTagName();\r
+            }\r
+        }\r
+        \r
+        if (toolCmd != null && toolCmd.length() > 0) {\r
+            opt.setToolCode(toolCmd);\r
+        }\r
+        else {\r
+            if (opt.isSetToolCode()) {\r
+                opt.unsetToolCode();\r
+            }\r
+        }\r
         \r
-        opt.setBuildTargets(buildTargets);\r
-        opt.setToolChainFamily(toolChain);\r
-        opt.setTagName(tagName);\r
-        opt.setToolCode(toolCmd);\r
         \r
         if (archList != null) {\r
             opt.setSupArchList(archList);\r
index cd9d0dd..214c56b 100644 (file)
@@ -53,7 +53,7 @@ public class FpdFrameworkModules extends IInternalFrame {
      */\r
     private static final long serialVersionUID = 1L;\r
     \r
-    private static final int timeToWait = 3000;\r
+    private static final int timeToWait = 2000;\r
     \r
     private long savedMs = 0;\r
     \r
@@ -340,7 +340,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                         searchField = "" + e.getKeyChar(); \r
                     }\r
                     \r
-                    int viewIndex = gotoFoundRow (searchField, (TableSorter) jTableAllModules.getModel());\r
+                    int viewIndex = gotoFoundRow (searchField, jTableAllModules);\r
                     if (viewIndex >= 0){\r
                         jTableAllModules.changeSelection(viewIndex, 0, false, false);\r
                     }\r
@@ -353,10 +353,10 @@ public class FpdFrameworkModules extends IInternalFrame {
         return jTableAllModules;\r
     }\r
     \r
-    private int gotoFoundRow (String s, TableSorter model) {\r
+    private int gotoFoundRow (String s, JTable model) {\r
         for (int i = 0; i < model.getRowCount(); ++i) {\r
             if (model.getValueAt(i, 0) != null && model.getValueAt(i, 0).toString().regionMatches(true, 0, s, 0, s.length())) {\r
-                return model.getViewIndexArray()[i];\r
+                return i;\r
             }\r
         }\r
         return -1;\r
@@ -631,7 +631,7 @@ public class FpdFrameworkModules extends IInternalFrame {
                         searchField = "" + e.getKeyChar(); \r
                     }\r
                     \r
-                    int viewIndex = gotoFoundRow (searchField, (TableSorter) jTableFpdModules.getModel());\r
+                    int viewIndex = gotoFoundRow (searchField, jTableFpdModules);\r
                     if (viewIndex >= 0){\r
                         jTableFpdModules.changeSelection(viewIndex, 0, false, false);\r
                     }\r
index dea3187..45e5893 100644 (file)
@@ -1126,7 +1126,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         if (jTextFieldFvBinding == null) {\r
             jTextFieldFvBinding = new JTextField();\r
             jTextFieldFvBinding.setPreferredSize(new java.awt.Dimension(400,20));\r
-            jTextFieldFvBinding.setEditable(false);\r
+            jTextFieldFvBinding.setEditable(true);\r
             jTextFieldFvBinding.addFocusListener(new java.awt.event.FocusAdapter() {\r
                 public void focusLost(java.awt.event.FocusEvent e) {\r
                     String originalFvBinding = ffc.getFvBinding(moduleKey);\r