1. Fix EDKT308: Tool initialization should be supported by wizard
authorhche10x <hche10x@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 17 Oct 2006 06:14:42 +0000 (06:14 +0000)
committerhche10x <hche10x@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 17 Oct 2006 06:14:42 +0000 (06:14 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@1768 de2fecce-e211-0410-80a6-f3fac2684e05

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

index ad08749..0b0493a 100644 (file)
@@ -3711,6 +3711,11 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
                                           JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);\r
             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
+            this.dispose();\r
+            System.exit(0);\r
         }\r
     }\r
 }\r
index 5785aaf..580086f 100644 (file)
@@ -24,15 +24,17 @@ public class Workspace {
     // Define static return value\r
     //\r
     public final static int WORKSPACE_VALID = 0;\r
-    \r
+\r
     public final static int WORKSPACE_NOT_DEFINED = 1;\r
-    \r
+\r
     public final static int WORKSPACE_NOT_EXIST = 2;\r
-    \r
+\r
     public final static int WORKSPACE_NOT_DIRECTORY = 3;\r
-    \r
+\r
     public final static int WORKSPACE_NOT_VALID = 4;\r
     \r
+    public final static int WORKSPACE_NO_TARGET_FILE = 5;\r
+\r
     //\r
     // Define class members\r
     //\r
@@ -41,6 +43,9 @@ public class Workspace {
     private static String strWorkspaceDatabaseFile = DataType.FILE_SEPARATOR + "Tools" + DataType.FILE_SEPARATOR\r
                                                      + "Conf" + DataType.FILE_SEPARATOR + "FrameworkDatabase.db";\r
 \r
+    private static String targetFile = DataType.FILE_SEPARATOR + "Tools" + DataType.FILE_SEPARATOR + "Conf"\r
+                                       + DataType.FILE_SEPARATOR + "target.txt";\r
+\r
     /**\r
      \r
      @param args\r
@@ -99,7 +104,7 @@ public class Workspace {
         if (strWorkspace == null || strWorkspace == "") {\r
             return Workspace.WORKSPACE_NOT_DEFINED;\r
         }\r
-        \r
+\r
         //\r
         // Check if WORKSPACE Environment exists\r
         //\r
@@ -107,14 +112,14 @@ public class Workspace {
         if (!f.exists()) {\r
             return Workspace.WORKSPACE_NOT_EXIST;\r
         }\r
-        \r
+\r
         //\r
         // Check if WORKSPACE Environment is a directory\r
         //\r
         if (!f.isDirectory()) {\r
             return Workspace.WORKSPACE_NOT_DIRECTORY;\r
         }\r
-        \r
+\r
         //\r
         // Check if FrameworkDatabase.db exists\r
         //\r
@@ -123,6 +128,14 @@ public class Workspace {
             return Workspace.WORKSPACE_NOT_VALID;\r
         }\r
         \r
+        //\r
+        // Check if Target.txt exists\r
+        //\r
+        f = new File(strWorkspace + Workspace.getTargetFile());\r
+        if (!f.exists()) {\r
+            return Workspace.WORKSPACE_NO_TARGET_FILE;\r
+        }\r
+\r
         return Workspace.WORKSPACE_VALID;\r
     }\r
 \r
@@ -133,4 +146,8 @@ public class Workspace {
     public static void setStrWorkspaceDatabaseFile(String strWorkspaceDatabaseFile) {\r
         //Workspace.strWorkspaceDatabaseFile = strWorkspaceDatabaseFile;\r
     }\r
+\r
+    public static String getTargetFile() {\r
+        return targetFile;\r
+    }\r
 }\r