mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 16:14:04 +02:00
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 static final FirstPanel INSTANCE = FirstPanel.init();
|
||||||
|
|
||||||
private String startpath;
|
private String startpath;
|
||||||
private ModuleInfo mi;
|
|
||||||
|
|
||||||
private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton;
|
private JButton moduleButton, goButton, msaEditorButton, criticButton, specifyCommentButton;
|
||||||
private JTextField moduletext;
|
private JTextField moduletext;
|
||||||
private JTextArea log;
|
private JTextArea log;
|
||||||
private JFileChooser fc;
|
private JFileChooser fc = new JFileChooser();
|
||||||
private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;
|
private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;
|
||||||
|
|
||||||
private boolean tofile = true, toscreen = true;
|
private boolean tofile = true, toscreen = true;
|
||||||
@ -120,9 +119,6 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||||||
cst.fill = GridBagConstraints.BOTH;
|
cst.fill = GridBagConstraints.BOTH;
|
||||||
gridbag.setConstraints(logScrollPane, cst);
|
gridbag.setConstraints(logScrollPane, cst);
|
||||||
add(logScrollPane);
|
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.setDialogTitle(title);
|
||||||
|
fc.setFileSelectionMode(mode);
|
||||||
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
|
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
|
||||||
log.append(fc.getSelectedFile().getAbsolutePath() + "\n");
|
log.append(fc.getSelectedFile().getAbsolutePath() + "\n");
|
||||||
return fc.getSelectedFile().getAbsolutePath();
|
return fc.getSelectedFile().getAbsolutePath();
|
||||||
@ -178,7 +175,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||||||
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if ( e.getSource() == moduleButton ) {
|
if ( e.getSource() == moduleButton ) {
|
||||||
startpath = getFilepath("Please choose a starting path");
|
startpath = getFilepath("Please choose a starting path", JFileChooser.DIRECTORIES_ONLY);
|
||||||
moduletext.setText(startpath);
|
moduletext.setText(startpath);
|
||||||
}
|
}
|
||||||
if ( e.getSource() == goButton ) {
|
if ( e.getSource() == goButton ) {
|
||||||
@ -192,7 +189,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
|
|||||||
}
|
}
|
||||||
if ( e.getSource() == msaEditorButton) {
|
if ( e.getSource() == msaEditorButton) {
|
||||||
try {
|
try {
|
||||||
MsaTreeEditor.init(mi, this);
|
MsaTreeEditor.init();
|
||||||
} catch (Exception en) {
|
} catch (Exception en) {
|
||||||
println(en.getMessage());
|
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;
|
package org.tianocore.migration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
|
|
||||||
public class MigrationTool {
|
public class MigrationTool {
|
||||||
public static UI ui = null;
|
public static UI ui = null;
|
||||||
public static Database db = null;
|
public static Database db = null;
|
||||||
@ -64,7 +78,7 @@ public class MigrationTool {
|
|||||||
if (MigrationTool.defaultoutput) {
|
if (MigrationTool.defaultoutput) {
|
||||||
return inputpath.replaceAll(Common.strseparate, "$1");
|
return inputpath.replaceAll(Common.strseparate, "$1");
|
||||||
} else {
|
} 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");
|
addNode(rootNode, "2nd");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
MsaTreeEditor(ModuleInfo m, UI u) {
|
MsaTreeEditor() {
|
||||||
mi = m;
|
|
||||||
ui = u;
|
|
||||||
|
|
||||||
rootNode = new DefaultMutableTreeNode("Root Node");
|
rootNode = new DefaultMutableTreeNode("Root Node");
|
||||||
treeModel = new DefaultTreeModel(rootNode);
|
treeModel = new DefaultTreeModel(rootNode);
|
||||||
|
|
||||||
@ -69,8 +66,6 @@ public class MsaTreeEditor extends JPanel {
|
|||||||
addNode(rootNode, "2nd");
|
addNode(rootNode, "2nd");
|
||||||
}
|
}
|
||||||
|
|
||||||
private ModuleInfo mi;
|
|
||||||
private UI ui;
|
|
||||||
//private ModuleSurfaceAreaDocument msadoc;
|
//private ModuleSurfaceAreaDocument msadoc;
|
||||||
|
|
||||||
private JTree tree;
|
private JTree tree;
|
||||||
@ -115,13 +110,13 @@ public class MsaTreeEditor extends JPanel {
|
|||||||
init(mi, ui);
|
init(mi, ui);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
public static void init(ModuleInfo mi, UI ui) throws Exception {
|
public static void init() throws Exception {
|
||||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||||
|
|
||||||
JFrame frame = new JFrame("MsaTreeEditor");
|
JFrame frame = new JFrame("MsaTreeEditor");
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
MsaTreeEditor mte = new MsaTreeEditor(mi, ui);
|
MsaTreeEditor mte = new MsaTreeEditor();
|
||||||
mte.setLayout(new GridBagLayout());
|
mte.setLayout(new GridBagLayout());
|
||||||
mte.setOpaque(true);
|
mte.setOpaque(true);
|
||||||
frame.setContentPane(mte);
|
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;
|
package org.tianocore.migration;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -28,5 +28,5 @@ public interface UI {
|
|||||||
|
|
||||||
public String getInput(String message);
|
public String getInput(String message);
|
||||||
|
|
||||||
public String getFilepath(String title); // necessary ?
|
public String getFilepath(String title, int mode); // necessary ?
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user