Added Tool Tip Text, fixed dimensions after modifying HelpText to an Area
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Jul 2006 19:00:22 +0000 (19:00 +0000)
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Jul 2006 19:00:22 +0000 (19:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1124 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java

index a94c2b7..778ac09 100644 (file)
@@ -24,6 +24,7 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;\r
 import javax.swing.JScrollPane;\r
 import javax.swing.JTextField;\r
+import javax.swing.JTextArea;\r
 \r
 import org.tianocore.frameworkwizard.common.DataType;\r
 import org.tianocore.frameworkwizard.common.DataValidation;\r
@@ -77,7 +78,9 @@ public class BootModesDlg extends IDialog {
 \r
     private JLabel jLabelHelpText = null;\r
 \r
-    private JTextField jTextFieldHelpText = null;\r
+    private JTextArea jTextAreaHelpText = null;\r
+\r
+    private JScrollPane jScrollPaneHelpText = null;\r
 \r
     private ArchCheckBox jArchCheckBox = null;\r
 \r
@@ -103,6 +106,7 @@ public class BootModesDlg extends IDialog {
             jComboBoxBootModeName = new JComboBox();\r
             jComboBoxBootModeName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
             jComboBoxBootModeName.setPreferredSize(new java.awt.Dimension(320, 20));\r
+            jComboBoxBootModeName.setToolTipText("<html><table><tr><td>FULL</td><td>Boot with full configuration</td></tr><tr><td>MINIMAL</td><td>Boot with minimal configuration</td></tr><tr><td>NO_CHANGE</td><td>Boot assuming no configuration changes</td></tr><tr><td>DIAGNOSTICS</td><td>Boot with full configuration plus diagnostics</td></tr><tr><td>DEFAULT</td><td>Boot with default settings</td></tr><tr><td>BOOT_ON_S#_RESUME</td><td>where # is 2, 3, 4 or 5</td></tr><tr><td>FLASH_UPDATE</td><td>Boot on flash update</td></tr><tr><td>RECOVERY</td><td>Boot in recovery mode</td></tr></table></html>");\r
         }\r
         return jComboBoxBootModeName;\r
     }\r
@@ -118,6 +122,7 @@ public class BootModesDlg extends IDialog {
             jComboBoxUsage = new JComboBox();\r
             jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
             jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
+            jComboBoxUsage.setToolTipText("<html><table><tr><td>ALWAYS_CONSUMED</td><td>Indicates Supports the specified boot mode</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Indicates Supports the specified boot mode on some execution paths</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Always changes the boot mode</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Change the boot mode sometimes</td></tr></table></html>");\r
         }\r
         return jComboBoxUsage;\r
     }\r
@@ -130,7 +135,7 @@ public class BootModesDlg extends IDialog {
     private JTextField getJTextFieldFeatureFlag() {\r
         if (jTextFieldFeatureFlag == null) {\r
             jTextFieldFeatureFlag = new JTextField();\r
-            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 85, 320, 20));\r
+            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));\r
             jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
         }\r
         return jTextFieldFeatureFlag;\r
@@ -150,18 +155,38 @@ public class BootModesDlg extends IDialog {
     }\r
 \r
     /**\r
-     This method initializes jTextFieldHelpText  \r
+     This method initializes jTextAreaHelpText  \r
      \r
-     @return javax.swing.JTextField  \r
+     @return javax.swing.JTextArea  \r
      \r
      **/\r
-    private JTextField getJTextFieldHelpText() {\r
-        if (jTextFieldHelpText == null) {\r
-            jTextFieldHelpText = new JTextField();\r
-            jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
-            jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));\r
+    private JTextArea getJTextAreaHelpText() {\r
+        if (jTextAreaHelpText == null) {\r
+            jTextAreaHelpText = new JTextArea();\r
+            jTextAreaHelpText.setLineWrap(true);\r
+            jTextAreaHelpText.setWrapStyleWord(true);\r
+//            jTextAreaHelpText.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
+//            jTextAreaHelpText.setPreferredSize(new java.awt.Dimension(320, 20));\r
         }\r
-        return jTextFieldHelpText;\r
+        return jTextAreaHelpText;\r
+    }\r
+\r
+    /**\r
+     This method initializes jScrollPaneHelpText  \r
+     \r
+     @return javax.swing.JScrollPane  \r
+     \r
+     **/\r
+    private JScrollPane getJScrollPaneHelpText() {\r
+      if (jScrollPaneHelpText == null) {\r
+        jScrollPaneHelpText = new JScrollPane();\r
+        jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
+        jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));\r
+        jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));\r
+        jScrollPaneHelpText.setLocation(new java.awt.Point(160, 60));\r
+        jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());\r
+      }\r
+      return jScrollPaneHelpText;\r
     }\r
 \r
     /**\r
@@ -173,7 +198,7 @@ public class BootModesDlg extends IDialog {
     private JButton getJButtonOk() {\r
         if (jButtonOk == null) {\r
             jButtonOk = new JButton();\r
-            jButtonOk.setBounds(new java.awt.Rectangle(290, 140, 90, 20));\r
+            jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));\r
             jButtonOk.setText("Ok");\r
             jButtonOk.addActionListener(this);\r
         }\r
@@ -189,7 +214,7 @@ public class BootModesDlg extends IDialog {
     private JButton getJButtonCancel() {\r
         if (jButtonCancel == null) {\r
             jButtonCancel = new JButton();\r
-            jButtonCancel.setBounds(new java.awt.Rectangle(390, 140, 90, 20));\r
+            jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));\r
             jButtonCancel.setText("Cancel");\r
             jButtonCancel.addActionListener(this);\r
         }\r
@@ -204,7 +229,7 @@ public class BootModesDlg extends IDialog {
      \r
      **/\r
     private void init() {\r
-        this.setSize(508, 220);\r
+        this.setSize(500, 230);\r
         this.setContentPane(getJScrollPane());\r
         this.setTitle("Boot Modes");\r
         initFrame();\r
@@ -226,7 +251,7 @@ public class BootModesDlg extends IDialog {
         if (this.id != null) {\r
             this.jComboBoxBootModeName.setSelectedItem(id.getName());\r
             this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
-            this.jTextFieldHelpText.setText(id.getHelp());\r
+            this.jTextAreaHelpText.setText(id.getHelp());\r
             this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r
             this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r
         }\r
@@ -265,37 +290,37 @@ public class BootModesDlg extends IDialog {
      **/\r
     private JPanel getJContentPane() {\r
         if (jContentPane == null) {\r
-            jArchCheckBox = new ArchCheckBox();\r
-            jArchCheckBox.setBounds(new java.awt.Rectangle(160, 110, 320, 20));\r
-            jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jLabelArch = new JLabel();\r
-            jLabelArch.setBounds(new java.awt.Rectangle(15, 110, 140, 20));\r
-            jLabelArch.setText("Arch");\r
-            jLabelFeatureFlag = new JLabel();\r
-            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 85, 140, 20));\r
-            jLabelFeatureFlag.setText("Feature Flag");\r
-            jLabelUsage = new JLabel();\r
-            jLabelUsage.setText("Usage");\r
-            jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 140, 20));\r
+            jStarLabel1 = new StarLabel();\r
+            jStarLabel1.setLocation(new java.awt.Point(2, 10));\r
             jLabelBootModeName = new JLabel();\r
             jLabelBootModeName.setText("Boot Mode Name");\r
-            jLabelBootModeName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));\r
+            jLabelBootModeName.setBounds(new java.awt.Rectangle(15, 10, 145, 20));\r
+            jStarLabel2 = new StarLabel();\r
+            jStarLabel2.setLocation(new java.awt.Point(2, 35));\r
+            jLabelUsage = new JLabel();\r
+            jLabelUsage.setText("Usage");\r
+            jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));\r
             jLabelHelpText = new JLabel();\r
-            jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 140, 20));\r
+            jLabelHelpText.setBounds(new java.awt.Rectangle(15, 60, 145, 20));\r
             jLabelHelpText.setText("Help Text");\r
+            jLabelFeatureFlag = new JLabel();\r
+            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 145, 20));\r
+            jLabelFeatureFlag.setText("Feature Flag");\r
+            jLabelArch = new JLabel();\r
+            jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));\r
+            jLabelArch.setText("Supported Archectures");\r
+            jArchCheckBox = new ArchCheckBox();\r
+            jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));\r
+            jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
 \r
             jContentPane = new JPanel();\r
             jContentPane.setLayout(null);\r
-            jContentPane.setPreferredSize(new java.awt.Dimension(490, 165));\r
+            jContentPane.setPreferredSize(new java.awt.Dimension(485, 185));\r
 \r
             jContentPane.add(jLabelBootModeName, null);\r
             jContentPane.add(getJComboBoxBootModeName(), null);\r
             jContentPane.add(jLabelUsage, null);\r
             jContentPane.add(getJComboBoxUsage(), null);\r
-            jStarLabel1 = new StarLabel();\r
-            jStarLabel1.setLocation(new java.awt.Point(0, 10));\r
-            jStarLabel2 = new StarLabel();\r
-            jStarLabel2.setLocation(new java.awt.Point(0, 35));\r
 \r
             jContentPane.add(jStarLabel1, null);\r
             jContentPane.add(jStarLabel2, null);\r
@@ -304,7 +329,7 @@ public class BootModesDlg extends IDialog {
             jContentPane.add(jLabelArch, null);\r
 \r
             jContentPane.add(jLabelHelpText, null);\r
-            jContentPane.add(getJTextFieldHelpText(), null);\r
+            jContentPane.add(getJScrollPaneHelpText(), null);\r
             jContentPane.add(jArchCheckBox, null);\r
             jContentPane.add(getJButtonOk(), null);\r
             jContentPane.add(getJButtonCancel(), null);\r
@@ -374,7 +399,7 @@ public class BootModesDlg extends IDialog {
 \r
         String arg2 = this.jTextFieldFeatureFlag.getText();\r
         Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();\r
-        String arg4 = this.jTextFieldHelpText.getText();\r
+        String arg4 = this.jTextAreaHelpText.getText();\r
         id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);\r
         return id;\r
     }\r