1. Fix EDKT437 Save is to save current modified file, Save All is to save all modifie...
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Oct 2006 03:25:05 +0000 (03:25 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Oct 2006 03:25:05 +0000 (03:25 +0000)
2. Fix EDKT438 Close should save current modified file only, Close All should save all modified file

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

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java

index 70c154f394a562b854d7c033e1201f0a5c5236d7..b8bb5581c53afeca6feca9b792fd69b0628bb658 100644 (file)
@@ -1819,7 +1819,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
         //\r
         SplashScreen ss = new SplashScreen();\r
         ss.setVisible(true);\r
-        \r
+\r
         //\r
         // Init Global Data\r
         //\r
@@ -1905,7 +1905,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
         if (arg0.getSource() == this.jMenuItemFileRefresh) {\r
             if (this.closeAll() == 0) {\r
                 this.refresh();\r
-                this.makeEmptyTree();    \r
+                this.makeEmptyTree();\r
             }\r
         }\r
 \r
@@ -3086,7 +3086,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                 if (!GlobalData.openingModuleList.getModuleSaved(currentOpeningModuleIndex)) {\r
                     int result = showSaveDialog();\r
                     if (result == JOptionPane.YES_OPTION) {\r
-                        this.saveAll();\r
+                        this.save();\r
                     }\r
                     if (result == JOptionPane.NO_OPTION) {\r
                         // Do nothing\r
@@ -3121,7 +3121,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                 if (!GlobalData.openingPackageList.getPackageSaved(currentOpeningPackageIndex)) {\r
                     int result = showSaveDialog();\r
                     if (result == JOptionPane.YES_OPTION) {\r
-                        this.saveAll();\r
+                        this.save();\r
                     }\r
                     if (result == JOptionPane.NO_OPTION) {\r
                         // Do nothing\r
@@ -3156,7 +3156,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                 if (!GlobalData.openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) {\r
                     int result = showSaveDialog();\r
                     if (result == JOptionPane.YES_OPTION) {\r
-                        this.saveAll();\r
+                        this.save();\r
                     }\r
                     if (result == JOptionPane.NO_OPTION) {\r
                         // Do nothing\r
@@ -3211,7 +3211,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
         GlobalData.openingModuleList.closeAll();\r
         GlobalData.openingPackageList.closeAll();\r
         GlobalData.openingPlatformList.closeAll();\r
-        \r
+\r
         return 0;\r
     }\r
 \r
@@ -3557,9 +3557,32 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
             //\r
             // Enable close/close all if some files are opened\r
             //\r
-            jMenuItemFileClose.setEnabled(GlobalData.openingModuleList.isOpen()\r
-                                          || GlobalData.openingPackageList.isOpen()\r
-                                          || GlobalData.openingPlatformList.isOpen());\r
+            switch (this.jTabbedPaneEditor.getSelectedIndex()) {\r
+            case 0:\r
+                jMenuItemFileClose\r
+                                  .setEnabled(GlobalData.openingModuleList\r
+                                                                          .getModuleOpen(this.currentOpeningModuleIndex));\r
+                jMenuItemFileSave\r
+                                 .setEnabled(!GlobalData.openingModuleList\r
+                                                                          .getModuleSaved(this.currentOpeningModuleIndex));\r
+                break;\r
+            case 1:\r
+                jMenuItemFileClose\r
+                                  .setEnabled(GlobalData.openingPackageList\r
+                                                                           .getPackageOpen(this.currentOpeningPackageIndex));\r
+                jMenuItemFileSave\r
+                                 .setEnabled(!GlobalData.openingPackageList\r
+                                                                           .getPackageSaved(this.currentOpeningPackageIndex));\r
+                break;\r
+            case 2:\r
+                jMenuItemFileClose\r
+                                  .setEnabled(GlobalData.openingPlatformList\r
+                                                                            .getPlatformOpen(this.currentOpeningPlatformIndex));\r
+                jMenuItemFileSave\r
+                                 .setEnabled(!GlobalData.openingPlatformList\r
+                                                                            .getPlatformSaved(this.currentOpeningPlatformIndex));\r
+                break;\r
+            }\r
             jMenuItemFileCloseAll.setEnabled(GlobalData.openingModuleList.isOpen()\r
                                              || GlobalData.openingPackageList.isOpen()\r
                                              || GlobalData.openingPlatformList.isOpen());\r
@@ -3567,9 +3590,6 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
             //\r
             // Enable save/save all if some files are changed\r
             //\r
-            jMenuItemFileSave.setEnabled(!GlobalData.openingModuleList.isSaved()\r
-                                         || !GlobalData.openingPackageList.isSaved()\r
-                                         || !GlobalData.openingPlatformList.isSaved());\r
             jMenuItemFileSaveAll.setEnabled(!GlobalData.openingModuleList.isSaved()\r
                                             || !GlobalData.openingPackageList.isSaved()\r
                                             || !GlobalData.openingPlatformList.isSaved());\r
@@ -3684,10 +3704,14 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
             JOptionPane\r
                        .showConfirmDialog(\r
                                           null,\r
-                                          "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. " +\r
-                                          DataType.LINE_SEPARATOR + DataType.LINE_SEPARATOR + "NOTICE:" +\r
-                                          DataType.LINE_SEPARATOR + "This does not change the System Environment Variable." +\r
-                                          DataType.LINE_SEPARATOR + "It only applies to where the Wizard will manage modification and file creations.",\r
+                                          "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. "\r
+                                                          + DataType.LINE_SEPARATOR\r
+                                                          + DataType.LINE_SEPARATOR\r
+                                                          + "NOTICE:"\r
+                                                          + DataType.LINE_SEPARATOR\r
+                                                          + "This does not change the System Environment Variable."\r
+                                                          + DataType.LINE_SEPARATOR\r
+                                                          + "It only applies to where the Wizard will manage modification and file creations.",\r
                                           "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);\r
             SwitchWorkspace sw = new SwitchWorkspace(this, true);\r
             int result = sw.showDialog();\r
@@ -3714,8 +3738,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
             this.dispose();\r
             System.exit(0);\r
         case Workspace.WORKSPACE_NO_TARGET_FILE:\r
-            JOptionPane.showConfirmDialog(null, "Target.txt File Is Not Existed", "Error",\r
-                                          JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);\r
+            JOptionPane.showConfirmDialog(null, "Target.txt File Is Not Existed", "Error", JOptionPane.DEFAULT_OPTION,\r
+                                          JOptionPane.ERROR_MESSAGE);\r
             this.dispose();\r
             System.exit(0);\r
         }\r
index df52b8a34dbcf6a5c203d52f3bf13fe97204f326..174b72fef0e69a8e814f8b2a049a8c970dcd07b4 100644 (file)
@@ -137,7 +137,7 @@ public class OpeningModuleList {
         if (index > -1) {\r
             return vOpeningModuleList.elementAt(index).isOpen();\r
         }\r
-        return true;\r
+        return false;\r
     }\r
 \r
     public void setTreePathById(ModuleIdentification id, Set<TreePath> treePath) {\r
index 44ccfa1fb1da243bdf81c59ccbbf7de9c50967d9..3f008f12ebec5fe0b68e0bbc6db5fb35a443b788 100644 (file)
@@ -137,7 +137,7 @@ public class OpeningPackageList {
         if (index > -1) {\r
             return vOpeningPackageList.elementAt(index).isOpen();\r
         }\r
-        return true;\r
+        return false;\r
     }\r
     \r
     public void setTreePathById(PackageIdentification id, Set<TreePath> treePath) {\r
index 40275e9eb3bfbbb1ffecce74405130296e525f55..cee2f8caadc2c122f424325fb49fb2ddc76de237 100644 (file)
@@ -139,7 +139,7 @@ public class OpeningPlatformList {
         if (index > -1) {\r
             return vOpeningPlatformList.elementAt(index).isOpen();\r
         }\r
-        return true;\r
+        return false;\r
     }\r
     \r
     public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {\r