editable comment style
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 Aug 2006 08:36:25 +0000 (08:36 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 Aug 2006 08:36:25 +0000 (08:36 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1407 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
Tools/Source/MigrationTools/org/tianocore/migration/ModuleReader.java

index c78ad97bb3063604bd7554a02f42fea43f1a8b8c..fac874e381fd9a95c0895b1a585b111299c37556 100644 (file)
@@ -29,7 +29,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
        private String startpath;\r
        private ModuleInfo mi;\r
        \r
-       private JButton moduleButton, goButton, msaEditorButton, criticButton;\r
+       private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton;\r
        private JTextField moduletext;\r
        private JTextArea log;\r
        private JFileChooser fc;\r
@@ -57,6 +57,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                criticButton = new JButton("Critic");\r
                criticButton.addActionListener(this);\r
                \r
+               specifyCommentButton = new JButton("Comment Style");\r
+               specifyCommentButton.addActionListener(this);\r
+               \r
                moduletext = new JTextField(30);\r
                \r
                filebox = new JCheckBox("Output to logfile", true);\r
@@ -90,7 +93,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
         cst.gridx = 1;\r
         cst.gridy = 0;\r
-        gridbag.setConstraints(criticButton, cst);\r
+        gridbag.setConstraints(specifyCommentButton, cst);\r
+        add(specifyCommentButton);\r
+        //gridbag.setConstraints(criticButton, cst);\r
         //add(criticButton);\r
         \r
         JPanel checkboxPanel = new JPanel();\r
@@ -199,6 +204,13 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
                        println(en.getMessage());\r
                }\r
         }\r
+        if ( e.getSource() == specifyCommentButton) {\r
+               try {                                                                                   // input examine is not imposed but should be added\r
+                       MigrationTool.MIGRATIONCOMMENT = getInput("Please type in wanted comment style used by the tool\nbe sure to start with '//', or you won't enjoy the result");\r
+               } catch (Exception en) {\r
+                       println(en.getMessage());\r
+               }\r
+        }\r
     }\r
     \r
     public void itemStateChanged(ItemEvent e) {\r
index e1e769f62dc4a810bab49cb466b5304db1aa6d7c..04ab0221b98f0ecc03134dfc5294d744fad43fb2 100644 (file)
@@ -7,7 +7,7 @@ public class MigrationTool {
        public static UI ui = null;\r
        public static Database db = null;\r
 \r
-       public static final String MIGRATIONCOMMENT = "//%$//";\r
+       public static String MIGRATIONCOMMENT = "//%$//";\r
 \r
        public static boolean printModuleInfo = false;\r
        public static boolean doCritic = false;\r
index e7b62f0b97f102f379635299cca2b693d7df42df..bc3fd75cb21e97f78de05a0031302891c674f28c 100644 (file)
@@ -136,6 +136,16 @@ public final class ModuleReader {
                        rd = new BufferedReader(new FileReader(mi.modulepath + File.separator + curFile));\r
                        Common.ensureDir(mi.modulepath + File.separator + "temp" + File.separator + curFile);\r
                        outfile = new PrintWriter(new BufferedWriter(new FileWriter(mi.modulepath + File.separator + "temp" + File.separator + curFile)));\r
+                       \r
+                       /*\r
+                       if (curFile.contains(".dxs")) {\r
+                               if (mi.moduletype.contains("PEI")) {\r
+                                       \r
+                               } else {\r
+                                       \r
+                               }\r
+                       }\r
+                       */\r
                        while ((line = rd.readLine()) != null) {\r
                                if (line.contains("#include")) {\r
                                        mtrinclude = ptninclude.matcher(line);\r
@@ -148,6 +158,7 @@ public final class ModuleReader {
                        }\r
                        outfile.flush();\r
                        outfile.close();\r
+                       \r
                }\r
        }\r
 \r