X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FFirstPanel.java;fp=Tools%2FSource%2FMigrationTools%2Forg%2Ftianocore%2Fmigration%2FFirstPanel.java;h=90274d0910b68f5ec0fcf453098a3b8a01313f60;hp=ce15570807525a38eab17f40478ed2d2c84f73a9;hb=5ad6d22a16fa4f18fd03880a18fb88e654a627ac;hpb=ff383de448c0ce4b9e150d646e707731644024eb diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java index ce15570807..90274d0910 100644 --- a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java +++ b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java @@ -27,12 +27,11 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList private static final FirstPanel INSTANCE = FirstPanel.init(); private String startpath; - private ModuleInfo mi; private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton; private JTextField moduletext; private JTextArea log; - private JFileChooser fc; + private JFileChooser fc = new JFileChooser(); private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox; private boolean tofile = true, toscreen = true; @@ -120,9 +119,6 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList cst.fill = GridBagConstraints.BOTH; gridbag.setConstraints(logScrollPane, cst); add(logScrollPane); - - fc = new JFileChooser(); - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); } //---------------------------------------------------------------------------------------// @@ -165,8 +161,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList //---------------------------------------------------------------------------------------// - public String getFilepath(String title) { + public String getFilepath(String title, int mode) { fc.setDialogTitle(title); + fc.setFileSelectionMode(mode); if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { log.append(fc.getSelectedFile().getAbsolutePath() + "\n"); return fc.getSelectedFile().getAbsolutePath(); @@ -178,7 +175,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList public void actionPerformed(ActionEvent e) { if ( e.getSource() == moduleButton ) { - startpath = getFilepath("Please choose a starting path"); + startpath = getFilepath("Please choose a starting path", JFileChooser.DIRECTORIES_ONLY); moduletext.setText(startpath); } if ( e.getSource() == goButton ) { @@ -192,7 +189,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList } if ( e.getSource() == msaEditorButton) { try { - MsaTreeEditor.init(mi, this); + MsaTreeEditor.init(); } catch (Exception en) { println(en.getMessage()); }