Change radio button in package header editor to a label.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 23:54:09 +0000 (23:54 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Aug 2006 23:54:09 +0000 (23:54 +0000)
Force user to select GUID type when adding a GUID declaration.
Check duplicated PCD cName and toke value when adding a PCD declaration.
Change PCD token space text field to a drop-down list containing GUIDs with "TOKEN_SPACE_GUID" type and without type specified from GUID declarations in this package.

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

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java

index 00e7f81bdf1e7461fbd6889037afa0d0e0b4e8e5..922d1355e84e76ec2d0cc09d7d23de0e7b977116 100644 (file)
@@ -730,6 +730,17 @@ public class SpdFileContents {
         }\r
     }\r
 \r
+    public void getSpdGuidDeclWithType (Vector<String> vGuidCName, String type) {\r
+        if (psaRoot.getGuidDeclarations() == null) {\r
+            return;\r
+        }\r
+        List<GuidDeclarationsDocument.GuidDeclarations.Entry> l = psaRoot.getGuidDeclarations().getEntryList();\r
+        for (int i = 0; i < l.size(); ++i) {\r
+            if (l.get(i).getGuidTypeList() == null || l.get(i).getGuidTypeList().contains(type)) {\r
+                vGuidCName.add(l.get(i).getCName());\r
+            }\r
+        }\r
+    }\r
     /**\r
     Get the number of GUID declarations from the size of List\r
     \r
index 94e2e9655365baf8b4a71f5e0e273bf231c58abd..2b8f3dd1a93f5ecf73db65310739243bb192636c 100644 (file)
@@ -67,7 +67,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
 \r
     private JPanel jContentPane = null;\r
 \r
-    private JTextField jTextFieldAdd = null;\r
+    private JTextField jTextFieldGuid = null;\r
 \r
     private JScrollPane jScrollPane = null;\r
 \r
@@ -107,11 +107,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
 \r
     private JScrollPane topScrollPane = null;  //  @jve:decl-index=0:visual-constraint="10,213"\r
 \r
-    private JLabel jLabelVer = null;\r
+    private JLabel jLabelCName = null;\r
 \r
     private GenGuidDialog guidDialog = null;\r
 \r
-    private JTextField jTextFieldVersion = null;\r
+    private JTextField jTextFieldCName = null;\r
 \r
     private JLabel jLabelHelp = null;\r
 \r
@@ -142,18 +142,18 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     }\r
 \r
     /**\r
-      This method initializes jTextFieldAdd    \r
+      This method initializes jTextFieldGuid   \r
        \r
       @return javax.swing.JTextField   \r
      **/\r
-    protected JTextField getJTextFieldAdd() {\r
-        if (jTextFieldAdd == null) {\r
-            jTextFieldAdd = new JTextField();\r
-            jTextFieldAdd.setBounds(new java.awt.Rectangle(137,35,337,20));\r
-            jTextFieldAdd.setPreferredSize(new java.awt.Dimension(335,20));\r
+    protected JTextField getJTextFieldGuid() {\r
+        if (jTextFieldGuid == null) {\r
+            jTextFieldGuid = new JTextField();\r
+            jTextFieldGuid.setBounds(new java.awt.Rectangle(137,60,435,20));\r
+            jTextFieldGuid.setPreferredSize(new java.awt.Dimension(200,20));\r
             \r
         }\r
-        return jTextFieldAdd;\r
+        return jTextFieldGuid;\r
     }\r
 \r
     /**\r
@@ -466,11 +466,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
             jLabelHelp.setText("HelpText");\r
             jLabelHelp.setSize(new java.awt.Dimension(109,20));\r
             jLabelHelp.setLocation(new java.awt.Point(14,85));\r
-            jLabelVer = new JLabel();\r
-            jLabelVer.setBounds(new java.awt.Rectangle(14,60,111,20));\r
-            jLabelVer.setText("C_Name");\r
+            jLabelCName = new JLabel();\r
+            jLabelCName.setBounds(new java.awt.Rectangle(14,35,111,20));\r
+            jLabelCName.setText("C_Name");\r
             jLabelGuid = new JLabel();\r
-            jLabelGuid.setBounds(new java.awt.Rectangle(15,35,112,20));\r
+            jLabelGuid.setBounds(new java.awt.Rectangle(15,60,112,20));\r
             jLabelGuid.setText("Guid Value");\r
             jLabelName = new JLabel();\r
             jLabelName.setBounds(new java.awt.Rectangle(15,10,113,20));\r
@@ -491,9 +491,9 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
             jContentPane.add(jStarLabel2, null);\r
             jContentPane.add(jStarLabel3, null);\r
             jContentPane.add(jStarLabel4, null);\r
-            jContentPane.add(jLabelVer, null);\r
-            jContentPane.add(getJTextFieldVersion(), null);\r
-            jContentPane.add(getJTextFieldAdd(), null);\r
+            jContentPane.add(jLabelCName, null);\r
+            jContentPane.add(getJTextFieldCName(), null);\r
+            jContentPane.add(getJTextFieldGuid(), null);\r
             jContentPane.add(getJScrollPane(), null);\r
             jContentPane.add(getJButtonAdd(), null);\r
             jContentPane.add(getJButtonRemove(), null);\r
@@ -545,8 +545,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
             //ToDo: check before add\r
             String[] row = {"", "", "", "", "", "", ""};\r
             row[3] = jTextFieldHelp.getText();\r
-            row[2] = jTextFieldAdd.getText();\r
-            row[1] = jTextFieldVersion.getText();\r
+            row[2] = jTextFieldGuid.getText();\r
+            row[1] = jTextFieldCName.getText();\r
             row[0] = jTextFieldName.getText();\r
             row[4] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());\r
             if (row[4].length() == 0) {\r
@@ -565,9 +565,12 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
                 return;\r
             }\r
             \r
+            if (addRow(row) == -1) {\r
+                return;\r
+            }\r
             model.addRow(row);\r
             jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
-            addRow(row);\r
+            \r
         }\r
         //\r
         // remove selected line\r
@@ -592,11 +595,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
         }\r
         \r
         if (arg0.getSource() == jButtonGen) {\r
-            jTextFieldAdd.setText(Tools.generateUuidString());\r
+            jTextFieldGuid.setText(Tools.generateUuidString());\r
         }\r
         \r
         if (arg0.getActionCommand().equals("GenGuidValue")) {\r
-            jTextFieldAdd.setText(guidDialog.getGuid());\r
+            jTextFieldGuid.setText(guidDialog.getGuid());\r
         }\r
         \r
     }\r
@@ -621,7 +624,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
         return true;\r
     }\r
     \r
-    protected void addRow(String[] row) {\r
+    protected int addRow(String[] row) {\r
         Vector<String> vArch = iCheckBoxListArch.getAllCheckedItemsString();\r
         if (vArch.size() == 0) {\r
             vArch = null;\r
@@ -634,10 +637,15 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
         if (vguidType.size() == 0) {\r
             vguidType = null;\r
         }\r
+        if (vguidType == null) {\r
+            JOptionPane.showMessageDialog(this, "You must select one GUID type.");\r
+            return -1;\r
+        }\r
         if (docConsole != null) {\r
             docConsole.setSaved(false);\r
         }\r
         sfc.genSpdGuidDeclarations(row[0], row[1], row[2], row[3], vArch, vModType, vguidType);\r
+        return 0;\r
     }\r
     \r
     protected void removeRow(int i){\r
@@ -692,25 +700,25 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     }\r
 \r
     /**\r
-     * This method initializes jTextFieldVersion       \r
+     * This method initializes jTextFieldCName \r
      *         \r
      * @return javax.swing.JTextField  \r
      */\r
-    protected JTextField getJTextFieldVersion() {\r
-        if (jTextFieldVersion == null) {\r
-            jTextFieldVersion = new JTextField();\r
-            jTextFieldVersion.setBounds(new java.awt.Rectangle(137,60,225,20));\r
-            jTextFieldVersion.setPreferredSize(new java.awt.Dimension(225,20));\r
+    protected JTextField getJTextFieldCName() {\r
+        if (jTextFieldCName == null) {\r
+            jTextFieldCName = new JTextField();\r
+            jTextFieldCName.setBounds(new java.awt.Rectangle(137,35,337,20));\r
+            jTextFieldCName.setPreferredSize(new java.awt.Dimension(335,20));\r
         }\r
-        return jTextFieldVersion;\r
+        return jTextFieldCName;\r
     }\r
 \r
     public void componentResized(ComponentEvent arg0) {\r
         int intPreferredWidth = 500;\r
         \r
         Tools.resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth);\r
-        Tools.resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);\r
-        Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);\r
+\r
+        Tools.resizeComponentWidth(this.jTextFieldCName, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);\r
         Tools.relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40);\r
index 310d02790aea362661595915980e6e574d58ea35..6f660f5b5619b1a5285fdc134a9550fde9a80e13 100644 (file)
@@ -200,8 +200,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
     private JScrollPane getJScrollPane() {\r
         if (jScrollPane == null) {\r
             jScrollPane = new JScrollPane();\r
-            jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253));\r
-            jScrollPane.setPreferredSize(new java.awt.Dimension(500,419));\r
+            jScrollPane.setBounds(new java.awt.Rectangle(12,351,400,253));\r
             jScrollPane.setViewportView(getJTable());\r
         }\r
         return jScrollPane;\r
index 342f13d6bfd1d1af2b1430babce69722591a0ed1..018c377d5d8ed666186ec190c2b34ec12ef1bc7e 100644 (file)
@@ -21,7 +21,6 @@ import javax.swing.DefaultCellEditor;
 import javax.swing.JFileChooser;\r
 import javax.swing.JOptionPane;\r
 import javax.swing.JPanel;\r
-import javax.swing.JRadioButton;\r
 import javax.swing.JTable;\r
 import javax.swing.JTextField;\r
 import javax.swing.JComboBox;\r
@@ -68,7 +67,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
 \r
     private JPanel jContentPane = null;\r
 \r
-    private JRadioButton jRadioButtonSelect = null;\r
+    private JLabel jLabelSelect = null;\r
 \r
     private JComboBox jComboBoxSelect = null;\r
 \r
@@ -117,15 +116,14 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
        \r
       @return javax.swing.JRadioButton \r
      **/\r
-    private JRadioButton getJRadioButtonSelect() {\r
-        if (jRadioButtonSelect == null) {\r
-            jRadioButtonSelect = new JRadioButton();\r
-            jRadioButtonSelect.setBounds(new java.awt.Rectangle(9,10,198,20));\r
-            jRadioButtonSelect.setText("Select Existing ModuleType");\r
-            jRadioButtonSelect.addActionListener(this);\r
-            jRadioButtonSelect.setSelected(true);\r
+    private JLabel getJLabelSelect() {\r
+        if (jLabelSelect == null) {\r
+            jLabelSelect = new JLabel();\r
+            jLabelSelect.setBounds(new java.awt.Rectangle(14,10,198,20));\r
+            jLabelSelect.setText("Select ModuleType");\r
+\r
         }\r
-        return jRadioButtonSelect;\r
+        return jLabelSelect;\r
     }\r
 \r
     /**\r
@@ -321,7 +319,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
             jContentPane.add(jLabel, null);\r
             jContentPane.add(jStarLabel1, null);\r
             jContentPane.add(jStarLabel2, null);\r
-            jContentPane.add(getJRadioButtonSelect(), null);\r
+            jContentPane.add(getJLabelSelect(), null);\r
             jContentPane.add(getJComboBoxSelect(), null);\r
             jContentPane.add(getJButtonAdd(), null);\r
             jContentPane.add(getJButtonRemove(), null);\r
@@ -374,9 +372,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
         if (arg0.getSource() == jButtonAdd) {\r
             String strLibClass = "";\r
             \r
-            if (jRadioButtonSelect.isSelected()) {\r
-                strLibClass = jComboBoxSelect.getSelectedItem().toString();\r
-            }\r
+            strLibClass = jComboBoxSelect.getSelectedItem().toString();\r
             //ToDo: check before add\r
             String[] row = {"", ""};\r
             row[0] = strLibClass;\r
index cbcb5a98333e0ea392257f95ed1e90082267b775..8eeef72e15d4b6b565f579a864798950a2002019 100644 (file)
@@ -102,7 +102,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
 \r
     private JLabel jLabelTokenSpace = null;\r
 \r
-    private JTextField jTextFieldTsGuid = null;\r
+    private JComboBox jComboBoxTsGuid = null;\r
 \r
     private JLabel jLabelVarVal = null;\r
 \r
@@ -270,11 +270,12 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                 }\r
             }\r
         });\r
-        initFrame();\r
+        \r
         this.setVisible(true);\r
     }\r
 \r
     private void init(SpdFileContents sfc){\r
+        initFrame(sfc);\r
         if (sfc.getSpdPcdDefinitionCount() == 0) {\r
             return ;\r
         }\r
@@ -379,7 +380,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jContentPane.add(jLabelItemType, null);\r
             jContentPane.add(jLabelC_Name, null);\r
             jContentPane.add(jLabelTokenSpace, null);\r
-            jContentPane.add(getJTextFieldTsGuid(), null);\r
+            jContentPane.add(getJComboBoxTsGuid(), null);\r
             jContentPane.add(jLabelVarVal, null);\r
             jContentPane.add(getJTextFieldC_Name(), null);\r
             jContentPane.add(jLabelToken, null);\r
@@ -431,7 +432,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                        jContentPane.add(jLabelTokenSpace, null);\r
     \r
      **/\r
-    private void initFrame() {\r
+    private void initFrame(SpdFileContents sfc) {\r
 \r
         jComboBoxDataType.addItem("UINT8");\r
         jComboBoxDataType.addItem("UINT16");\r
@@ -440,11 +441,17 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
         jComboBoxDataType.addItem("VOID*");\r
         jComboBoxDataType.addItem("BOOLEAN");\r
         jComboBoxDataType.setSelectedIndex(0);\r
+        \r
+        Vector<String> vGuidCName = new Vector<String>();\r
+        sfc.getSpdGuidDeclWithType(vGuidCName, "TOKEN_SPACE_GUID");\r
+        for (int i = 0; i < vGuidCName.size(); ++i) {\r
+            jComboBoxTsGuid.addItem(vGuidCName.get(i));\r
+        }\r
     }\r
 \r
     public void actionPerformed(ActionEvent arg0) {\r
         \r
-        docConsole.setSaved(false);\r
+        \r
             if (arg0.getSource() == jButtonOk) {\r
                 this.save();\r
                 this.dispose();\r
@@ -455,6 +462,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
 \r
             if (arg0.getSource() == jButtonAdd) {\r
                 //ToDo: check before add\r
+          \r
                 boolean[] b = {jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected()};\r
                 if (!checkValidUsage(b)) {\r
                     return;\r
@@ -468,7 +476,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                     modTypeList = null;\r
                 }\r
                 Object[] row = {jTextFieldC_Name.getText(), jTextFieldToken.getText(),\r
-                                jTextFieldTsGuid.getText(), jComboBoxDataType.getSelectedItem(), \r
+                                jComboBoxTsGuid.getSelectedItem(), jComboBoxDataType.getSelectedItem(), \r
                                 jTextFieldDefaultValue.getText(), jTextFieldHelp.getText(),\r
                                 jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(),\r
                                 jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected(),\r
@@ -476,6 +484,11 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                 if (!dataValidation(row)) {\r
                     return;\r
                 }\r
+                \r
+                if (tokenCNameExisted(jTextFieldToken.getText(), jTextFieldC_Name.getText())) {\r
+                    return;\r
+                }\r
+                \r
                 model.addRow(row);\r
                 jTable.changeSelection(model.getRowCount()-1, 0, false, false);\r
                 String usage = getValidUsage(jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected());\r
@@ -483,6 +496,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                     usage = null;\r
                 }\r
                 sfc.genSpdPcdDefinitions(row[0]+"", row[1]+"", row[3]+"", usage, row[2]+"", row[4]+"", row[5]+"", archList, modTypeList);\r
+                docConsole.setSaved(false);\r
             }\r
             //\r
             // remove selected line\r
@@ -495,6 +509,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                 if (rowSelected >= 0) {\r
                     model.removeRow(rowSelected);\r
                     sfc.removeSpdPcdDefinition(rowSelected);\r
+                    docConsole.setSaved(false);\r
                 }\r
             }\r
 \r
@@ -504,6 +519,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
                 }\r
                 model.setRowCount(0);\r
                 sfc.removeSpdPcdDefinition();\r
+                docConsole.setSaved(false);\r
             }\r
             \r
     }\r
@@ -513,18 +529,17 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     }\r
 \r
     /**\r
-     * This method initializes jTextFieldTsGuid        \r
+     * This method initializes jComboBoxTsGuid \r
      *         \r
-     * @return javax.swing.JTextField  \r
+     * @return javax.swing.JComboBox   \r
      */\r
-    private JTextField getJTextFieldTsGuid() {\r
-        if (jTextFieldTsGuid == null) {\r
-            jTextFieldTsGuid = new JTextField();\r
-            jTextFieldTsGuid.setPreferredSize(new java.awt.Dimension(315,20));\r
-            jTextFieldTsGuid.setSize(new java.awt.Dimension(317,20));\r
-            jTextFieldTsGuid.setLocation(new java.awt.Point(156,58));\r
+    private JComboBox getJComboBoxTsGuid() {\r
+        if (jComboBoxTsGuid == null) {\r
+            jComboBoxTsGuid = new JComboBox();\r
+            jComboBoxTsGuid.setBounds(new java.awt.Rectangle(156,58,315,20));\r
+    \r
         }\r
-        return jTextFieldTsGuid;\r
+        return jComboBoxTsGuid;\r
     }\r
 \r
     /**\r
@@ -609,7 +624,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
         \r
         Tools.resizeComponentWidth(this.jTextFieldC_Name, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldToken, this.getWidth(), intPreferredWidth);\r
-        Tools.resizeComponentWidth(this.jTextFieldTsGuid, this.getWidth(), intPreferredWidth);\r
+        Tools.resizeComponentWidth(this.jComboBoxTsGuid, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);\r
         Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);\r
@@ -812,6 +827,16 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxFeatureFlag.setBounds(new java.awt.Rectangle(156,161,100,21));\r
             jCheckBoxFeatureFlag.setText("Feature Flag");\r
             jCheckBoxFeatureFlag.setPreferredSize(new java.awt.Dimension(21,20));\r
+            jCheckBoxFeatureFlag.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (jCheckBoxFeatureFlag.isSelected()) {\r
+                        jCheckBoxPatchInMod.setSelected(false);\r
+                        jCheckBoxFixedAtBuild.setSelected(false);\r
+                        jCheckBoxDyn.setSelected(false);\r
+                        jCheckBoxDynEx.setSelected(false);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jCheckBoxFeatureFlag;\r
     }\r
@@ -827,6 +852,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxFixedAtBuild.setBounds(new java.awt.Rectangle(312,133,108,20));\r
             jCheckBoxFixedAtBuild.setText("Fixed at Build");\r
             jCheckBoxFixedAtBuild.setPreferredSize(new java.awt.Dimension(21,20));\r
+            jCheckBoxFixedAtBuild.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (jCheckBoxFixedAtBuild.isSelected()) {\r
+                        jCheckBoxFeatureFlag.setSelected(false);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jCheckBoxFixedAtBuild;\r
     }\r
@@ -842,6 +874,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxPatchInMod.setBounds(new java.awt.Rectangle(156,133,154,20));\r
             jCheckBoxPatchInMod.setText("Patchable in Module");\r
             jCheckBoxPatchInMod.setPreferredSize(new java.awt.Dimension(21,20));\r
+            jCheckBoxPatchInMod.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (jCheckBoxPatchInMod.isSelected()) {\r
+                        jCheckBoxFeatureFlag.setSelected(false);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jCheckBoxPatchInMod;\r
     }\r
@@ -857,6 +896,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxDyn.setBounds(new java.awt.Rectangle(278,161,80,20));\r
             jCheckBoxDyn.setText("Dynamic");\r
             jCheckBoxDyn.setPreferredSize(new java.awt.Dimension(21,20));\r
+            jCheckBoxDyn.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (jCheckBoxDyn.isSelected()) {\r
+                        jCheckBoxFeatureFlag.setSelected(false);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jCheckBoxDyn;\r
     }\r
@@ -872,6 +918,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxDynEx.setBounds(new java.awt.Rectangle(371,161,99,20));\r
             jCheckBoxDynEx.setText("DynamicEx");\r
             jCheckBoxDynEx.setPreferredSize(new java.awt.Dimension(21,20));\r
+            jCheckBoxDynEx.addItemListener(new java.awt.event.ItemListener() {\r
+                public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                    if (jCheckBoxDynEx.isSelected()) {\r
+                        jCheckBoxFeatureFlag.setSelected(false);\r
+                    }\r
+                }\r
+            });\r
         }\r
         return jCheckBoxDynEx;\r
     }\r
@@ -897,6 +950,28 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
         return usage.trim();\r
     }\r
     \r
+    private boolean tokenCNameExisted(String token, String cName) {\r
+        Integer inputToken = Integer.decode(token);\r
+        \r
+        for (int i = 0; i < jTable.getRowCount(); ++i) {\r
+            if (jTable.getValueAt(i, 0).equals(cName)) {\r
+                JOptionPane.showMessageDialog(frame, "C_Name already existed in table.");\r
+                return true;\r
+            }\r
+            if (jTable.getValueAt(i, 1).equals(token)) {\r
+                JOptionPane.showMessageDialog(frame, "Token already existed in table.");\r
+                return true;\r
+            }\r
+            Integer tokenValue = Integer.decode(jTable.getValueAt(i, 1)+"");\r
+            if (tokenValue.equals(inputToken)) {\r
+                JOptionPane.showMessageDialog(frame, "Same token value already existed in table.");\r
+                return true;\r
+            }\r
+            \r
+        }\r
+        return false;\r
+    }\r
+    \r
     private boolean checkValidUsage(boolean[] b) {\r
         if (!(b[0] || b[1] || b[2] || b[3] || b[4])){\r
             JOptionPane.showMessageDialog(frame, "You must specify at least one usage.");\r
index b33f8c7d217eda1cabba65d3ef45fda069d32b32..9f6cec65ef235dd37dae647363656d1526134ed3 100644 (file)
@@ -109,13 +109,14 @@ public class SpdPpiDecls extends SpdGuidDecls {
         sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);\r
     }\r
     \r
-    protected void addRow(String[] row) {\r
+    protected int addRow(String[] row) {\r
         \r
         if (!dataValidation(row)){\r
-            return;\r
+            return -1;\r
         }\r
         docConsole.setSaved(false);\r
         sfc.genSpdPpiDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));\r
+        return 0;\r
     }\r
     \r
     protected void removeRow(int i){\r
index e5453947e58782949b7d88fb17c8c3d26d11140a..b188d128d5e4849dcdd5c1e6735337b2d346da4a 100644 (file)
@@ -110,12 +110,13 @@ public class SpdProtocolDecls extends SpdGuidDecls {
         sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);\r
     }\r
     \r
-    protected void addRow(String[] row) {\r
+    protected int addRow(String[] row) {\r
         if (!dataValidation(row)){\r
-            return;\r
+            return -1;\r
         }\r
         docConsole.setSaved(false);\r
         sfc.genSpdProtocolDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));\r
+        return 0;\r
     }\r
     \r
     protected void removeRow(int i){\r