mirror of https://github.com/acidanthera/audk.git
add lisence
modify ui func git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1421 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
ff383de448
commit
5ad6d22a16
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -1,8 +1,22 @@
|
|||
/** @file
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
package org.tianocore.migration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
|
||||
public class MigrationTool {
|
||||
public static UI ui = null;
|
||||
public static Database db = null;
|
||||
|
@ -64,7 +78,7 @@ public class MigrationTool {
|
|||
if (MigrationTool.defaultoutput) {
|
||||
return inputpath.replaceAll(Common.strseparate, "$1");
|
||||
} else {
|
||||
return MigrationTool.ui.getFilepath("Please choose where to place the output module");
|
||||
return MigrationTool.ui.getFilepath("Please choose where to place the output module", JFileChooser.DIRECTORIES_ONLY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,10 +41,7 @@ public class MsaTreeEditor extends JPanel {
|
|||
addNode(rootNode, "2nd");
|
||||
}
|
||||
*/
|
||||
MsaTreeEditor(ModuleInfo m, UI u) {
|
||||
mi = m;
|
||||
ui = u;
|
||||
|
||||
MsaTreeEditor() {
|
||||
rootNode = new DefaultMutableTreeNode("Root Node");
|
||||
treeModel = new DefaultTreeModel(rootNode);
|
||||
|
||||
|
@ -69,8 +66,6 @@ public class MsaTreeEditor extends JPanel {
|
|||
addNode(rootNode, "2nd");
|
||||
}
|
||||
|
||||
private ModuleInfo mi;
|
||||
private UI ui;
|
||||
//private ModuleSurfaceAreaDocument msadoc;
|
||||
|
||||
private JTree tree;
|
||||
|
@ -115,13 +110,13 @@ public class MsaTreeEditor extends JPanel {
|
|||
init(mi, ui);
|
||||
}
|
||||
*/
|
||||
public static void init(ModuleInfo mi, UI ui) throws Exception {
|
||||
public static void init() throws Exception {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
|
||||
JFrame frame = new JFrame("MsaTreeEditor");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
MsaTreeEditor mte = new MsaTreeEditor(mi, ui);
|
||||
MsaTreeEditor mte = new MsaTreeEditor();
|
||||
mte.setLayout(new GridBagLayout());
|
||||
mte.setOpaque(true);
|
||||
frame.setContentPane(mte);
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
/** @file
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
package org.tianocore.migration;
|
||||
|
||||
import java.util.*;
|
||||
|
|
|
@ -28,5 +28,5 @@ public interface UI {
|
|||
|
||||
public String getInput(String message);
|
||||
|
||||
public String getFilepath(String title); // necessary ?
|
||||
public String getFilepath(String title, int mode); // necessary ?
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue