]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Turn to Regex in ModuleReader.java
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / FirstPanel.java
index 30085d449edd0770bc1fd7c5ab4712334da39fa5..9f853e42f2e53cea900fa9a2b358d4cd1467db36 100644 (file)
@@ -25,8 +25,9 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
        private static final long serialVersionUID = 207759413522910399L;\r
        \r
        private String modulepath;\r
+       private ModuleInfo mi;\r
        \r
-       private JButton moduleButton , goButton;\r
+       private JButton moduleButton, goButton, msaEditorButton;\r
        private JTextField moduletext;\r
        private JTextArea log;\r
        private JFileChooser fc;\r
@@ -43,6 +44,9 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
                moduleButton = new JButton("Choose ModulePath");\r
                moduleButton.addActionListener(this);\r
 \r
+               msaEditorButton = new JButton("MsaEditor");\r
+               msaEditorButton.addActionListener(this);\r
+               \r
                moduletext = new JTextField(30);\r
                \r
                filebox = new JCheckBox("Output to logfile", true);\r
@@ -54,9 +58,10 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
         modulePanel.add(filebox);\r
         modulePanel.add(screenbox);\r
         modulePanel.add(goButton);\r
+        modulePanel.add(msaEditorButton);\r
         add(modulePanel);\r
 \r
-        log = new JTextArea(50,25);\r
+        log = new JTextArea(20,25);\r
         log.setMargin(new Insets(5,5,5,5));\r
         log.setEditable(false);\r
         JScrollPane logScrollPane = new JScrollPane(log);\r
@@ -99,16 +104,13 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
        public String choose(String message, Object[] choicelist) {\r
                return (String)JOptionPane.showInputDialog(this, message,"Choose",JOptionPane.PLAIN_MESSAGE,null,choicelist,choicelist[0]);\r
        }\r
-\r
-       //---------------------------------------------------------------------------------------//\r
        \r
-       /*\r
-       public boolean getOption(String item) {\r
-               if (item.matches("file")) {\r
-               }\r
+       public String getInput(String message) {\r
+               return (String)JOptionPane.showInputDialog(message);\r
        }\r
-       */\r
-       \r
+\r
+       //---------------------------------------------------------------------------------------//\r
+\r
     public void actionPerformed(ActionEvent e) {\r
         if ( e.getSource() == moduleButton ) {\r
                int ret = fc.showOpenDialog(this);\r
@@ -123,12 +125,19 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
                        logfile = new PrintWriter(new BufferedWriter(new FileWriter(modulepath + File.separator + "migration.log")));\r
                        println("Project MsaGen");\r
                        println("Copyright (c) 2006, Intel Corporation");\r
-                       new ModuleInfo(modulepath, this, new Database());\r
+                       mi = new ModuleInfo(modulepath, this, new Database());\r
                        logfile.flush();\r
                } catch (Exception en) {\r
                        println(en.getMessage());\r
                }\r
         }\r
+        if ( e.getSource() == msaEditorButton) {\r
+               try {\r
+               MsaTreeEditor.init(mi, this);\r
+               } catch (Exception en) {\r
+                       println(en.getMessage());\r
+               }\r
+        }\r
     }\r
     \r
     public void itemStateChanged(ItemEvent e) {\r
@@ -156,7 +165,7 @@ public class FirstPanel extends JPanel implements ActionListener, UI {
                fp.setOpaque(true);\r
         frame.setContentPane(fp);\r
 \r
-               frame.setSize(800,600);\r
+               frame.pack();\r
                frame.setVisible(true);\r
     }\r
 }
\ No newline at end of file