modify ui func
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1421
6f19259b-4bc3-4df7-8a09-
765794883524
private static final FirstPanel INSTANCE = FirstPanel.init();\r
\r
private String startpath;\r
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
\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
private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;\r
\r
private boolean tofile = true, toscreen = true;\r
cst.fill = GridBagConstraints.BOTH;\r
gridbag.setConstraints(logScrollPane, cst);\r
add(logScrollPane);\r
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
}\r
\r
//---------------------------------------------------------------------------------------//\r
\r
//---------------------------------------------------------------------------------------//\r
\r
\r
//---------------------------------------------------------------------------------------//\r
\r
- public String getFilepath(String title) {\r
+ public String getFilepath(String title, int mode) {\r
fc.setDialogTitle(title);\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
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\r
log.append(fc.getSelectedFile().getAbsolutePath() + "\n");\r
return fc.getSelectedFile().getAbsolutePath();\r
\r
public void actionPerformed(ActionEvent e) {\r
if ( e.getSource() == moduleButton ) {\r
\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
moduletext.setText(startpath);\r
}\r
if ( e.getSource() == goButton ) {\r
}\r
if ( e.getSource() == msaEditorButton) {\r
try {\r
}\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
} catch (Exception en) {\r
println(en.getMessage());\r
}\r
+/** @file\r
+ \r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ \r
+ **/\r
package org.tianocore.migration;\r
\r
import java.io.File;\r
import java.util.*;\r
\r
package org.tianocore.migration;\r
\r
import java.io.File;\r
import java.util.*;\r
\r
+import javax.swing.JFileChooser;\r
+\r
public class MigrationTool {\r
public static UI ui = null;\r
public static Database db = null;\r
public class MigrationTool {\r
public static UI ui = null;\r
public static Database db = null;\r
if (MigrationTool.defaultoutput) {\r
return inputpath.replaceAll(Common.strseparate, "$1");\r
} else {\r
if (MigrationTool.defaultoutput) {\r
return inputpath.replaceAll(Common.strseparate, "$1");\r
} else {\r
- return MigrationTool.ui.getFilepath("Please choose where to place the output module");\r
+ return MigrationTool.ui.getFilepath("Please choose where to place the output module", JFileChooser.DIRECTORIES_ONLY);\r
addNode(rootNode, "2nd");\r
}\r
*/\r
addNode(rootNode, "2nd");\r
}\r
*/\r
- MsaTreeEditor(ModuleInfo m, UI u) {\r
- mi = m;\r
- ui = u;\r
- \r
rootNode = new DefaultMutableTreeNode("Root Node");\r
treeModel = new DefaultTreeModel(rootNode);\r
\r
rootNode = new DefaultMutableTreeNode("Root Node");\r
treeModel = new DefaultTreeModel(rootNode);\r
\r
addNode(rootNode, "2nd");\r
}\r
\r
addNode(rootNode, "2nd");\r
}\r
\r
- private ModuleInfo mi;\r
- private UI ui;\r
//private ModuleSurfaceAreaDocument msadoc;\r
\r
private JTree tree;\r
//private ModuleSurfaceAreaDocument msadoc;\r
\r
private JTree tree;\r
- public static void init(ModuleInfo mi, UI ui) throws Exception {\r
+ public static void init() throws Exception {\r
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r
\r
JFrame frame = new JFrame("MsaTreeEditor");\r
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
\r
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\r
\r
JFrame frame = new JFrame("MsaTreeEditor");\r
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
\r
- MsaTreeEditor mte = new MsaTreeEditor(mi, ui);\r
+ MsaTreeEditor mte = new MsaTreeEditor();\r
mte.setLayout(new GridBagLayout());\r
mte.setOpaque(true);\r
frame.setContentPane(mte);\r
mte.setLayout(new GridBagLayout());\r
mte.setOpaque(true);\r
frame.setContentPane(mte);\r
+/** @file\r
+ \r
+ Copyright (c) 2006, Intel Corporation\r
+ All rights reserved. This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+ \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ \r
+ **/\r
package org.tianocore.migration;\r
\r
import java.util.*;\r
package org.tianocore.migration;\r
\r
import java.util.*;\r
\r
public String getInput(String message);\r
\r
\r
public String getInput(String message);\r
\r
- public String getFilepath(String title); // necessary ?\r
+ public String getFilepath(String title, int mode); // necessary ?\r