]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
add lisence
[mirror_edk2.git] / Tools / Source / MigrationTools / org / tianocore / migration / FirstPanel.java
index ce15570807525a38eab17f40478ed2d2c84f73a9..90274d0910b68f5ec0fcf453098a3b8a01313f60 100644 (file)
@@ -27,12 +27,11 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
        private static final FirstPanel INSTANCE = FirstPanel.init();\r
        \r
        private String startpath;\r
-       private ModuleInfo mi;\r
        \r
        private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton;\r
        private JTextField moduletext;\r
        private JTextArea log;\r
-       private JFileChooser fc;\r
+       private JFileChooser fc = new JFileChooser();\r
        private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;\r
        \r
        private boolean tofile = true, toscreen = true;\r
@@ -120,9 +119,6 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         cst.fill = GridBagConstraints.BOTH;\r
         gridbag.setConstraints(logScrollPane, cst);\r
         add(logScrollPane);\r
-        \r
-               fc = new JFileChooser();\r
-        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r
        }\r
        \r
        //---------------------------------------------------------------------------------------//\r
@@ -165,8 +161,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
        //---------------------------------------------------------------------------------------//\r
 \r
-       public String getFilepath(String title) {\r
+       public String getFilepath(String title, int mode) {\r
                fc.setDialogTitle(title);\r
+               fc.setFileSelectionMode(mode);\r
                if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\r
                        log.append(fc.getSelectedFile().getAbsolutePath() + "\n");\r
                        return fc.getSelectedFile().getAbsolutePath();\r
@@ -178,7 +175,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
     public void actionPerformed(ActionEvent e) {\r
         if ( e.getSource() == moduleButton ) {\r
-               startpath = getFilepath("Please choose a starting path");\r
+               startpath = getFilepath("Please choose a starting path", JFileChooser.DIRECTORIES_ONLY);\r
                moduletext.setText(startpath);\r
         }\r
         if ( e.getSource() == goButton ) {\r
@@ -192,7 +189,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         }\r
         if ( e.getSource() == msaEditorButton) {\r
                try {\r
-               MsaTreeEditor.init(mi, this);\r
+               MsaTreeEditor.init();\r
                } catch (Exception en) {\r
                        println(en.getMessage());\r
                }\r