summaryrefslogtreecommitdiff
path: root/Tools/Source/MigrationTools
diff options
context:
space:
mode:
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-01 06:19:05 +0000
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>2006-09-01 06:19:05 +0000
commit5ad6d22a16fa4f18fd03880a18fb88e654a627ac (patch)
tree546e9f923d023212c1acf45af97c7d7e2d8b6040 /Tools/Source/MigrationTools
parentff383de448c0ce4b9e150d646e707731644024eb (diff)
downloadedk2-5ad6d22a16fa4f18fd03880a18fb88e654a627ac.zip
edk2-5ad6d22a16fa4f18fd03880a18fb88e654a627ac.tar.gz
edk2-5ad6d22a16fa4f18fd03880a18fb88e654a627ac.tar.bz2
add lisence
modify ui func git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1421 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/MigrationTools')
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java13
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java16
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java11
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java12
-rw-r--r--Tools/Source/MigrationTools/org/tianocore/migration/UI.java2
5 files changed, 36 insertions, 18 deletions
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java b/Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
index ce15570..90274d0 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());
}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
index 3b3486f..cbb49a1 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
@@ -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);
}
}
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java b/Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
index 7bdf028..81870c0 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
@@ -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);
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java b/Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
index 0207577..00dfe71 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
@@ -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.*;
diff --git a/Tools/Source/MigrationTools/org/tianocore/migration/UI.java b/Tools/Source/MigrationTools/org/tianocore/migration/UI.java
index 2ad306d..9a77a53 100644
--- a/Tools/Source/MigrationTools/org/tianocore/migration/UI.java
+++ b/Tools/Source/MigrationTools/org/tianocore/migration/UI.java
@@ -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 ?
}