1. Fix EDKT441 After some modifications and refresh, there will show a dialog for...
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Oct 2006 03:02:15 +0000 (03:02 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 30 Oct 2006 03:02:15 +0000 (03:02 +0000)
2. Fix EDKT442 After some modifications and refresh, there will show a dialog for save all files. The operation of erasing this dialog should be regarded as Cancel, not refresh wizard.
3. Fix EDKT455 The style of menu should be unified
4. Fix EDKT439 After some modifications and exit, there will show a dialog for save all files. The operation of erasing this dialog should be regard as Cancel, not exit wizard.

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

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java

index 3c31bac1f5ae25b3fab71431a6b602b07767ca41..70c154f394a562b854d7c033e1201f0a5c5236d7 100644 (file)
@@ -683,7 +683,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemHelpAbout() {\r
         if (jMenuItemHelpAbout == null) {\r
             jMenuItemHelpAbout = new JMenuItem();\r
-            jMenuItemHelpAbout.setText("About...");\r
+            jMenuItemHelpAbout.setText("About");\r
             jMenuItemHelpAbout.setMnemonic('A');\r
             jMenuItemHelpAbout.addActionListener(this);\r
         }\r
@@ -1358,7 +1358,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemToolsBuildPreferences() {\r
         if (jMenuItemToolsBuildPreferences == null) {\r
             jMenuItemToolsBuildPreferences = new JMenuItem();\r
-            jMenuItemToolsBuildPreferences.setText("Build Preferences");\r
+            jMenuItemToolsBuildPreferences.setText("Build Preferences...");\r
             jMenuItemToolsBuildPreferences.setMnemonic('P');\r
             jMenuItemToolsBuildPreferences.setEnabled(true);\r
             jMenuItemToolsBuildPreferences.addActionListener(this);\r
@@ -1598,7 +1598,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemProjectInstallFar() {\r
         if (jMenuItemProjectInstallFar == null) {\r
             jMenuItemProjectInstallFar = new JMenuItem();\r
-            jMenuItemProjectInstallFar.setText("Install FAR");\r
+            jMenuItemProjectInstallFar.setText("Install FAR...");\r
             jMenuItemProjectInstallFar.setMnemonic('I');\r
             jMenuItemProjectInstallFar.setEnabled(true);\r
             jMenuItemProjectInstallFar.addActionListener(this);\r
@@ -1614,7 +1614,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemProjectUpdateFar() {\r
         if (jMenuItemProjectUpdateFar == null) {\r
             jMenuItemProjectUpdateFar = new JMenuItem();\r
-            jMenuItemProjectUpdateFar.setText("Update FAR");\r
+            jMenuItemProjectUpdateFar.setText("Update FAR...");\r
             jMenuItemProjectUpdateFar.setMnemonic('U');\r
             jMenuItemProjectUpdateFar.setEnabled(true);\r
             jMenuItemProjectUpdateFar.addActionListener(this);\r
@@ -1631,7 +1631,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemProjectRemoveFar() {\r
         if (jMenuItemProjectRemoveFar == null) {\r
             jMenuItemProjectRemoveFar = new JMenuItem();\r
-            jMenuItemProjectRemoveFar.setText("Remove FAR");\r
+            jMenuItemProjectRemoveFar.setText("Remove FAR...");\r
             jMenuItemProjectRemoveFar.setMnemonic('R');\r
             jMenuItemProjectRemoveFar.setEnabled(true);\r
             jMenuItemProjectRemoveFar.addActionListener(this);\r
@@ -1647,7 +1647,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemProjectCreateFar() {\r
         if (jMenuItemProjectCreateFar == null) {\r
             jMenuItemProjectCreateFar = new JMenuItem();\r
-            jMenuItemProjectCreateFar.setText("Create FAR");\r
+            jMenuItemProjectCreateFar.setText("Create FAR...");\r
             jMenuItemProjectCreateFar.setMnemonic('C');\r
             jMenuItemProjectCreateFar.addActionListener(this);\r
         }\r
@@ -1774,7 +1774,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
     private JMenuItem getJMenuItemToolsGenerateGuidsXref() {\r
         if (jMenuItemToolsGenerateGuidsXref == null) {\r
             jMenuItemToolsGenerateGuidsXref = new JMenuItem();\r
-            jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref");\r
+            jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref...");\r
             jMenuItemToolsGenerateGuidsXref.setMnemonic('G');\r
             jMenuItemToolsGenerateGuidsXref.addActionListener(this);\r
         }\r
@@ -1903,9 +1903,10 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
         }\r
 \r
         if (arg0.getSource() == this.jMenuItemFileRefresh) {\r
-            this.closeAll();\r
-            this.refresh();\r
-            this.makeEmptyTree();\r
+            if (this.closeAll() == 0) {\r
+                this.refresh();\r
+                this.makeEmptyTree();    \r
+            }\r
         }\r
 \r
         if (arg0.getSource() == this.jMenuItemFileExit) {\r
@@ -3189,8 +3190,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
      Close all opening files and clean all showing internal frame\r
      \r
      **/\r
-    private void closeAll() {\r
-        int result = -1;\r
+    private int closeAll() {\r
+        int result = JOptionPane.NO_OPTION;\r
         if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()\r
             || !GlobalData.openingPlatformList.isSaved()) {\r
             result = showSaveDialog();\r
@@ -3203,13 +3204,15 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
             // Do nothing\r
             //\r
         }\r
-        if (result == JOptionPane.CANCEL_OPTION) {\r
-            return;\r
+        if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {\r
+            return -1;\r
         }\r
         this.cleanDesktopPane();\r
         GlobalData.openingModuleList.closeAll();\r
         GlobalData.openingPackageList.closeAll();\r
         GlobalData.openingPlatformList.closeAll();\r
+        \r
+        return 0;\r
     }\r
 \r
     /**\r
@@ -3282,18 +3285,16 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
      \r
      **/\r
     private void exit() {\r
-        int result = -1;\r
+        int result = JOptionPane.NO_OPTION;\r
         if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()\r
             || !GlobalData.openingPlatformList.isSaved()) {\r
             result = showSaveDialog();\r
         }\r
         if (result == JOptionPane.YES_OPTION) {\r
             this.saveAll();\r
-        }\r
-        if (result == JOptionPane.NO_OPTION) {\r
+        } else if (result == JOptionPane.NO_OPTION) {\r
             // Do nothing\r
-        }\r
-        if (result == JOptionPane.CANCEL_OPTION) {\r
+        } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {\r
             return;\r
         }\r
         this.dispose();\r