1. Fix EDKT308: Tool initialization should be supported by wizard
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Oct 2006 06:14:42 +0000 (06:14 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 17 Oct 2006 06:14:42 +0000 (06:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1768 6f19259b-4bc3-4df7-8a09-765794883524

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

index ad08749b7f6f789464008116d94bfc36d3ed0af1..0b0493aeed41a63eefc765d9e726582364d70558 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 5785aaf8aad0316ab6d691180c6f9f133dfad356..580086ff92b718367f5219343db992d6bb5bd995 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