]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Fix displaying wrong file type bug.
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 Jul 2006 08:10:20 +0000 (08:10 +0000)
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 7 Jul 2006 08:10:20 +0000 (08:10 +0000)
2. Fix a typo bug in Tool Chain Config frame.

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

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/NewFileChooser.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java
Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java

index af4c2a6fc538db4f45e070ebcab766d299c61ecb..c6f5b579739cdde391eb47459dbf924ae31a76f0 100644 (file)
@@ -293,6 +293,15 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     //private JToolBar jToolBarEdit = null;\r
 \r
     //private JToolBar jToolBarWindow = null;\r
+    \r
+    private static FrameworkWizardUI fwui = null;\r
+    \r
+    public static FrameworkWizardUI getInstance() {\r
+        if (fwui == null) {\r
+            fwui = new FrameworkWizardUI();\r
+        }\r
+        return fwui;\r
+    }\r
 \r
     /**\r
      This method initializes jMenuBar \r
@@ -1648,7 +1657,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
      * \r
      */\r
     public static void main(String[] args) {\r
-        FrameworkWizardUI module = new FrameworkWizardUI();\r
+        FrameworkWizardUI module = FrameworkWizardUI.getInstance();\r
         module.setVisible(true);\r
     }\r
 \r
@@ -2885,12 +2894,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
     \r
     **/\r
     private void setupToolChainConfiguration() {\r
-        ToolChainConfig tcc = new ToolChainConfig(this, true);\r
-        int result = tcc.showDialog();\r
-        \r
-        if (result == DataType.RETURN_TYPE_CANCEL) {\r
-            tcc.dispose();\r
-        }\r
+        ToolChainConfig tcc = ToolChainConfig.getInstance();\r
+        tcc.showDialog();\r
     }\r
     \r
     /**\r
index 9924d56a3a2c75e27ba67644221f3a3b0a96e0fc..18cbdb8a8ba2e49c244004577bc73bde4a368446 100644 (file)
@@ -134,7 +134,7 @@ public class NewFileChooser extends IDialog {
     private JRadioButton getJRadioButtonPlatform() {\r
         if (jRadioButtonPlatform == null) {\r
             jRadioButtonPlatform = new JRadioButton();\r
-            jRadioButtonPlatform.setText(DataType.PACKAGE_SURFACE_AREA);\r
+            jRadioButtonPlatform.setText(DataType.PLATFORM_SURFACE_AREA);\r
             jRadioButtonPlatform.setBounds(new java.awt.Rectangle(20, 80, 240, 20));\r
         }\r
         return jRadioButtonPlatform;\r
@@ -171,7 +171,7 @@ public class NewFileChooser extends IDialog {
     private void init() {\r
         this.setSize(310, 220);\r
         this.setContentPane(getJContentPane());\r
-        this.setTitle("New Framework File");\r
+        this.setTitle("Select New File Type");\r
         this.centerWindow();\r
     }\r
 \r
index 6b1731dc0e46c8dead0dd1c4ef4cb8f35b6ac697..7392e373eda7c391079d43742c56b8519ca92cf5 100644 (file)
@@ -271,7 +271,7 @@ public class SelectModuleBelong extends IDialog {
     private void init() {\r
         this.setSize(500, 200);\r
         this.setContentPane(getJContentPane());\r
-        this.setTitle("New Module");\r
+        this.setTitle("New");\r
         this.centerWindow();\r
     }\r
 \r
index 8d0055a4033f5c3f2c8358dfad9473d9be42cfb6..a859339d544a97a8de7c243539112e239d550294 100644 (file)
@@ -15,6 +15,7 @@
 package org.tianocore.frameworkwizard;\r
 \r
 import java.awt.event.ActionEvent;\r
+import java.awt.event.WindowEvent;\r
 import java.io.File;\r
 import java.io.IOException;\r
 \r
@@ -38,11 +39,10 @@ import org.tianocore.frameworkwizard.common.Log;
 import org.tianocore.frameworkwizard.common.Tools;\r
 import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;\r
 import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigVector;\r
-import org.tianocore.frameworkwizard.common.ui.IDialog;\r
 import org.tianocore.frameworkwizard.common.ui.IFrame;\r
 import org.tianocore.frameworkwizard.workspace.Workspace;\r
 \r
-public class ToolChainConfig extends IDialog implements ListSelectionListener, TableModelListener{\r
+public class ToolChainConfig extends IFrame implements ListSelectionListener, TableModelListener{\r
 \r
     ///\r
     /// Define Class Members\r
@@ -86,6 +86,10 @@ public class ToolChainConfig extends IDialog implements ListSelectionListener, T
 \r
     private JButton jButtonHelp = null;\r
     \r
+    private static ToolChainConfig tcc = null;\r
+    \r
+    private ToolChainConfigHelp tcch = null;\r
+    \r
     /**\r
      This method initializes jScrollPane       \r
      \r
@@ -260,12 +264,19 @@ public class ToolChainConfig extends IDialog implements ListSelectionListener, T
         // TODO Auto-generated method stub\r
 \r
     }\r
+    \r
+    public static ToolChainConfig getInstance() {\r
+        if (tcc == null) {\r
+            tcc = new ToolChainConfig();\r
+        }\r
+        return tcc;\r
+    }\r
 \r
     /**\r
      * This is the default constructor\r
      */\r
-    public ToolChainConfig(IFrame parentFrame, boolean modal) {\r
-        super(parentFrame, modal);\r
+    public ToolChainConfig() {\r
+        super();\r
         init();\r
     }\r
 \r
@@ -337,8 +348,7 @@ public class ToolChainConfig extends IDialog implements ListSelectionListener, T
      */\r
     public void actionPerformed(ActionEvent arg0) {\r
         if (arg0.getSource() == jButtonClose) {\r
-            this.setVisible(false);\r
-            this.returnType = DataType.RETURN_TYPE_CANCEL;\r
+            this.exit();\r
         }\r
 \r
         if (arg0.getSource() == jButtonOpen) {\r
@@ -400,7 +410,7 @@ public class ToolChainConfig extends IDialog implements ListSelectionListener, T
         }\r
         \r
         if (arg0.getSource() == jButtonHelp) {\r
-            ToolChainConfigHelp tcch = new ToolChainConfigHelp();\r
+            tcch = ToolChainConfigHelp.getInstance();\r
             tcch.setVisible(true);\r
         }\r
     }\r
@@ -477,4 +487,21 @@ public class ToolChainConfig extends IDialog implements ListSelectionListener, T
             this.vtcc.getToolChainConfigs(row).setValue(m.getValueAt(row, 1).toString());\r
         }\r
     }\r
+    \r
+    /* (non-Javadoc)\r
+     * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r
+     *\r
+     * Override windowClosing to popup warning message to confirm quit\r
+     * \r
+     */\r
+    public void windowClosing(WindowEvent arg0) {\r
+        this.exit();\r
+    }\r
+    \r
+    private void exit() {\r
+        this.setVisible(false);\r
+        if (tcch != null) {\r
+            tcch.dispose();\r
+        }\r
+    }\r
 }\r
index e6bbe16fa6c2fad76accdc9977c7349559390d3f..5d23469c5a7b66a14e01a3c749ebed0ba8fb5de4 100644 (file)
@@ -25,6 +25,8 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
     private JTextPane jTextPane = null;\r
 \r
     private JButton jButtonClose = null;\r
+    \r
+    private static ToolChainConfigHelp tcch = null;\r
 \r
     /**\r
      * This method initializes jTextPane       \r
@@ -38,7 +40,7 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
             jTextPane.setBackground(new java.awt.Color(238,238,238));\r
             jTextPane.setEditable(false);\r
             helpContent = helpContent\r
-            + "The coding forthe Property is: TARGET_TAGNAME_ARCH_COMMAND_ATTR" + DataType.UNIX_LINE_SEPARATOR\r
+            + "The coding for the Property is: TARGET_TAGNAME_ARCH_COMMAND_ATTR" + DataType.UNIX_LINE_SEPARATOR\r
             + "The Value, is either afull path, full path and filename or a reserved word." + DataType.UNIX_LINE_SEPARATOR\r
             + DataType.UNIX_LINE_SEPARATOR\r
             + DataType.UNIX_LINE_SEPARATOR\r
@@ -57,7 +59,6 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
             + "NOTE: The \"*\" symbol may be used as a wildcard character in most of these fields, refer to the tools_def.txt and the \"EDK II Build and Packaging Architecture Specification\" for more details." + DataType.UNIX_LINE_SEPARATOR\r
             + DataType.UNIX_LINE_SEPARATOR;\r
             \r
-            \r
             jTextPane.setText(helpContent);\r
         }\r
         return jTextPane;\r
@@ -78,6 +79,13 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
         return jButtonClose;\r
     }\r
 \r
+    public static ToolChainConfigHelp getInstance() {\r
+        if (tcch == null) {\r
+            tcch = new ToolChainConfigHelp();\r
+        }\r
+        return tcch;\r
+    }\r
+    \r
     /**\r
      \r
      @param args\r
@@ -103,6 +111,7 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
      */\r
     private void initialize() {\r
         this.setSize(625, 520);\r
+        this.setResizable(false);\r
         this.setTitle("How to Setup Tool Chain Configuration");\r
         this.setContentPane(getJContentPane());\r
     }\r
@@ -126,7 +135,5 @@ public class ToolChainConfigHelp extends JFrame implements ActionListener {
         if (arg0.getSource() == jButtonClose) {\r
             this.dispose();\r
         }\r
-        \r
     }\r
-\r
 }\r
index 4778133a41068272ea898c48743152ae49167800..d0222e95741eb5ebe627736dd4aeea059352aeae 100644 (file)
@@ -48,7 +48,7 @@ public class IFrame extends JFrame implements ActionListener, WindowListener {
     // 1 - Whne editing module\r
     //\r
     private int intExitType = 0;\r
-\r
+    \r
     /**\r
      Main class, used for test\r
      \r
@@ -214,4 +214,28 @@ public class IFrame extends JFrame implements ActionListener, WindowListener {
     public int showSaveDialog() {\r
         return JOptionPane.showConfirmDialog(null, "Save all changed files?", "Save", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);\r
     }\r
+    \r
+    /**\r
+    Check the input data is empty or not\r
+    \r
+    @param strValue The input data which need be checked\r
+    \r
+    @retval true - The input data is empty\r
+    @retval fals - The input data is not empty\r
+    \r
+    **/\r
+   public boolean isEmpty(String strValue) {\r
+       if (strValue.length() > 0) {\r
+           return false;\r
+       }\r
+       return true;\r
+   }\r
+   \r
+   /**\r
+    Display the dialog\r
+    \r
+    **/\r
+   public void showDialog() {\r
+       this.setVisible(true);\r
+   }\r
 }\r