1. Add feature of ModuleSA PcdBuildDefinition editor.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 9 Jul 2006 13:44:41 +0000 (13:44 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 9 Jul 2006 13:44:41 +0000 (13:44 +0000)
2. bug fixing for SPD editor.

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

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/platform/ui/FpdFileContents.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java

index 07ce0cef7fbf0895b875ffc5d11e94c4b55d3534..55319196953e38b8c8fbe3920662f6e8e3ce4865 100644 (file)
@@ -252,7 +252,9 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
        int row = arg0.getFirstRow();\r
        TableModel m = (TableModel)arg0.getSource();\r
        if (arg0.getType() == TableModelEvent.UPDATE){\r
+           if (docConsole != null) {\r
            docConsole.setSaved(false);\r
+           }\r
            updateRow(row, m);\r
        }\r
    }\r
index 61d69b191690c452b2cb0a7328d987ddba3c0a0e..ce4922e36213cd71306eb3316846c06509503ad1 100644 (file)
@@ -86,8 +86,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
 \r
     private JButton jButtonClearAll = null;\r
 \r
-    private JButton jButtonOk = null;\r
-\r
     private JLabel jLabel = null;\r
 \r
     private JTextField jTextField = null;\r
@@ -373,23 +371,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
         return jButtonClearAll;\r
     }\r
 \r
-    /**\r
-      This method initializes jButton  \r
-       \r
-      @return javax.swing.JButton      \r
-     **/\r
-    private JButton getJButtonOk() {\r
-        if (jButtonOk == null) {\r
-            jButtonOk = new JButton();\r
-            jButtonOk.setSize(new java.awt.Dimension(90, 20));\r
-            jButtonOk.setText("OK");\r
-            jButtonOk.setLocation(new java.awt.Point(290, 305));\r
-            jButtonOk.setVisible(false);\r
-            jButtonOk.addActionListener(this);\r
-        }\r
-        return jButtonOk;\r
-    }\r
-\r
     /**\r
       This is the default constructor\r
      **/\r
@@ -507,7 +488,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
             jContentPane.add(getJButtonAdd(), null);\r
             jContentPane.add(getJButtonRemove(), null);\r
             jContentPane.add(getJButtonClearAll(), null);\r
-            jContentPane.add(getJButtonOk(), null);\r
             \r
             jContentPane.add(getJTextField(), null);\r
             jContentPane.add(getJButtonBrowse(), null);\r
@@ -584,13 +564,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
      */\r
     public void actionPerformed(ActionEvent arg0) {\r
         \r
-        docConsole.setSaved(false);\r
-        if (arg0.getSource() == jButtonOk) {\r
-            this.save();\r
-            this.dispose();\r
-\r
-        }\r
-\r
         if (arg0.getSource() == jButtonAdd) {\r
             \r
             //ToDo: check before add\r
@@ -610,6 +583,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
                 return;\r
             }\r
             model.addRow(row);\r
+            docConsole.setSaved(false);\r
             sfc.genSpdLibClassDeclarations(row[0], row[3], row[1], row[2], row[5], null, null, row[4], null, row[6]);\r
             \r
         }\r
index 6d9235cdc87dc5334de95d33a127bba75dedd52f..0fc11f08b28a42c7e41176aff7463056cc3c28ce 100644 (file)
@@ -85,7 +85,7 @@ public class FpdFileContents {
     \r
     private DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions fpdDynPcdBuildDefs = null;\r
     \r
-    public static HashMap<String, ArrayList<String>> dynPcdMap = null;\r
+    private HashMap<String, ArrayList<String>> dynPcdMap = null;\r
     \r
     /**\r
      * look through all pcd data in all ModuleSA, create pcd -> ModuleSA mappings.\r
@@ -122,6 +122,10 @@ public class FpdFileContents {
           }\r
       }\r
     }\r
+    \r
+    public ArrayList<String> getDynPcdMapValue(String key) {\r
+        return dynPcdMap.get(key);\r
+    }\r
     /**\r
      Constructor to create a new spd file\r
      **/\r
@@ -252,79 +256,39 @@ public class FpdFileContents {
             String moduleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + " " +\r
             moduleSa.getPackageGuid()+ " " + moduleSa.getPackageVersion();\r
             PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef = moduleSa.getPcdBuildDefinition();\r
-            if (pcdBuildDef != null) {\r
-                maintainDynPcdMap(pcdBuildDef, moduleInfo);\r
+            if (pcdBuildDef != null && pcdBuildDef.getPcdDataList() != null) {\r
+                ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> li = pcdBuildDef.getPcdDataList().listIterator();\r
+                while(li.hasNext()) {\r
+                    PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = li.next();\r
+                    maintainDynPcdMap(pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName(), moduleInfo);\r
+                }\r
             }\r
             cursor.removeXml();\r
         }\r
         cursor.dispose();\r
     }\r
     \r
-    private void maintainDynPcdMap(PcdBuildDefinitionDocument.PcdBuildDefinition o, String moduleInfo) {\r
-        XmlCursor cursor = o.newCursor();\r
-        boolean fromLibInstance = false;\r
-        if (!cursor.toFirstChild()){\r
+    private void maintainDynPcdMap(String pcdKey, String moduleInfo) {\r
+        \r
+        ArrayList<String> al = dynPcdMap.get(pcdKey);\r
+        if (al == null) {\r
             return;\r
         }\r
-        //\r
-        // deal with first child, same process in the while loop below for siblings.\r
-        //\r
-        PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
-        String pcdKey = pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName();\r
-        ArrayList<String> al = dynPcdMap.get(pcdKey);\r
+        String[] s = moduleInfo.split(" ");\r
         for(int i = 0; i < al.size(); ++i){\r
-            if (al.get(i).startsWith(moduleInfo)){\r
-                fromLibInstance = true;\r
+            String consumer = al.get(i);\r
+            if (consumer.contains(s[0]) && consumer.contains(s[2])){\r
+                al.remove(consumer);\r
                 break;\r
             }\r
         }\r
-        al.remove(moduleInfo + " " + pcdData.getItemType().toString());\r
+\r
         if (al.size() == 0) {\r
             dynPcdMap.remove(pcdKey);\r
+            String[] s1 = pcdKey.split(" ");\r
+            removeDynamicPcdBuildData(s1[0], s1[1]);\r
         }\r
         \r
-        if (pcdData.getItemType().toString().equals("DYNAMIC")) {\r
-            if (dynPcdMap.get(pcdKey) == null) {\r
-                removeDynamicPcdBuildData(pcdData.getCName(), pcdData.getTokenSpaceGuidCName());\r
-            }\r
-        }\r
-        if (fromLibInstance){\r
-            cursor.removeXml();\r
-        }\r
-        while(cursor.toNextSibling()) {\r
-            fromLibInstance = false;\r
-            pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
-            //\r
-            // remove each pcd record from dynPcdMap\r
-            //\r
-            pcdKey = pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName();\r
-            al = dynPcdMap.get(pcdKey);\r
-            for(int i = 0; i < al.size(); ++i){\r
-                if (al.get(i).startsWith(moduleInfo)){\r
-                    fromLibInstance = true;\r
-                    break;\r
-                }\r
-            }\r
-            al.remove(moduleInfo + " " + pcdData.getItemType().toString());\r
-            if (al.size() == 0) {\r
-                dynPcdMap.remove(pcdKey);\r
-            }\r
-            \r
-            if (pcdData.getItemType().toString().equals("DYNAMIC")) {\r
-                //\r
-                // First check whether this is the only consumer of this dyn pcd.\r
-                //\r
-                if (dynPcdMap.get(pcdKey) == null) {\r
-                    //\r
-                    // delete corresponding entry in DynamicPcdBuildData\r
-                    //\r
-                    removeDynamicPcdBuildData(pcdData.getCName(), pcdData.getTokenSpaceGuidCName());\r
-                }\r
-            }\r
-            if (fromLibInstance){\r
-                cursor.removeXml();\r
-            }\r
-        }\r
     }\r
     //\r
     // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer"\r
@@ -355,6 +319,128 @@ public class FpdFileContents {
             \r
         }\r
     }\r
+    \r
+    public void updatePcdData(String key, String cName, String tsGuid, String itemType, String maxSize, String value){\r
+        ModuleSADocument.ModuleSA msa = getModuleSA(key);\r
+        if (msa == null || msa.getPcdBuildDefinition() == null){\r
+            return;\r
+        }\r
+        \r
+        XmlCursor cursor = msa.getPcdBuildDefinition().newCursor();\r
+        if (cursor.toFirstChild()){\r
+            do {\r
+                PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
+                if (pcdData.getCName().equals(cName) && pcdData.getTokenSpaceGuidCName().equals(tsGuid)) {\r
+                    pcdData.setItemType(PcdItemTypes.Enum.forString(itemType));\r
+                    if(pcdData.getDatumType().equals("VOID*")) {\r
+                        pcdData.setMaxDatumSize(new Integer(maxSize));\r
+                    }\r
+                    pcdData.setValue(value);\r
+                    break;\r
+                }\r
+            }\r
+            while(cursor.toNextSibling());\r
+        }\r
+        cursor.dispose();\r
+    }\r
+    \r
+    /**Get original Pcd info from MSA & SPD files.\r
+     * @param mi ModuleIdentification from which MSA & SPD come\r
+     * @param cName PCD cName\r
+     * @param sa Results: HelpText, Original item type.\r
+     * @return\r
+     */\r
+    public boolean getPcdBuildDataInfo(ModuleIdentification mi, String cName, String[] sa) throws Exception{\r
+        try {\r
+           \r
+            ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)GlobalData.getModuleXmlObject(mi);\r
+            if (msa.getPcdCoded() == null) {\r
+                return false;\r
+            }\r
+            \r
+            Map<String, XmlObject> m = new HashMap<String, XmlObject>();\r
+            m.put("ModuleSurfaceArea", msa);\r
+            SurfaceAreaQuery.setDoc(m);\r
+            PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null);\r
+            //\r
+            // First look through MSA pcd entries.\r
+            //\r
+            List<PcdCodedDocument.PcdCoded.PcdEntry> l = msa.getPcdCoded().getPcdEntryList();\r
+            ListIterator li = l.listIterator();\r
+            while(li.hasNext()) {\r
+                PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();\r
+                if (!msaPcd.getCName().equals(cName)) {\r
+                    continue;\r
+                }\r
+                PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);\r
+                if (spdPcd == null) {\r
+                    //\r
+                    // ToDo Error \r
+                    //\r
+                    throw new PcdDeclNotFound(mi.getName() + " " + msaPcd.getCName());\r
+                }\r
+                //\r
+                // Get Pcd help text and original item type.\r
+                //\r
+                sa[0] = spdPcd.getHelpText() + msaPcd.getHelpText();\r
+                sa[1] = msaPcd.getPcdItemType()+"";\r
+                return true;\r
+            }\r
+            \r
+            \r
+        }\r
+        catch (Exception e){\r
+            e.printStackTrace();\r
+            throw e;\r
+        }\r
+        \r
+        return false;\r
+    }\r
+    \r
+    /**Remove PCDBuildDefinition entries from ModuleSA\r
+     * @param moduleKey identifier of ModuleSA.\r
+     * @param consumer where these entries come from.\r
+     */\r
+    public void removePcdData(String moduleKey, ModuleIdentification consumer) {\r
+        try {\r
+            ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)GlobalData.getModuleXmlObject(consumer);\r
+            if (msa.getPcdCoded() == null) {\r
+                return;\r
+            }\r
+            \r
+            List<PcdCodedDocument.PcdCoded.PcdEntry> l = msa.getPcdCoded().getPcdEntryList();\r
+            ListIterator li = l.listIterator();\r
+            \r
+            while(li.hasNext()) {\r
+                PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();\r
+                ModuleSADocument.ModuleSA moduleSA = getModuleSA(moduleKey);\r
+                XmlCursor cursor = moduleSA.getPcdBuildDefinition().newCursor();\r
+                if (cursor.toFirstChild()) {\r
+                    PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
+                    if (msaPcd.getCName().equals(pcdData.getCName()) && msaPcd.getTokenSpaceGuidCName().equals(pcdData.getTokenSpaceGuidCName())) {\r
+                        \r
+                        maintainDynPcdMap(pcdData.getCName()+" "+pcdData.getTokenSpaceGuidCName(), moduleKey);\r
+                        cursor.removeXml();\r
+                        break;\r
+                    }\r
+                    while (cursor.toNextSibling()) {\r
+                        pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();\r
+                        if (msaPcd.getCName().equals(pcdData.getCName()) && msaPcd.getTokenSpaceGuidCName().equals(pcdData.getTokenSpaceGuidCName())) {\r
+                            maintainDynPcdMap(pcdData.getCName()+" "+pcdData.getTokenSpaceGuidCName(), moduleKey);\r
+                            cursor.removeXml();\r
+                            break;\r
+                        }\r
+                    }\r
+                }\r
+                cursor.dispose();\r
+            }\r
+            \r
+        }\r
+        catch (Exception e){\r
+            e.printStackTrace();\r
+            \r
+        }\r
+    }\r
     //\r
     // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer"\r
     //\r
@@ -382,14 +468,20 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    public void removeLibraryInstances(String key) {\r
+    public void removeLibraryInstance(String key, int i) {\r
         ModuleSADocument.ModuleSA msa = getModuleSA(key);\r
         if (msa == null || msa.getLibraries() == null){\r
             return ;\r
         }\r
         \r
         XmlCursor cursor = msa.getLibraries().newCursor();\r
-        cursor.removeXml();\r
+        if (cursor.toFirstChild()) {\r
+            for (int j = 0; j < i; ++j) {\r
+                cursor.toNextSibling();\r
+            }\r
+            cursor.removeXml();\r
+        }\r
+        \r
         cursor.dispose();\r
     }\r
     \r
@@ -590,6 +682,7 @@ public class FpdFileContents {
                 // AddItem to ModuleSA PcdBuildDefinitions\r
                 //\r
                 String defaultVal = msaPcd.getDefaultValue() == null ? spdPcd.getDefaultValue() : msaPcd.getDefaultValue();\r
+                \r
                 genPcdData(msaPcd.getCName(), spdPcd.getToken(), msaPcd.getTokenSpaceGuidCName(), msaPcd.getPcdItemType().toString(), spdPcd.getDatumType()+"", defaultVal, moduleSa);\r
             }\r
             \r
@@ -743,7 +836,7 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    private int setMaxSizeForPointer(String datum) throws PcdValueMalFormed{\r
+    public int setMaxSizeForPointer(String datum) throws PcdValueMalFormed{\r
         if (datum == null) {\r
             return 0;\r
         }\r
@@ -849,7 +942,7 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    private void addDynamicPcdBuildData(String cName, Object token, String tsGuid, String itemType, String dataType, String defaultVal) \r
+    public void addDynamicPcdBuildData(String cName, Object token, String tsGuid, String itemType, String dataType, String defaultVal) \r
     throws PcdValueMalFormed{\r
         DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData dynPcdData = getfpdDynPcdBuildDefs().addNewPcdBuildData();\r
         dynPcdData.setItemType(PcdItemTypes.Enum.forString(itemType));\r
@@ -905,19 +998,27 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    private void removeDynamicPcdBuildData(String cName, String tsGuid) {\r
+    public void removeDynamicPcdBuildData(String cName, String tsGuid) {\r
         XmlObject o = getfpdDynPcdBuildDefs();\r
         \r
         XmlCursor cursor = o.newCursor();\r
         if (cursor.toFirstChild()) {\r
             DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdBuildData = \r
                 (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();\r
-            while (!(pcdBuildData.getCName().equals(cName) && pcdBuildData.getTokenSpaceGuidCName().equals(tsGuid))) {\r
-                cursor.toNextSibling();\r
+            if (pcdBuildData.getCName().equals(cName) && pcdBuildData.getTokenSpaceGuidCName().equals(tsGuid)) {\r
+                cursor.removeXml();\r
+                cursor.dispose();\r
+                return;\r
+            }\r
+            while (cursor.toNextSibling()) {\r
+                \r
                 pcdBuildData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();\r
+                if (pcdBuildData.getCName().equals(cName) && pcdBuildData.getTokenSpaceGuidCName().equals(tsGuid)) {\r
+                    cursor.removeXml();\r
+                    cursor.dispose();\r
+                    return;\r
+                }\r
             }\r
-            \r
-            cursor.removeXml();\r
         }\r
         cursor.dispose();\r
     }\r
@@ -1118,15 +1219,6 @@ public class FpdFileContents {
         }\r
     }\r
     \r
-    public void removePcdDataFromLibraryInstance(String moduleKey, String libInstanceKey){\r
-        ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);\r
-        //\r
-        //  should better maintain pcd from lib instance only, but maintain all is acceptable now. \r
-        //\r
-        maintainDynPcdMap(moduleSa.getPcdBuildDefinition(), libInstanceKey);\r
-        \r
-    }\r
-    \r
     public BuildOptionsDocument.BuildOptions getfpdBuildOpts() {\r
         if (fpdBuildOpts == null) {\r
             fpdBuildOpts = fpdRoot.addNewBuildOptions();\r
@@ -1794,8 +1886,6 @@ public class FpdFileContents {
         return fdf.getStringValue();\r
     }\r
     \r
-    \r
-    \r
     public void genFvImagesNameValue(String name, String value) {\r
       \r
         FvImagesDocument.FvImages fi = getfpdFlash().getFvImages();\r
index d20c0b8d565a51c108ddc3737640a35f1c7a4f0a..19849d0277f2f6b74e722c5d3f1f374f19d6f7f8 100644 (file)
@@ -19,6 +19,7 @@ import javax.swing.AbstractAction;
 import javax.swing.DefaultCellEditor;\r
 import javax.swing.JFileChooser;\r
 import javax.swing.JFrame;\r
+import javax.swing.JOptionPane;\r
 import javax.swing.JTabbedPane;\r
 import javax.swing.JButton;\r
 import javax.swing.ListSelectionModel;\r
@@ -1046,6 +1047,11 @@ public class FpdFlash extends IInternalFrame {
             jTextField3 = new JTextField();\r
             jTextField3.setEnabled(false);\r
             jTextField3.setPreferredSize(new Dimension(300, 20));\r
+            jTextField3.addFocusListener(new java.awt.event.FocusAdapter() {\r
+                public void focusLost(java.awt.event.FocusEvent e) {\r
+                    ffc.genFlashDefinitionFile(jTextField3.getText());\r
+                }\r
+            });\r
         }\r
         return jTextField3;\r
     }\r
@@ -1069,14 +1075,20 @@ public class FpdFlash extends IInternalFrame {
 \r
                 public void actionPerformed(ActionEvent e) {\r
                     // TODO Auto-generated method stub\r
-                    JFileChooser chooser = new JFileChooser();\r
+                    String wsDir = System.getenv("WORKSPACE");\r
+                    JFileChooser chooser = new JFileChooser(wsDir);\r
                     chooser.setMultiSelectionEnabled(false);\r
                     chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\r
                     int retval = chooser.showOpenDialog(frame);\r
                     if (retval == JFileChooser.APPROVE_OPTION) {\r
 \r
                         File theFile = chooser.getSelectedFile();\r
-                        jTextField3.setText(theFile.getPath());\r
+                        String filePath = theFile.getPath();\r
+                        if (!filePath.startsWith(wsDir)) {\r
+                            JOptionPane.showMessageDialog(frame, "You can only select files in current WORKSPACE.");\r
+                            return;\r
+                        }\r
+                        jTextField3.setText(filePath.substring(wsDir.length() + 1).replace('\\', '/'));\r
                     }\r
                 }\r
                 \r
@@ -1305,6 +1317,11 @@ public class FpdFlash extends IInternalFrame {
             fvImageParaTableModel.addRow(saa[i]);\r
             ++i;\r
         }\r
+        \r
+//        String fdfFile = ffc.getFlashDefinitionFile();\r
+//        if (fdfFile != null) {\r
+//            jTextField3.setText(fdfFile);\r
+//        }\r
     }\r
     \r
     private void getOptionNameValue(Map<String, String> m){\r
index 2923a441534525cd7e31fd7c957b11b040b541c8..a849f5ab464d44fc5f53816e08e95eeee7002b74 100644 (file)
@@ -41,6 +41,8 @@ import java.util.Set;
 import java.util.Vector;\r
 \r
 import javax.swing.JTextField;\r
+import java.awt.GridLayout;\r
+import javax.swing.JComboBox;\r
 \r
 public class FpdModuleSA extends JDialog implements ActionListener {\r
 \r
@@ -103,6 +105,18 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     private JTable jTable4 = null;\r
     private JButton jButton4 = null;\r
     private JButton jButton5 = null;\r
+    private JPanel jPanel9 = null;\r
+    private JPanel jPanel10 = null;\r
+    private JPanel jPanel11 = null;\r
+    private JPanel jPanel12 = null;\r
+    private JLabel jLabel9 = null;\r
+    private JComboBox jComboBox = null;\r
+    private JLabel jLabel10 = null;\r
+    private JTextField jTextField3 = null;\r
+    private JLabel jLabel11 = null;\r
+    private JTextField jTextField4 = null;\r
+    private JButton jButton6 = null;\r
+    private JComboBox jComboBox1 = null;\r
     /**\r
      * This is the default constructor\r
      */\r
@@ -117,13 +131,14 @@ public class FpdModuleSA extends JDialog implements ActionListener {
     \r
     public void setKey(String k){\r
         this.moduleKey = k;\r
+        jTabbedPane.setSelectedIndex(0);\r
     }\r
 \r
     /**\r
       init will be called each time FpdModuleSA object is to be shown.\r
       @param key Module information.\r
      **/\r
-    public void init(String key) {\r
+    public void initPcdBuildDefinition(String key) {\r
         //\r
         // display pcd for key.\r
         //\r
@@ -136,6 +151,9 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                 model.addRow(saa[i]);\r
             }\r
         }\r
+    }\r
+    \r
+    public void initLibraries(String key) {\r
         //\r
         // display library classes that need to be resolved. also potential instances for them.\r
         //\r
@@ -164,7 +182,9 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                 \r
             }\r
         }\r
-        \r
+    }\r
+    \r
+    public void initModuleSAOptions(String key) {\r
         //\r
         // display module SA options\r
         //\r
@@ -295,7 +315,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         //\r
         // remove pcd information of instance from current ModuleSA\r
         //\r
-        ffc.removePcdDataFromLibraryInstance(moduleKey, key);\r
+        ffc.removePcdData(moduleKey, mi);\r
         //\r
         // remove class produced by this instance and add back these produced class to be bound.\r
         //\r
@@ -462,7 +482,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jPanel.add(getJPanel2(), java.awt.BorderLayout.SOUTH);\r
             jPanel.addComponentListener(new java.awt.event.ComponentAdapter() {\r
                 public void componentShown(java.awt.event.ComponentEvent e) {\r
-                    init(moduleKey);\r
+                    initPcdBuildDefinition(moduleKey);\r
                 }\r
             });\r
             \r
@@ -484,7 +504,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jPanel1.add(getJPanel7(), java.awt.BorderLayout.CENTER);\r
             jPanel1.addComponentListener(new java.awt.event.ComponentAdapter() {\r
                 public void componentShown(java.awt.event.ComponentEvent e) {\r
-                    init(moduleKey);\r
+                    initLibraries(moduleKey);\r
                 }\r
             });\r
         }\r
@@ -535,26 +555,69 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                         return;\r
                     }\r
                     else{\r
-//                        int selectedRow = lsm.getMinSelectionIndex();\r
-                        \r
+                        int selectedRow = lsm.getMinSelectionIndex();\r
+                        String cName = jTable.getValueAt(selectedRow, 0)+"";\r
+                        String[] pcdInfo = {"", ""};\r
+                        getPcdInfo(cName, pcdInfo);\r
+                        jTextArea.setText(pcdInfo[0]);\r
+                        initComboBox(pcdInfo[1]);\r
+                        jComboBox.setSelectedItem(pcdInfo[1]);\r
+                        jTextField3.setEnabled(true);\r
+                        jTextField3.setVisible(true);\r
+                        jTextField3.setText(jTable.getValueAt(selectedRow, 4)+"");\r
+                        jTextField4.setEnabled(true);\r
+                        jTextField4.setText(jTable.getValueAt(selectedRow, 6)+"");\r
+                        if (jTable.getValueAt(selectedRow, 5).equals("VOID*")) {\r
+                            if (pcdInfo[1].equals("FEATURE_FLAG")) {\r
+                                jTextField3.setVisible(false);\r
+                            }\r
+                            else if (pcdInfo[1].equals("FIXED_AT_BUILD")) {\r
+                                try{\r
+                                    jTextField3.setEnabled(false);\r
+                                    jTextField3.setText(ffc.setMaxSizeForPointer(jTable.getValueAt(selectedRow, 6)+"")+"");\r
+                                }\r
+                                catch(Exception except){\r
+                                    JOptionPane.showMessageDialog(frame, "Unacceptable PCD Value: " + except.getMessage());\r
+                                }\r
+                            }\r
+                            else{\r
+                                jTextField3.setText(jTable.getValueAt(selectedRow, 4)+"");\r
+                            }\r
+                        }\r
+                        else {\r
+                            jTextField3.setEnabled(false);\r
+                        }\r
                         \r
+                        if (!jTable.getValueAt(selectedRow, 2).equals("DYNAMIC") && !jTable.getValueAt(selectedRow, 2).equals("DYNAMIC_EX")) {\r
+                            jTextField4.setText(jTable.getValueAt(selectedRow, 6)+"");\r
+                            if (jTable.getValueAt(selectedRow, 2).equals("FEATURE_FLAG")){\r
+                                jTextField4.setVisible(false);\r
+                                jComboBox1.setVisible(true);\r
+                                jComboBox1.setSelectedItem(jTable.getValueAt(selectedRow, 6)+"");\r
+                            }\r
+                            else{\r
+                                jTextField4.setVisible(true);\r
+                                jTextField4.setEnabled(true);\r
+                                jComboBox1.setVisible(false);\r
+                            }\r
+                        }\r
+                        else{\r
+                            jTextField4.setEnabled(false);\r
+                        }\r
                     }\r
+                    \r
+                    \r
                 }\r
             });\r
             \r
             jTable.getModel().addTableModelListener(new TableModelListener() {\r
                 public void tableChanged(TableModelEvent arg0) {\r
                     // TODO Auto-generated method stub\r
-                    int row = arg0.getFirstRow();\r
-                    TableModel m = (TableModel)arg0.getSource();\r
-                    if (arg0.getType() == TableModelEvent.INSERT) {\r
-                        //\r
-                        // Set combo box values for item type according to pcd values added.\r
-                        //\r
-                        \r
-                    }\r
+//                    int row = arg0.getFirstRow();\r
+//                    TableModel m = (TableModel)arg0.getSource();\r
+                    \r
                     if (arg0.getType() == TableModelEvent.UPDATE){\r
-                        //ToDo Data Validition check.\r
+                        //update xml doc here.\r
                         \r
                     }\r
                 }\r
@@ -562,6 +625,38 @@ public class FpdModuleSA extends JDialog implements ActionListener {
         }\r
         return jTable;\r
     }\r
+    \r
+    private void initComboBox(String originalType) {\r
+        jComboBox.removeAllItems();\r
+        jComboBox.addItem(originalType);\r
+        if (originalType.equals("PATCHABLE_IN_MODULE")) {\r
+            jComboBox.addItem("FIXED_AT_BUILD");\r
+        }\r
+        if (originalType.equals("DYNAMIC")) {\r
+            jComboBox.addItem("FIXED_AT_BUILD");\r
+            jComboBox.addItem("PATCHABLE_IN_MODULE");\r
+        }\r
+    }\r
+    \r
+    private void getPcdInfo(String cName, String[] sa) {\r
+        String[][] saa = new String[ffc.getLibraryInstancesCount(moduleKey)][5];\r
+        ffc.getLibraryInstances(moduleKey, saa);\r
+        \r
+        try{\r
+            if (ffc.getPcdBuildDataInfo(getModuleId(moduleKey), cName, sa)) {\r
+                return;\r
+            }\r
+            for (int j = 0; j < saa.length; ++j) {\r
+                if (ffc.getPcdBuildDataInfo(getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]),\r
+                                            cName, sa)) {\r
+                    return;\r
+                }\r
+            }\r
+        }\r
+        catch(Exception e) {\r
+            JOptionPane.showMessageDialog(this, "Get PCD details fail: " + e.getMessage());\r
+        }\r
+    }\r
 \r
     /**\r
      * This method initializes jPanel2 \r
@@ -573,8 +668,10 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jLabel5 = new JLabel();\r
             jLabel5.setText("PCD Description");\r
             jPanel2 = new JPanel();\r
+            jPanel2.setPreferredSize(new java.awt.Dimension(607,200));\r
             jPanel2.add(jLabel5, null);\r
             jPanel2.add(getJScrollPane1(), null);\r
+            jPanel2.add(getJPanel9(), null);\r
         }\r
         return jPanel2;\r
     }\r
@@ -702,24 +799,6 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jTable1.setRowHeight(20);\r
             jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
             jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
-            jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
-                public void valueChanged(ListSelectionEvent e) {\r
-                    int selectedRow1 = -1;\r
-                    if (e.getValueIsAdjusting()){\r
-                        return;\r
-                    }\r
-                    ListSelectionModel lsm = (ListSelectionModel)e.getSource();\r
-                    if (lsm.isSelectionEmpty()) {\r
-                        return;\r
-                    }\r
-                    else{\r
-                        selectedRow1 = lsm.getMinSelectionIndex();\r
-                        \r
-                        \r
-                    }\r
-                }\r
-            });\r
-            \r
             \r
         }\r
         return jTable1;\r
@@ -825,23 +904,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jTable3.setRowHeight(20);\r
             jTable3.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);\r
             jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
-            jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener(){\r
-                public void valueChanged(ListSelectionEvent e) {\r
-                    int selectedRow3 = -1;\r
-                    if (e.getValueIsAdjusting()){\r
-                        return;\r
-                    }\r
-                    ListSelectionModel lsm = (ListSelectionModel)e.getSource();\r
-                    if (lsm.isSelectionEmpty()) {\r
-                        return;\r
-                    }\r
-                    else{\r
-                        selectedRow3 = lsm.getMinSelectionIndex();\r
-                        \r
-                        \r
-                    }\r
-                }\r
-            });\r
+            \r
         }\r
         return jTable3;\r
     }\r
@@ -931,11 +994,12 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     model3.getValueAt(row, 2) + " " +\r
                     model3.getValueAt(row, 3) + " " +\r
                     model3.getValueAt(row, 4);\r
+                    ffc.genLibraryInstance(model3.getValueAt(row, 1)+"", model3.getValueAt(row, 2)+"", model3.getValueAt(row, 3)+"", model3.getValueAt(row, 4)+"", moduleKey);\r
                     //\r
                     // 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), ffc.getModuleSA(moduleKey));\r
                     }\r
                     catch (Exception exception) {\r
                         JOptionPane.showMessageDialog(frame, "PCD Insertion Fail. " + exception.getMessage());\r
@@ -967,6 +1031,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                                    model1.getValueAt(row, 2) + " " +\r
                                    model1.getValueAt(row, 3) + " " +\r
                                    model1.getValueAt(row, 4));\r
+                    ffc.removeLibraryInstance(moduleKey, row);\r
                     model1.removeRow(row);\r
                     \r
                 }\r
@@ -1007,14 +1072,14 @@ 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
+//            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
             this.setVisible(false);\r
         }\r
     }\r
@@ -1043,7 +1108,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             jPanel8.add(getJButton5(), null);\r
             jPanel8.addComponentListener(new java.awt.event.ComponentAdapter() {\r
                 public void componentShown(java.awt.event.ComponentEvent e) {\r
-                    init(moduleKey);\r
+                    initModuleSAOptions(moduleKey);\r
                 }\r
             });\r
         }\r
@@ -1242,6 +1307,217 @@ public class FpdModuleSA extends JDialog implements ActionListener {
    protected void centerWindow() {\r
        centerWindow(this.getSize().width, this.getSize().height);\r
    }\r
+/**\r
+ * This method initializes jPanel9     \r
+ *     \r
+ * @return javax.swing.JPanel  \r
+ */\r
+private JPanel getJPanel9() {\r
+    if (jPanel9 == null) {\r
+        GridLayout gridLayout = new GridLayout();\r
+        gridLayout.setRows(3);\r
+        gridLayout.setColumns(2);\r
+        jPanel9 = new JPanel();\r
+        jPanel9.setLayout(gridLayout);\r
+        jPanel9.setPreferredSize(new java.awt.Dimension(600,90));\r
+        jPanel9.add(getJPanel12(), null);\r
+        jPanel9.add(getJPanel10(), null);\r
+        jPanel9.add(getJPanel11(), null);\r
+    }\r
+    return jPanel9;\r
+}\r
+/**\r
+ * This method initializes jPanel10    \r
+ *     \r
+ * @return javax.swing.JPanel  \r
+ */\r
+private JPanel getJPanel10() {\r
+    if (jPanel10 == null) {\r
+        FlowLayout flowLayout2 = new FlowLayout();\r
+        flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);\r
+        jLabel10 = new JLabel();\r
+        jLabel10.setText("Max Datum Size");\r
+        jPanel10 = new JPanel();\r
+        jPanel10.setLayout(flowLayout2);\r
+        jPanel10.add(jLabel10, null);\r
+        jPanel10.add(getJTextField3(), null);\r
+    }\r
+    return jPanel10;\r
+}\r
+/**\r
+ * This method initializes jPanel11    \r
+ *     \r
+ * @return javax.swing.JPanel  \r
+ */\r
+private JPanel getJPanel11() {\r
+    if (jPanel11 == null) {\r
+        FlowLayout flowLayout3 = new FlowLayout();\r
+        flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);\r
+        jLabel11 = new JLabel();\r
+        jLabel11.setText("Default Value");\r
+        jLabel11.setPreferredSize(new java.awt.Dimension(91,16));\r
+        jPanel11 = new JPanel();\r
+        jPanel11.setLayout(flowLayout3);\r
+        jPanel11.add(jLabel11, null);\r
+        jPanel11.add(getJTextField4(), null);\r
+        jPanel11.add(getJComboBox1(), null);\r
+    }\r
+    return jPanel11;\r
+}\r
+/**\r
+ * This method initializes jPanel12    \r
+ *     \r
+ * @return javax.swing.JPanel  \r
+ */\r
+private JPanel getJPanel12() {\r
+    if (jPanel12 == null) {\r
+        FlowLayout flowLayout1 = new FlowLayout();\r
+        flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);\r
+        jLabel9 = new JLabel();\r
+        jLabel9.setText("Item Type");\r
+        jLabel9.setPreferredSize(new java.awt.Dimension(91,16));\r
+        jPanel12 = new JPanel();\r
+        jPanel12.setLayout(flowLayout1);\r
+        jPanel12.add(jLabel9, null);\r
+        jPanel12.add(getJComboBox(), null);\r
+        jPanel12.add(getJButton6(), null);\r
+    }\r
+    return jPanel12;\r
+}\r
+/**\r
+ * This method initializes jComboBox   \r
+ *     \r
+ * @return javax.swing.JComboBox       \r
+ */\r
+private JComboBox getJComboBox() {\r
+    if (jComboBox == null) {\r
+        jComboBox = new JComboBox();\r
+        jComboBox.setPreferredSize(new java.awt.Dimension(200,20));\r
+        jComboBox.addItemListener(new java.awt.event.ItemListener() {\r
+            public void itemStateChanged(java.awt.event.ItemEvent e) {\r
+                int row = jTable.getSelectedRow();\r
+                if (row < 0 || jTable.getValueAt(row, 2).equals(jComboBox.getSelectedItem())) {\r
+                    return;\r
+                }\r
+                if (jComboBox.getItemCount() == 3) {\r
+                    if (!jComboBox.getSelectedItem().equals("DYNAMIC")) {\r
+                        pcdDynamicToNonDynamic(jTable.getValueAt(row, 0)+"", jTable.getValueAt(row, 1)+"");\r
+                    }\r
+                    else{\r
+                        pcdNonDynamicToDynamic(jTable.getValueAt(row, 0)+"", jTable.getValueAt(row, 1)+"");\r
+                    }\r
+                }\r
+            }\r
+        });\r
+    }\r
+    return jComboBox;\r
+}\r
+\r
+private void pcdDynamicToNonDynamic(String cName, String tsGuid) {\r
+    String[][] saa = new String[ffc.getDynamicPcdBuildDataCount()][5];\r
+    ffc.getDynamicPcdBuildData(saa);\r
+    String maxSize = "";\r
+    String value = "";\r
+    for (int i = 0; i < saa.length; ++i) {\r
+        if (saa[i][0].equals(cName) && saa[i][2].equals(tsGuid)) {\r
+            maxSize = saa[i][3];\r
+            value = ffc.getDynamicPcdBuildDataValue(i);\r
+            break;\r
+        }\r
+    }\r
+    \r
+    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
+        ffc.updatePcdData(mKey, cName, tsGuid, jComboBox.getSelectedItem()+"", maxSize, value);\r
+        s[4] = jComboBox.getSelectedItem()+"";\r
+        al.set(i, s[0]+" "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]);\r
+    }\r
+    \r
+    ffc.removeDynamicPcdBuildData(cName, tsGuid);\r
+}\r
+\r
+private void pcdNonDynamicToDynamic(String cName, String tsGuid) {\r
+    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
+        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
+    }\r
+    try{\r
+        ffc.addDynamicPcdBuildData(cName, jTable.getValueAt(jTable.getSelectedRow(), 3), tsGuid, "DYNAMIC", jTable.getValueAt(jTable.getSelectedRow(), 5)+"", jTextField4.isVisible() ? jTextField4.getText() : jComboBox1.getSelectedItem()+"");\r
+    }\r
+    catch(Exception e){\r
+        JOptionPane.showMessageDialog(frame, "PCD value format: " + e.getMessage());\r
+    }\r
+}\r
+/**\r
+ * This method initializes jTextField3 \r
+ *     \r
+ * @return javax.swing.JTextField      \r
+ */\r
+private JTextField getJTextField3() {\r
+    if (jTextField3 == null) {\r
+        jTextField3 = new JTextField();\r
+        jTextField3.setPreferredSize(new java.awt.Dimension(200,20));\r
+    }\r
+    return jTextField3;\r
+}\r
+/**\r
+ * This method initializes jTextField4 \r
+ *     \r
+ * @return javax.swing.JTextField      \r
+ */\r
+private JTextField getJTextField4() {\r
+    if (jTextField4 == null) {\r
+        jTextField4 = new JTextField();\r
+        jTextField4.setPreferredSize(new java.awt.Dimension(200,20));\r
+    }\r
+    return jTextField4;\r
+}\r
+/**\r
+ * This method initializes jButton6    \r
+ *     \r
+ * @return javax.swing.JButton \r
+ */\r
+private JButton getJButton6() {\r
+    if (jButton6 == null) {\r
+        jButton6 = new JButton();\r
+        jButton6.setPreferredSize(new java.awt.Dimension(150,20));\r
+        jButton6.setText("Update PCD Data");\r
+        jButton6.addActionListener(new java.awt.event.ActionListener() {\r
+            public void actionPerformed(java.awt.event.ActionEvent e) {\r
+                int row = jTable.getSelectedRow();\r
+                if (row < 0) {\r
+                    return;\r
+                }\r
+                model.setValueAt(jComboBox.getSelectedItem(), row, 2);\r
+                model.setValueAt(jTextField3.getText(), row, 4);\r
+                model.setValueAt(jTextField4.isVisible()? jTextField4.getText():jComboBox1.getSelectedItem(), row, 6);\r
+                ffc.updatePcdData(moduleKey, model.getValueAt(row, 0)+"", model.getValueAt(row, 1)+"", model.getValueAt(row, 2)+"", model.getValueAt(row, 4)+"", model.getValueAt(row, 6)+"");\r
+            }\r
+        });\r
+    }\r
+    return jButton6;\r
+}\r
+/**\r
+ * This method initializes jComboBox1  \r
+ *     \r
+ * @return javax.swing.JComboBox       \r
+ */\r
+private JComboBox getJComboBox1() {\r
+    if (jComboBox1 == null) {\r
+        jComboBox1 = new JComboBox();\r
+        jComboBox1.setPreferredSize(new java.awt.Dimension(100,20));\r
+        jComboBox1.setVisible(false);\r
+        jComboBox1.addItem("true");\r
+        jComboBox1.addItem("false");\r
+    }\r
+    return jComboBox1;\r
+}\r
 \r
 \r
 }  //  @jve:decl-index=0:visual-constraint="10,10"\r
index 2ee6371c3d6c03e5244340980aac81e327e75125..c9538b7fd2e79a7da14304d56cb7ef371c716015 100644 (file)
@@ -527,8 +527,9 @@ public class FpdPlatformDefs extends IInternalFrame {
         if (jComboBox == null) {\r
             jComboBox = new JComboBox();\r
             jComboBox.setPreferredSize(new Dimension(100, 20));\r
-            jComboBox.addItem("MODULE");\r
             jComboBox.addItem("UNIFIED");\r
+            jComboBox.addItem("MODULE");\r
+            \r
             jComboBox.setSelectedIndex(0);\r
             jComboBox.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r