]> git.proxmox.com Git - mirror_edk2.git/commitdiff
default outputpath
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 23 Aug 2006 08:49:19 +0000 (08:49 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 23 Aug 2006 08:49:19 +0000 (08:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1361 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/MigrationTools/org/tianocore/migration/Common.java
Tools/Source/MigrationTools/org/tianocore/migration/Critic.java
Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java

index 2fcd092315a43553c9d0f7bd0287b1eb6c1a62d1..44b25e7e12d9b630c367c13a1c185b8855da05ca 100644 (file)
@@ -22,6 +22,7 @@ public final class Common {
        public static final int FILE = 1;\r
        public static final int DIR = 2;\r
        \r
        public static final int FILE = 1;\r
        public static final int DIR = 2;\r
        \r
+       public static final String strseparate = "(.*)\\\\([^\\\\]*)";\r
        public static final Pattern ptnseparate = Pattern.compile("(.*)\\\\([^\\\\]*)");\r
 \r
        //-------------------------------------regex------------------------------------------//\r
        public static final Pattern ptnseparate = Pattern.compile("(.*)\\\\([^\\\\]*)");\r
 \r
        //-------------------------------------regex------------------------------------------//\r
index 28bfd0884f2871f09fd8b030ba8d5676738373fb..c737c31403a0f15f86600e7b3ab93932b613e39b 100644 (file)
@@ -202,7 +202,8 @@ public final class Critic {
        }\r
        \r
        public static final void fireAt(String path) throws Exception {\r
        }\r
        \r
        public static final void fireAt(String path) throws Exception {\r
-               Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE);\r
+               //Common.toDoAll(Common.dirCopy_(path), Critic.class.getMethod("critic", String.class), null, null, Common.FILE);\r
+               Common.toDoAll(path, Critic.class.getMethod("critic", String.class), null, null, Common.FILE);\r
                //Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE);\r
                System.out.println("Critic Done");\r
        }\r
                //Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE);\r
                System.out.println("Critic Done");\r
        }\r
index 438625380ecf6908700e158c1a421e6991e80f87..83cf9b60d2d56b9dd82645b709e781d01ffe89b4 100644 (file)
@@ -73,6 +73,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                \r
                defaultpathbox = new JCheckBox("Use Default Output Path", true);\r
                defaultpathbox.addItemListener(this);\r
                \r
                defaultpathbox = new JCheckBox("Use Default Output Path", true);\r
                defaultpathbox.addItemListener(this);\r
+               ModuleInfo.defaultoutput = true;\r
                \r
         JPanel modulePanel = new JPanel();\r
         modulePanel.add(moduleButton);\r
                \r
         JPanel modulePanel = new JPanel();\r
         modulePanel.add(moduleButton);\r
@@ -218,16 +219,14 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
        } else if (e.getSource() == criticbox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
                        ModuleInfo.doCritic = false;\r
        } else if (e.getSource() == criticbox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
                        ModuleInfo.doCritic = false;\r
-                       System.out.println("criticbox DESELECTED");\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
                        ModuleInfo.doCritic = true;\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
                        ModuleInfo.doCritic = true;\r
-                       System.out.println("criticbox SELECTED");\r
                }\r
        } else if (e.getSource() == defaultpathbox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
                }\r
        } else if (e.getSource() == defaultpathbox) {\r
                if (e.getStateChange() == ItemEvent.DESELECTED) {\r
-                       System.out.println("defaultpathbox DESELECTED");\r
+                       ModuleInfo.defaultoutput = false;\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
                } else if (e.getStateChange() == ItemEvent.SELECTED) {\r
-                       System.out.println("defaultpathbox SELECTED");\r
+                       ModuleInfo.defaultoutput = true;\r
                }\r
        }\r
     }\r
                }\r
        }\r
     }\r
index 9e58ed914ae3e3bafabfcab6e18808d092ce2e13..3e4c4cbae2abb90736255a2bf46e6ed48c3b790d 100644 (file)
@@ -23,11 +23,15 @@ public class ModuleInfo {
        ModuleInfo(String modulepath) throws Exception {\r
                this.modulepath = modulepath;\r
                \r
        ModuleInfo(String modulepath) throws Exception {\r
                this.modulepath = modulepath;\r
                \r
-               ModuleInfo.ui.println("Choose where to place the result");\r
-               if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {\r
-                       outputpath = modulepath; \r
+               if (ModuleInfo.defaultoutput) {\r
+                       this.outputpath = this.modulepath.replaceAll(Common.strseparate, "$1");\r
+               } else {\r
+                       ModuleInfo.ui.println("Choose where to place the result");\r
+                       if ((outputpath = ModuleInfo.ui.getFilepath()) == null) {\r
+                               outputpath = modulepath; \r
+                       }\r
+                       ModuleInfo.ui.println("Output to: " + outputpath);\r
                }\r
                }\r
-               ModuleInfo.ui.println(outputpath);\r
        }\r
 \r
        public String modulepath = null;\r
        }\r
 \r
        public String modulepath = null;\r
@@ -67,7 +71,7 @@ public class ModuleInfo {
                }\r
        }\r
 \r
                }\r
        }\r
 \r
-       private static final boolean isModule(String path) {\r
+       public static final boolean isModule(String path) {\r
                String[] list = new File(path).list();\r
                for (int i = 0 ; i < list.length ; i++) {\r
                        if (!new File(list[i]).isDirectory()) {\r
                String[] list = new File(path).list();\r
                for (int i = 0 ; i < list.length ; i++) {\r
                        if (!new File(list[i]).isDirectory()) {\r
@@ -112,8 +116,8 @@ public class ModuleInfo {
                \r
                ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);\r
                ModuleInfo.ui.println("Complete!");\r
                \r
                ModuleInfo.ui.println("Errors Left : " + ModuleInfo.db.error);\r
                ModuleInfo.ui.println("Complete!");\r
-               ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");\r
-               ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);\r
+               //ModuleInfo.ui.println("Your R9 module was placed here: " + mi.modulepath + File.separator + "result");\r
+               //ModuleInfo.ui.println("Your logfile was placed here: " + mi.modulepath);\r
        }\r
        \r
        private static final void show(Set<String> hash, String show) {\r
        }\r
        \r
        private static final void show(Set<String> hash, String show) {\r
@@ -140,6 +144,7 @@ public class ModuleInfo {
        \r
        public static boolean printModuleInfo = false;\r
        public static boolean doCritic = false;\r
        \r
        public static boolean printModuleInfo = false;\r
        public static boolean doCritic = false;\r
+       public static boolean defaultoutput = false;\r
        \r
        public static void main(String[] args) throws Exception {\r
                ui = FirstPanel.init();\r
        \r
        public static void main(String[] args) throws Exception {\r
                ui = FirstPanel.init();\r