]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add lisence
authoralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Sep 2006 06:19:05 +0000 (06:19 +0000)
committeralfred <alfred@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 1 Sep 2006 06:19:05 +0000 (06:19 +0000)
modify ui func

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1421 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
Tools/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
Tools/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
Tools/Source/MigrationTools/org/tianocore/migration/PathIterator.java
Tools/Source/MigrationTools/org/tianocore/migration/UI.java

index ce15570807525a38eab17f40478ed2d2c84f73a9..90274d0910b68f5ec0fcf453098a3b8a01313f60 100644 (file)
@@ -27,12 +27,11 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
        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
-       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
@@ -120,9 +119,6 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         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
@@ -165,8 +161,9 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \r
        //---------------------------------------------------------------------------------------//\r
 \r
-       public String getFilepath(String title) {\r
+       public String getFilepath(String title, int mode) {\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
@@ -178,7 +175,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
 \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
@@ -192,7 +189,7 @@ public final class FirstPanel extends JPanel implements ActionListener, ItemList
         }\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
index 3b3486fea6674f6cab546e735f306118750f4c0b..cbb49a13daa06953406b0afaef9c8f37cf6918bd 100644 (file)
@@ -1,8 +1,22 @@
+/** @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
+import javax.swing.JFileChooser;\r
+\r
 public class MigrationTool {\r
        public static UI ui = null;\r
        public static Database db = null;\r
@@ -64,7 +78,7 @@ public class MigrationTool {
                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
                }\r
        }\r
        \r
index 7bdf0281199ca2c57c6b25fcbab17bc79b62106b..81870c09e545bc22d28715db22c1bc5e9101e6de 100644 (file)
@@ -41,10 +41,7 @@ public class MsaTreeEditor extends JPanel {
         addNode(rootNode, "2nd");\r
        }\r
 */\r
-       MsaTreeEditor(ModuleInfo m, UI u) {\r
-               mi = m;\r
-               ui = u;\r
-               \r
+       MsaTreeEditor() {\r
         rootNode = new DefaultMutableTreeNode("Root Node");\r
         treeModel = new DefaultTreeModel(rootNode);\r
 \r
@@ -69,8 +66,6 @@ public class MsaTreeEditor extends JPanel {
         addNode(rootNode, "2nd");\r
        }\r
        \r
-       private ModuleInfo mi;\r
-       private UI ui;\r
        //private ModuleSurfaceAreaDocument msadoc;\r
        \r
        private JTree tree;\r
@@ -115,13 +110,13 @@ public class MsaTreeEditor extends JPanel {
                init(mi, ui);\r
        }\r
        */\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
-               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
index 0207577ba36f73a23e25bdf1ff18c401439ad9c8..00dfe719aa2090d883256acb24de71b70303dbe7 100644 (file)
@@ -1,3 +1,15 @@
+/** @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
index 2ad306d1321d00bf9df6f33c2c611d6672efc9db..9a77a53068443b8e332be7792554805ea4368394 100644 (file)
@@ -28,5 +28,5 @@ public interface UI {
        \r
        public String getInput(String message);\r
        \r
-       public String getFilepath(String title);                // necessary ?\r
+       public String getFilepath(String title, int mode);              // necessary ?\r
 }\r