Fixed Absolute position of fields, Added ToolTipText and made HelpText a Scrolling...
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Jul 2006 00:17:23 +0000 (00:17 +0000)
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Jul 2006 00:17:23 +0000 (00:17 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1129 6f19259b-4bc3-4df7-8a09-765794883524

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

index 3c00850..d16057b 100644 (file)
@@ -23,6 +23,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
@@ -37,434 +38,475 @@ import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentif
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
- The class is used to create, update Event of MSA/MBD file\r
It extends IInternalFrame\r
\r
- @since ModuleEditor 1.0\r
-\r
- **/\r
+ * The class is used to create, update Event of MSA/MBD file It extends\r
* IInternalFrame\r
+ * \r
@since ModuleEditor 1.0\r
+ * \r
+ */\r
 public class EventsDlg extends IDialog {\r
 \r
-    ///\r
-    /// Define class Serial Version UID\r
-    ///\r
-    private static final long serialVersionUID = -4396143706422842331L;\r
+  // /\r
+  // / Define class Serial Version UID\r
+  // /\r
+  private static final long serialVersionUID = -4396143706422842331L;\r
 \r
-    //\r
-    //Define class members\r
-    //\r
-    private JPanel jContentPane = null;\r
+  //\r
+  // Define class members\r
+  //\r
+  private JPanel jContentPane = null;\r
 \r
-    private JLabel jLabelEventType = null;\r
+  private JLabel jLabelEventType = null;\r
 \r
-    private JLabel jLabelC_Name = null;\r
+  private JLabel jLabelC_Name = null;\r
 \r
-    private JComboBox jComboBoxGuidC_Name = null;\r
+  private JComboBox jComboBoxGuidC_Name = null;\r
 \r
-    private JLabel jLabelUsage = null;\r
-    \r
-    private JLabel jLabelGroup = null;\r
+  private JLabel jLabelUsage = null;\r
 \r
-    private JComboBox jComboBoxUsage = null;\r
-    \r
-    private JComboBox jComboBoxEventGroup = null;\r
+  private JLabel jLabelGroup = null;\r
 \r
-    private StarLabel jStarLabel1 = null;\r
+  private JComboBox jComboBoxUsage = null;\r
 \r
-    private StarLabel jStarLabel2 = null;\r
-    \r
-    private StarLabel jStarLabel3 = null;\r
+  private JComboBox jComboBoxEventGroup = null;\r
 \r
-    private JComboBox jComboBoxEventsType = null;\r
+  private StarLabel jStarLabel1 = null;\r
 \r
-    private JScrollPane jScrollPane = null;\r
+  private StarLabel jStarLabel2 = null;\r
 \r
-    private JLabel jLabelArch = null;\r
+  private StarLabel jStarLabel3 = null;\r
 \r
-    private JLabel jLabelHelpText = null;\r
+  private StarLabel jStarLabel4 = null;\r
 \r
-    private JTextField jTextFieldHelpText = null;\r
+  private JComboBox jComboBoxEventsType = null;\r
 \r
-    private JLabel jLabelFeatureFlag = null;\r
+  private JScrollPane jScrollPane = null;\r
 \r
-    private JTextField jTextFieldFeatureFlag = null;\r
+  private JLabel jLabelArch = null;\r
 \r
-    private ArchCheckBox jArchCheckBox = null;\r
+  private JLabel jLabelHelpText = null;\r
 \r
-    private JButton jButtonOk = null;\r
+  private JTextArea jTextAreaHelpText = null;\r
 \r
-    private JButton jButtonCancel = null;\r
+  private JScrollPane jScrollPaneHelpText = null;\r
 \r
-    //\r
-    // Not used by UI\r
-    //\r
-    private EventsIdentification id = null;\r
-\r
-    private EnumerationData ed = new EnumerationData();\r
-\r
-    private WorkspaceTools wt = new WorkspaceTools();\r
-\r
-    /**\r
-     This method initializes jTextFieldC_Name \r
-     \r
-     @return javax.swing.JTextField jTextFieldC_Name\r
-     \r
-     **/\r
-    private JComboBox getJComboBoxGuidC_Name() {\r
-        if (jComboBoxGuidC_Name == null) {\r
-            jComboBoxGuidC_Name = new JComboBox();\r
-            jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
-            jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Event");\r
-        }\r
-        return jComboBoxGuidC_Name;\r
-    }\r
+  private JLabel jLabelFeatureFlag = null;\r
 \r
-    /**\r
-     This method initializes jComboBoxUsage \r
-     \r
-     @return javax.swing.JComboBox jComboBoxUsage\r
-     \r
-     **/\r
-    private JComboBox getJComboBoxUsage() {\r
-        if (jComboBoxUsage == null) {\r
-            jComboBoxUsage = new JComboBox();\r
-            jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 85, 320, 20));\r
-            jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
-        }\r
-        return jComboBoxUsage;\r
-    }\r
-    \r
-    /**\r
-    This method initializes jComboBoxType \r
-    \r
-    @return javax.swing.JComboBox jComboBoxType\r
-    \r
-    **/\r
-   private JComboBox getJComboBoxEventsType() {\r
-       if (jComboBoxEventsType == null) {\r
-           jComboBoxEventsType = new JComboBox();\r
-           jComboBoxEventsType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
-           jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));\r
-           jComboBoxEventsType\r
-           .setToolTipText("<html>Select CreateEvents if the Module has an event that is waiting to be signaled.<br>Select SignalEvents if the Module will signal all events in an event group.<br>NOTE: Signal events are named by GUID.</html>");\r
-       }\r
-       return jComboBoxEventsType;\r
-   }\r
-\r
-    /**\r
-     * This method initializes jComboBoxEventsType     \r
-     *         \r
-     * @return javax.swing.JComboBox   \r
-     */\r
-    private JComboBox getJComboBoxEventGroup() {\r
-        if (jComboBoxEventGroup == null) {\r
-            jComboBoxEventGroup = new JComboBox();\r
-            jComboBoxEventGroup.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
-            jComboBoxEventGroup.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jComboBoxEventGroup.setToolTipText("Select Type of Event, Guid or Timer.");\r
-            \r
-        }\r
-        return jComboBoxEventGroup;\r
-    }\r
+  private JTextField jTextFieldFeatureFlag = null;\r
 \r
-    /**\r
-     This method initializes jScrollPane  \r
-     \r
-     @return javax.swing.JScrollPane  \r
-     */\r
-    private JScrollPane getJScrollPane() {\r
-        if (jScrollPane == null) {\r
-            jScrollPane = new JScrollPane();\r
-            jScrollPane.setViewportView(getJContentPane());\r
-        }\r
-        return jScrollPane;\r
-    }\r
+  private ArchCheckBox jArchCheckBox = null;\r
 \r
-    /**\r
-     * This method initializes jTextFieldFeatureFlag   \r
-     *         \r
-     * @return javax.swing.JTextField  \r
-     */\r
-    private JTextField getJTextFieldFeatureFlag() {\r
-        if (jTextFieldFeatureFlag == null) {\r
-            jTextFieldFeatureFlag = new JTextField();\r
-            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 135, 320, 20));\r
-            jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
-        }\r
-        return jTextFieldFeatureFlag;\r
-    }\r
+  private JButton jButtonOk = null;\r
 \r
-    /**\r
-     This method initializes jTextFieldHelpText  \r
-     \r
-     @return javax.swing.JTextField  \r
-     \r
-     **/\r
-    private JTextField getJTextFieldHelpText() {\r
-        if (jTextFieldHelpText == null) {\r
-            jTextFieldHelpText = new JTextField();\r
-            jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 110, 320, 20));\r
-            jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));\r
-        }\r
-        return jTextFieldHelpText;\r
-    }\r
+  private JButton jButtonCancel = null;\r
 \r
-    /**\r
-     This method initializes jButtonOk    \r
-     \r
-     @return javax.swing.JButton  \r
-     \r
-     **/\r
-    private JButton getJButtonOk() {\r
-        if (jButtonOk == null) {\r
-            jButtonOk = new JButton();\r
-            jButtonOk.setBounds(new java.awt.Rectangle(290, 190, 90, 20));\r
-            jButtonOk.setText("Ok");\r
-            jButtonOk.addActionListener(this);\r
-        }\r
-        return jButtonOk;\r
-    }\r
+  //\r
+  // Not used by UI\r
+  //\r
+  private EventsIdentification id = null;\r
 \r
-    /**\r
-     This method initializes jButtonCancel    \r
-     \r
-     @return javax.swing.JButton  \r
-     \r
-     **/\r
-    private JButton getJButtonCancel() {\r
-        if (jButtonCancel == null) {\r
-            jButtonCancel = new JButton();\r
-            jButtonCancel.setBounds(new java.awt.Rectangle(390, 190, 90, 20));\r
-            jButtonCancel.setText("Cancel");\r
-            jButtonCancel.addActionListener(this);\r
-        }\r
-        return jButtonCancel;\r
-    }\r
+  private EnumerationData ed = new EnumerationData();\r
 \r
-    public static void main(String[] args) {\r
+  private WorkspaceTools wt = new WorkspaceTools();\r
 \r
+  /**\r
+   * This method initializes jComboBoxType\r
+   * \r
+   * @return javax.swing.JComboBox jComboBoxType\r
+   * \r
+   */\r
+  private JComboBox getJComboBoxEventsType() {\r
+    if (jComboBoxEventsType == null) {\r
+      jComboBoxEventsType = new JComboBox();\r
+      jComboBoxEventsType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
+      jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxEventsType\r
+          .setToolTipText("<html>Select CreateEvents if the Module has an event that is waiting to be signaled.<br>Select SignalEvents if the Module will signal all events in an event group.<br>NOTE: Signal events are named by GUID.</html>");\r
     }\r
-\r
-    /**\r
-     This method initializes this\r
-     \r
-     **/\r
-    private void init() {\r
-        this.setSize(508, 265);\r
-        this.setContentPane(getJScrollPane());\r
-        this.setTitle("Events");\r
-        initFrame();\r
-        this.setViewMode(false);\r
-        this.centerWindow();\r
+    return jComboBoxEventsType;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jTextFieldC_Name\r
+   * \r
+   * @return javax.swing.JTextField jTextFieldC_Name\r
+   * \r
+   */\r
+  private JComboBox getJComboBoxGuidC_Name() {\r
+    if (jComboBoxGuidC_Name == null) {\r
+      jComboBoxGuidC_Name = new JComboBox();\r
+      jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
+      jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Event");\r
     }\r
+    return jComboBoxGuidC_Name;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jComboBoxEventsType\r
+   * \r
+   * @return javax.swing.JComboBox\r
+   */\r
+  private JComboBox getJComboBoxEventGroup() {\r
+    if (jComboBoxEventGroup == null) {\r
+      jComboBoxEventGroup = new JComboBox();\r
+      jComboBoxEventGroup.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
+      jComboBoxEventGroup.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxEventGroup\r
+          .setToolTipText("Select Type of Event: Guid or Timer.");\r
 \r
-    /**\r
-     This method initializes this\r
-     Fill values to all fields if these values are not empty\r
-     \r
-     @param inEventsId\r
-\r
-     **/\r
-    private void init(EventsIdentification inEventsId) {\r
-        init();\r
-        this.id = inEventsId;\r
-\r
-        if (this.id != null) {\r
-            this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
-            this.jComboBoxEventsType.setSelectedItem(id.getType());\r
-            this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
-            this.jTextFieldHelpText.setText(id.getHelp());\r
-\r
-            jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r
-            this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r
-            this.jComboBoxEventGroup.setSelectedItem(id.getGroup());\r
-        }\r
     }\r
-\r
-    /**\r
-     This is the override edit constructor\r
-     \r
-     @param inEventsIdentification\r
-     @param iFrame\r
-     \r
-     **/\r
-    public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame) {\r
-        super(iFrame, true);\r
-        init(inEventsIdentification);\r
+    return jComboBoxEventGroup;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jComboBoxUsage\r
+   * \r
+   * @return javax.swing.JComboBox jComboBoxUsage\r
+   * \r
+   */\r
+  private JComboBox getJComboBoxUsage() {\r
+    if (jComboBoxUsage == null) {\r
+      jComboBoxUsage = new JComboBox();\r
+      jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 85, 320, 20));\r
+      jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxUsage\r
+          .setToolTipText("<html><table><tr><td colspan=2 align=center><b>Create Events</b></td></tr><tr><td>ALWAYS_CONSUMED</td><td>Module registers a notification function and REQUIRES that it be<br>executed for the module to fully function.</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module registers a notification function and calls the function<br>when it is signaled</td></tr><tr><td colspan=2 align=center><b>Signal Events</b></td></tr><tr><td>ALWAYS_PRODUCED</td><td>Module will Always signal the event</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes signal the event</td></tr></table></html>");\r
     }\r
-\r
-    /**\r
-     Disable all components when the mode is view\r
-     \r
-     @param isView true - The view mode; false - The non-view mode\r
-     \r
-     **/\r
-    public void setViewMode(boolean isView) {\r
-        if (isView) {\r
-            this.jComboBoxGuidC_Name.setEnabled(!isView);\r
-            this.jComboBoxUsage.setEnabled(!isView);\r
-        }\r
+    return jComboBoxUsage;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jScrollPane\r
+   * \r
+   * @return javax.swing.JScrollPane\r
+   */\r
+  private JScrollPane getJScrollPane() {\r
+    if (jScrollPane == null) {\r
+      jScrollPane = new JScrollPane();\r
+      jScrollPane.setViewportView(getJContentPane());\r
     }\r
-\r
-    /**\r
-     This method initializes jContentPane\r
-     \r
-     @return javax.swing.JPanel jContentPane\r
-     \r
-     **/\r
-    private JPanel getJContentPane() {\r
-        if (jContentPane == null) {\r
-            jArchCheckBox = new ArchCheckBox();\r
-            jArchCheckBox.setBounds(new java.awt.Rectangle(160, 160, 320, 20));\r
-            jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jLabelFeatureFlag = new JLabel();\r
-            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 135, 140, 20));\r
-            jLabelFeatureFlag.setText("Feature Flag");\r
-            jLabelArch = new JLabel();\r
-            jLabelArch.setBounds(new java.awt.Rectangle(15, 160, 140, 20));\r
-            jLabelArch.setText("Arch");\r
-            jLabelUsage = new JLabel();\r
-            jLabelUsage.setText("Usage");\r
-            jLabelUsage.setBounds(new java.awt.Rectangle(15, 85, 140, 20));\r
-            jLabelC_Name = new JLabel();\r
-            jLabelC_Name.setText("Guid C Name");\r
-            jLabelC_Name.setBounds(new java.awt.Rectangle(15, 35, 140, 20));\r
-            jLabelGroup = new JLabel();\r
-            jLabelGroup.setText("Event Type");\r
-            jLabelGroup.setBounds(new java.awt.Rectangle(15, 60, 140, 20));\r
-            jLabelEventType = new JLabel();\r
-            jLabelEventType.setText("Type");\r
-            jLabelEventType.setBounds(new java.awt.Rectangle(15, 10, 140, 20));\r
-            jLabelHelpText = new JLabel();\r
-            jLabelHelpText.setBounds(new java.awt.Rectangle(14, 110, 140, 20));\r
-            jLabelHelpText.setText("Help Text");\r
-\r
-            jContentPane = new JPanel();\r
-            jContentPane.setLayout(null);\r
-            jContentPane.setPreferredSize(new java.awt.Dimension(490, 220));\r
-\r
-            jContentPane.add(jLabelEventType, null);\r
-            jContentPane.add(jLabelGroup, null);\r
-            jContentPane.add(jLabelC_Name, null);\r
-            jContentPane.add(getJComboBoxGuidC_Name(), null);\r
-            jContentPane.add(jLabelUsage, null);\r
-            jContentPane.add(getJComboBoxUsage(), null);\r
-            jStarLabel1 = new StarLabel();\r
-            jStarLabel1.setBounds(new java.awt.Rectangle(0, 10, 10, 20));\r
-            jStarLabel2 = new StarLabel();\r
-            jStarLabel2.setBounds(new java.awt.Rectangle(0, 35, 10, 20));\r
-            jStarLabel3 = new StarLabel();\r
-            jStarLabel3.setBounds(new java.awt.Rectangle(0, 60, 10, 20));\r
-            \r
-            jContentPane.add(jStarLabel1, null);\r
-            jContentPane.add(jStarLabel2, null);\r
-            jContentPane.add(jStarLabel3, null);\r
-            jContentPane.add(getJComboBoxEventsType(), null);\r
-\r
-            jContentPane.add(jLabelArch, null);\r
-            jContentPane.add(jLabelFeatureFlag, null);\r
-            jContentPane.add(getJTextFieldFeatureFlag(), null);\r
-            jContentPane.add(jLabelHelpText, null);\r
-            jContentPane.add(getJTextFieldHelpText(), null);\r
-            jContentPane.add(jArchCheckBox, null);\r
-            jContentPane.add(getJButtonOk(), null);\r
-            jContentPane.add(getJButtonCancel(), null);\r
-            jContentPane.add(getJComboBoxEventGroup(), null);\r
-        }\r
-        return jContentPane;\r
+    return jScrollPane;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jTextFieldFeatureFlag\r
+   * \r
+   * @return javax.swing.JTextField\r
+   */\r
+  private JTextField getJTextFieldFeatureFlag() {\r
+    if (jTextFieldFeatureFlag == null) {\r
+      jTextFieldFeatureFlag = new JTextField();\r
+      jTextFieldFeatureFlag\r
+          .setBounds(new java.awt.Rectangle(160, 155, 320, 20));\r
+      jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jTextFieldFeatureFlag\r
+          .setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r
     }\r
-\r
-    /**\r
-     This method initializes events groups and usage type\r
-     \r
-     **/\r
-    private void initFrame() {\r
-        Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());\r
-        Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());\r
-        Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());\r
-        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
+    return jTextFieldFeatureFlag;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jTextAreaHelpText\r
+   * \r
+   * @return javax.swing.JTextArea\r
+   * \r
+   */\r
+  private JTextArea getJTextAreaHelpText() {\r
+    if (jTextAreaHelpText == null) {\r
+      jTextAreaHelpText = new JTextArea();\r
+      jTextAreaHelpText.setLineWrap(true);\r
+      jTextAreaHelpText.setWrapStyleWord(true);\r
+    }\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,110));\r
+      jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());\r
+    }\r
+    return jScrollPaneHelpText;\r
+  }\r
+  \r
+  /**\r
+   * This method initializes jButtonOk\r
+   * \r
+   * @return javax.swing.JButton\r
+   * \r
+   */\r
+  private JButton getJButtonOk() {\r
+    if (jButtonOk == null) {\r
+      jButtonOk = new JButton();\r
+      jButtonOk.setBounds(new java.awt.Rectangle(290, 202, 90, 20));\r
+      jButtonOk.setText("Ok");\r
+      jButtonOk.addActionListener(this);\r
+    }\r
+    return jButtonOk;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jButtonCancel\r
+   * \r
+   * @return javax.swing.JButton\r
+   * \r
+   */\r
+  private JButton getJButtonCancel() {\r
+    if (jButtonCancel == null) {\r
+      jButtonCancel = new JButton();\r
+      jButtonCancel.setBounds(new java.awt.Rectangle(390, 202, 90, 20));\r
+      jButtonCancel.setText("Cancel");\r
+      jButtonCancel.addActionListener(this);\r
+    }\r
+    return jButtonCancel;\r
+  }\r
+\r
+  public static void main(String[] args) {\r
+\r
+  }\r
+\r
+  /**\r
+   * This method initializes this\r
+   * \r
+   */\r
+  private void init() {\r
+    this.setSize(500, 275);\r
+    this.setContentPane(getJScrollPane());\r
+    this.setTitle("Events");\r
+    initFrame();\r
+    this.setViewMode(false);\r
+    this.centerWindow();\r
+  }\r
+\r
+  /**\r
+   * This method initializes this Fill values to all fields if these values are\r
+   * not empty\r
+   * \r
+   * @param inEventsId\r
+   * \r
+   */\r
+  private void init(EventsIdentification inEventsId) {\r
+    init();\r
+    this.id = inEventsId;\r
+\r
+    if (this.id != null) {\r
+      this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
+      this.jComboBoxEventsType.setSelectedItem(id.getType());\r
+      this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
+      this.jTextAreaHelpText.setText(id.getHelp());\r
+\r
+      jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r
+      this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r
+      this.jComboBoxEventGroup.setSelectedItem(id.getGroup());\r
+    }\r
+  }\r
+\r
+  /**\r
+   * This is the override edit constructor\r
+   * \r
+   * @param inEventsIdentification\r
+   * @param iFrame\r
+   * \r
+   */\r
+  public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame) {\r
+    super(iFrame, true);\r
+    init(inEventsIdentification);\r
+  }\r
+\r
+  /**\r
+   * Disable all components when the mode is view\r
+   * \r
+   * @param isView\r
+   *          true - The view mode; false - The non-view mode\r
+   * \r
+   */\r
+  public void setViewMode(boolean isView) {\r
+    if (isView) {\r
+      this.jComboBoxGuidC_Name.setEnabled(!isView);\r
+      this.jComboBoxUsage.setEnabled(!isView);\r
     }\r
+  }\r
+\r
+  /**\r
+   * This method initializes jContentPane\r
+   * \r
+   * @return javax.swing.JPanel jContentPane\r
+   * \r
+   */\r
+  private JPanel getJContentPane() {\r
+    if (jContentPane == null) {\r
+      jStarLabel1 = new StarLabel();\r
+      jStarLabel1.setLocation(new java.awt.Point(2, 10));\r
+      jLabelEventType = new JLabel();\r
+      jLabelEventType.setText("Type");\r
+      jLabelEventType.setBounds(new java.awt.Rectangle(15, 10, 145, 20));\r
+\r
+      jStarLabel2 = new StarLabel();\r
+      jStarLabel2.setLocation(new java.awt.Point(2, 35));\r
+      jLabelC_Name = new JLabel();\r
+      jLabelC_Name.setText("Guid C Name");\r
+      jLabelC_Name.setBounds(new java.awt.Rectangle(15, 35, 145, 20));\r
+\r
+      jStarLabel3 = new StarLabel();\r
+      jStarLabel3.setLocation(new java.awt.Point(2, 60));\r
+      jLabelGroup = new JLabel();\r
+      jLabelGroup.setText("Event Type");\r
+      jLabelGroup.setBounds(new java.awt.Rectangle(15, 60, 145, 20));\r
+\r
+      jStarLabel4 = new StarLabel();\r
+      jStarLabel4.setLocation(new java.awt.Point(2, 85));\r
+      jLabelUsage = new JLabel();\r
+      jLabelUsage.setText("Usage");\r
+      jLabelUsage.setBounds(new java.awt.Rectangle(15, 85, 140, 20));\r
+\r
+      jLabelHelpText = new JLabel();\r
+      jLabelHelpText.setBounds(new java.awt.Rectangle(15, 110, 145, 20));\r
+      jLabelHelpText.setText("Help Text");\r
+\r
+      jLabelFeatureFlag = new JLabel();\r
+      jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 155, 145, 20));\r
+      jLabelFeatureFlag.setText("Feature Flag");\r
+\r
+      jLabelArch = new JLabel();\r
+      jLabelArch.setBounds(new java.awt.Rectangle(15, 180, 145, 20));\r
+      jLabelArch.setText("Arch");\r
+      jArchCheckBox = new ArchCheckBox();\r
+      jArchCheckBox.setBounds(new java.awt.Rectangle(160, 180, 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(485, 230));\r
+\r
+      jContentPane.add(jStarLabel1, null);\r
+      jContentPane.add(jLabelEventType, null);\r
+      jContentPane.add(getJComboBoxEventsType(), null);\r
+      jContentPane.add(jStarLabel2, null);\r
+      jContentPane.add(jLabelC_Name, null);\r
+      jContentPane.add(getJComboBoxGuidC_Name(), null);\r
+      jContentPane.add(jStarLabel3, null);\r
+      jContentPane.add(jLabelGroup, null);\r
+      jContentPane.add(getJComboBoxEventGroup(), null);\r
+      jContentPane.add(jStarLabel4, null);\r
+      jContentPane.add(jLabelUsage, null);\r
+      jContentPane.add(getJComboBoxUsage(), null);\r
+      jContentPane.add(jLabelHelpText, null);\r
+      jContentPane.add(getJScrollPaneHelpText(), null);\r
+      jContentPane.add(jLabelFeatureFlag, null);\r
+      jContentPane.add(getJTextFieldFeatureFlag(), null);\r
+      jContentPane.add(jLabelArch, null);\r
+      jContentPane.add(jArchCheckBox, null);\r
+      jContentPane.add(getJButtonOk(), null);\r
+      jContentPane.add(getJButtonCancel(), null);\r
 \r
-    /* (non-Javadoc)\r
-     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
-     *\r
-     * Override actionPerformed to listen all actions\r
-     * \r
-     */\r
-    public void actionPerformed(ActionEvent arg0) {\r
-        if (arg0.getSource() == jButtonOk) {\r
-            if (checkAdd()) {\r
-                getCurrentEvents();\r
-                this.returnType = DataType.RETURN_TYPE_OK;\r
-                this.setVisible(false);\r
-            }\r
-        }\r
-\r
-        if (arg0.getSource() == jButtonCancel) {\r
-            this.returnType = DataType.RETURN_TYPE_CANCEL;\r
-            this.setVisible(false);\r
-        }\r
+    }\r
+    return jContentPane;\r
+  }\r
+\r
+  /**\r
+   * This method initializes events groups and usage type\r
+   * \r
+   */\r
+  private void initFrame() {\r
+    Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());\r
+    Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());\r
+    Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());\r
+    Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt\r
+        .getAllGuidDeclarationsFromWorkspace());\r
+  }\r
+\r
+  /*\r
+   * (non-Javadoc)\r
+   * \r
+   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
+   * \r
+   * Override actionPerformed to listen all actions\r
+   * \r
+   */\r
+  public void actionPerformed(ActionEvent arg0) {\r
+    if (arg0.getSource() == jButtonOk) {\r
+      if (checkAdd()) {\r
+        getCurrentEvents();\r
+        this.returnType = DataType.RETURN_TYPE_OK;\r
+        this.setVisible(false);\r
+      }\r
     }\r
 \r
-    /**\r
-     Data validation for all fields\r
-     \r
-     @retval true - All datas are valid\r
-     @retval false - At least one data is invalid\r
-     \r
-     **/\r
-    public boolean checkAdd() {\r
-        //\r
-        // Check if all fields have correct data types \r
-        //\r
-\r
-        //\r
-        // Check Name \r
-        //\r
-        if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-            Log.wrn("Update Events", "Event Name couldn't be empty");\r
-            return false;\r
-        }\r
-\r
-        if (!isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-            if (!DataValidation.isC_NameType(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
-                Log.wrn("Update Events", "Incorrect data type for Event Name");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        //\r
-        // Check FeatureFlag\r
-        //\r
-        if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r
-            if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r
-                Log.wrn("Update Events", "Incorrect data type for Feature Flag");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        return true;\r
+    if (arg0.getSource() == jButtonCancel) {\r
+      this.returnType = DataType.RETURN_TYPE_CANCEL;\r
+      this.setVisible(false);\r
     }\r
+  }\r
+\r
+  /**\r
+   * Data validation for all fields\r
+   * \r
+   * @retval true - All datas are valid\r
+   * @retval false - At least one data is invalid\r
+   * \r
+   */\r
+  public boolean checkAdd() {\r
+    //\r
+    // Check if all fields have correct data types\r
+    //\r
 \r
-    private EventsIdentification getCurrentEvents() {\r
-        String arg0 = this.jComboBoxGuidC_Name.getSelectedItem().toString();\r
-        String arg1 = this.jComboBoxEventsType.getSelectedItem().toString();\r
-        String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r
-\r
-        String arg3 = this.jTextFieldFeatureFlag.getText();\r
-        Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();\r
-        String arg5 = this.jTextFieldHelpText.getText();\r
-        String arg6 = this.jComboBoxEventGroup.getSelectedItem().toString();\r
-        id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\r
-        return id;\r
+    //\r
+    // Check Name\r
+    //\r
+    if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
+      Log.wrn("Update Events", "Event Name couldn't be empty");\r
+      return false;\r
     }\r
 \r
-    public EventsIdentification getId() {\r
-        return id;\r
+    if (!isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
+      if (!DataValidation.isC_NameType(this.jComboBoxGuidC_Name\r
+          .getSelectedItem().toString())) {\r
+        Log.wrn("Update Events", "Incorrect data type for Event Name");\r
+        return false;\r
+      }\r
     }\r
 \r
-    public void setId(EventsIdentification id) {\r
-        this.id = id;\r
+    //\r
+    // Check FeatureFlag\r
+    //\r
+    if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r
+      if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r
+        Log.wrn("Update Events", "Incorrect data type for Feature Flag");\r
+        return false;\r
+      }\r
     }\r
+\r
+    return true;\r
+  }\r
+\r
+  private EventsIdentification getCurrentEvents() {\r
+    String arg0 = this.jComboBoxGuidC_Name.getSelectedItem().toString();\r
+    String arg1 = this.jComboBoxEventsType.getSelectedItem().toString();\r
+    String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r
+\r
+    String arg3 = this.jTextFieldFeatureFlag.getText();\r
+    Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();\r
+    String arg5 = this.jTextAreaHelpText.getText();\r
+    String arg6 = this.jComboBoxEventGroup.getSelectedItem().toString();\r
+    id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);\r
+    return id;\r
+  }\r
+  \r
+  public EventsIdentification getId() {\r
+    return id;\r
+  }\r
+\r
+  public void setId(EventsIdentification id) {\r
+    this.id = id;\r
+  }\r
 }\r
index 6a794f4..5e171ed 100644 (file)
@@ -26,6 +26,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
@@ -40,413 +41,459 @@ import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsI
 import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
- The class is used to create, update Protocol of MSA/MBD file\r
- It extends IInternalFrame\r
\r
+ * The class is used to create, update Protocol of MSA/MBD file \r
+ * It extends JDialog\r
+ * \r
+ */\r
+public class ProtocolsDlg extends IDialog implements ItemListener {\r
 \r
+  // /\r
+  // / Define class Serial Version UID\r
+  // /\r
+  private static final long serialVersionUID = -9084913640747858848L;\r
 \r
- **/\r
-public class ProtocolsDlg extends IDialog implements ItemListener {\r
+  //\r
+  // Define class members\r
+  //\r
+  private JPanel jContentPane = null;\r
 \r
-    ///\r
-    /// Define class Serial Version UID\r
-    ///\r
-    private static final long serialVersionUID = -9084913640747858848L;\r
+  private JLabel jLabelC_Name = null;\r
 \r
-    //\r
-    //Define class members\r
-    //\r
-    private JPanel jContentPane = null;\r
+  private JLabel jLabelFeatureFlag = null;\r
 \r
-    private JLabel jLabelC_Name = null;\r
+  private JTextField jTextFieldFeatureFlag = null;\r
 \r
-    private JLabel jLabelFeatureFlag = null;\r
+  private JLabel jLabelUsage = null;\r
 \r
-    private JTextField jTextFieldFeatureFlag = null;\r
+  private JComboBox jComboBoxUsage = null;\r
 \r
-    private JLabel jLabelUsage = null;\r
+  private StarLabel jStarLabel1 = null;\r
 \r
-    private JComboBox jComboBoxUsage = null;\r
+  private StarLabel jStarLabel2 = null;\r
 \r
-    private StarLabel jStarLabel1 = null;\r
+  private StarLabel jStarLabel3 = null;\r
 \r
-    private StarLabel jStarLabel2 = null;\r
+  private JLabel jLabelProtocolType = null;\r
 \r
-    private JLabel jLabelProtocolType = null;\r
+  private JLabel jLabelArch = null;\r
 \r
-    private JLabel jLabelArch = null;\r
+  private JScrollPane jScrollPane = null;\r
 \r
-    private JScrollPane jScrollPane = null;\r
+  private JComboBox jComboBoxProtocolType = null;\r
 \r
-    private JComboBox jComboBoxProtocolType = null;\r
+  private JComboBox jComboBoxCName = null;\r
 \r
-    private JComboBox jComboBoxCName = null;\r
+  private JLabel jLabelHelpText = null;\r
 \r
-    private JLabel jLabelHelpText = null;\r
+  private JTextArea jTextAreaHelpText = null;\r
 \r
-    private JTextField jTextFieldHelpText = null;\r
+  private JScrollPane jScrollPaneHelpText = null;\r
 \r
-    private ArchCheckBox jArchCheckBox = null;\r
-    \r
-    private JButton jButtonOk = null;\r
+  private ArchCheckBox jArchCheckBox = null;\r
 \r
-    private JButton jButtonCancel = null;\r
+  private JButton jButtonOk = null;\r
 \r
-    //\r
-    // Not used by UI\r
-    //\r
-    private ProtocolsIdentification id = null;\r
-\r
-    private WorkspaceTools wt = new WorkspaceTools();\r
-\r
-    private EnumerationData ed = new EnumerationData();\r
-\r
-    /**\r
-     This method initializes jTextFieldFeatureFlag \r
-     \r
-     @return javax.swing.JTextField jTextFieldFeatureFlag\r
-     \r
-     **/\r
-    private JTextField getJTextFieldFeatureFlag() {\r
-        if (jTextFieldFeatureFlag == null) {\r
-            jTextFieldFeatureFlag = new JTextField();\r
-            jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 110, 320, 20));\r
-            jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
-        }\r
-        return jTextFieldFeatureFlag;\r
-    }\r
+  private JButton jButtonCancel = null;\r
 \r
-    /**\r
-     This method initializes jComboBoxUsage \r
-     \r
-     @return javax.swing.JComboBox jComboBoxUsage\r
-     \r
-     **/\r
-    private JComboBox getJComboBoxProtocolUsage() {\r
-        if (jComboBoxUsage == null) {\r
-            jComboBoxUsage = new JComboBox();\r
-            jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
-            jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jComboBoxUsage.setToolTipText("ALWAYS_CONSUMED is the only valid usage for type ProtocolNotify.");\r
-        }\r
-        return jComboBoxUsage;\r
-    }\r
+  //\r
+  // Not used by UI\r
+  //\r
+  private ProtocolsIdentification id = null;\r
 \r
-    /**\r
-     This method initializes jScrollPane  \r
-     \r
-     @return javax.swing.JScrollPane  \r
-     */\r
-    private JScrollPane getJScrollPane() {\r
-        if (jScrollPane == null) {\r
-            jScrollPane = new JScrollPane();\r
-            jScrollPane.setViewportView(getJContentPane());\r
-        }\r
-        return jScrollPane;\r
-    }\r
+  private WorkspaceTools wt = new WorkspaceTools();\r
 \r
-    /**\r
-     * This method initializes jComboBoxProtocolType   \r
-     *         \r
-     * @return javax.swing.JComboBox   \r
-     */\r
-    private JComboBox getJComboBoxProtocolType() {\r
-        if (jComboBoxProtocolType == null) {\r
-            jComboBoxProtocolType = new JComboBox();\r
-            jComboBoxProtocolType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
-            jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jComboBoxProtocolType.addItemListener(this);\r
-            jComboBoxProtocolType.setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");\r
-        }\r
-        return jComboBoxProtocolType;\r
-    }\r
+  private EnumerationData ed = new EnumerationData();\r
 \r
-    /**\r
-     * This method initializes jComboBoxCName  \r
-     *         \r
-     * @return javax.swing.JComboBox   \r
-     */\r
-    private JComboBox getJComboBoxCName() {\r
-        if (jComboBoxCName == null) {\r
-            jComboBoxCName = new JComboBox();\r
-            jComboBoxCName.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
-            jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");\r
-\r
-        }\r
-        return jComboBoxCName;\r
+  /**\r
+   * This method initializes jTextFieldFeatureFlag\r
+   * \r
+   * @return javax.swing.JTextField jTextFieldFeatureFlag\r
+   * \r
+   */\r
+  private JTextField getJTextFieldFeatureFlag() {\r
+    if (jTextFieldFeatureFlag == null) {\r
+      jTextFieldFeatureFlag = new JTextField();\r
+      jTextFieldFeatureFlag\r
+          .setBounds(new java.awt.Rectangle(160, 130, 320, 20));\r
+      jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jTextFieldFeatureFlag\r
+          .setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r
     }\r
-\r
-    /**\r
-     This method initializes jTextFieldHelpText  \r
-     \r
-     @return javax.swing.JTextField  \r
-     \r
-     **/\r
-    private JTextField getJTextFieldHelpText() {\r
-        if (jTextFieldHelpText == null) {\r
-            jTextFieldHelpText = new JTextField();\r
-            jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 85, 320, 20));\r
-            jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));\r
-        }\r
-        return jTextFieldHelpText;\r
+    return jTextFieldFeatureFlag;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jComboBoxUsage\r
+   * \r
+   * @return javax.swing.JComboBox jComboBoxUsage\r
+   * \r
+   */\r
+  private JComboBox getJComboBoxProtocolUsage() {\r
+    if (jComboBoxUsage == null) {\r
+      jComboBoxUsage = new JComboBox();\r
+      jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
+      jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxUsage\r
+          .setToolTipText("<html><table><tr><td colspan=2>Protocol</td></tr><tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the protocol</td></tr><tr><td>SOMETIMES_CONSUMES</td><td>Module sometimes consumes the protocol</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces the protocol</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Module sometimes produces the protocol</td></tr><tr><td>TO_START</td><td>The protocol is consumed by a Driver Binding protocol <b>Start</b><br>function.  The protocol is used in EFI 1.10 driver model</td></tr><tr><td>BY_START</td><td>Protocol is produced by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr><tr><td colspan=2>Protocol Notify</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module will consume the protocol if it is produced.<br>Consumption is defined by executing the protocol notify<br>function.</td></tr></table></html>");\r
     }\r
-\r
-    /**\r
-     This method initializes jButtonOk    \r
-     \r
-     @return javax.swing.JButton  \r
-     \r
-     **/\r
-    private JButton getJButtonOk() {\r
-        if (jButtonOk == null) {\r
-            jButtonOk = new JButton();\r
-            jButtonOk.setBounds(new java.awt.Rectangle(290, 165, 90, 20));\r
-            jButtonOk.setText("Ok");\r
-            jButtonOk.addActionListener(this);\r
-        }\r
-        return jButtonOk;\r
+    return jComboBoxUsage;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jScrollPane\r
+   * \r
+   * @return javax.swing.JScrollPane\r
+   */\r
+  private JScrollPane getJScrollPane() {\r
+    if (jScrollPane == null) {\r
+      jScrollPane = new JScrollPane();\r
+      jScrollPane.setViewportView(getJContentPane());\r
     }\r
-\r
-    /**\r
-     This method initializes jButtonCancel    \r
-     \r
-     @return javax.swing.JButton  \r
-     \r
-     **/\r
-    private JButton getJButtonCancel() {\r
-        if (jButtonCancel == null) {\r
-            jButtonCancel = new JButton();\r
-            jButtonCancel.setBounds(new java.awt.Rectangle(390, 165, 90, 20));\r
-            jButtonCancel.setText("Cancel");\r
-            jButtonCancel.addActionListener(this);\r
-        }\r
-        return jButtonCancel;\r
+    return jScrollPane;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jComboBoxProtocolType\r
+   * \r
+   * @return javax.swing.JComboBox\r
+   */\r
+  private JComboBox getJComboBoxProtocolType() {\r
+    if (jComboBoxProtocolType == null) {\r
+      jComboBoxProtocolType = new JComboBox();\r
+      jComboBoxProtocolType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
+      jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxProtocolType.addItemListener(this);\r
+      jComboBoxProtocolType\r
+          .setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");\r
     }\r
-\r
-    public static void main(String[] args) {\r
+    return jComboBoxProtocolType;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jComboBoxCName\r
+   * \r
+   * @return javax.swing.JComboBox\r
+   */\r
+  private JComboBox getJComboBoxCName() {\r
+    if (jComboBoxCName == null) {\r
+      jComboBoxCName = new JComboBox();\r
+      jComboBoxCName.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
+      jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));\r
+      jComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");\r
 \r
     }\r
-\r
-    /**\r
-     This method initializes this\r
-     \r
-     **/\r
-    private void init() {\r
-        this.setSize(510, 240);\r
-        this.setContentPane(getJScrollPane());\r
-        this.setTitle("Protocols");\r
-        initFrame();\r
-        this.setViewMode(false);\r
-        this.centerWindow();\r
+    return jComboBoxCName;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jTextAreaHelpText\r
+   * \r
+   * @return javax.swing.JTextArea\r
+   * \r
+   */\r
+  private JTextArea getJTextAreaHelpText() {\r
+    if (jTextAreaHelpText == null) {\r
+      jTextAreaHelpText = new JTextArea();\r
+      jTextAreaHelpText.setLineWrap(true);\r
+      jTextAreaHelpText.setWrapStyleWord(true);\r
     }\r
-\r
-    /**\r
-     This method initializes this\r
-     Fill values to all fields if these values are not empty\r
-     \r
-     @param inProtocolsId\r
-\r
-     **/\r
-    private void init(ProtocolsIdentification inProtocolsId) {\r
-        init();\r
-        this.id = inProtocolsId;\r
-\r
-        if (this.id != null) {\r
-            this.jComboBoxCName.setSelectedItem(id.getName());\r
-            this.jComboBoxProtocolType.setSelectedItem(id.getType());\r
-            this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
-            this.jTextFieldHelpText.setText(id.getHelp());\r
-\r
-            jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r
-            this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r
-        }\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\r
+          .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, 85));\r
+      jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());\r
     }\r
-\r
-    /**\r
-     This is the override edit constructor\r
-     \r
-     @param inProtocolsIdentification\r
-     @param iFrame\r
-     \r
-     **/\r
-    public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame) {\r
-        super(iFrame, true);\r
-        init(inProtocolsIdentification);\r
+    return jScrollPaneHelpText;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jButtonOk\r
+   * \r
+   * @return javax.swing.JButton\r
+   * \r
+   */\r
+  private JButton getJButtonOk() {\r
+    if (jButtonOk == null) {\r
+      jButtonOk = new JButton();\r
+      jButtonOk.setBounds(new java.awt.Rectangle(290, 182, 90, 20));\r
+      jButtonOk.setText("Ok");\r
+      jButtonOk.addActionListener(this);\r
     }\r
-\r
-    /**\r
-     Disable all components when the mode is view\r
-     \r
-     @param isView true - The view mode; false - The non-view mode\r
-     \r
-     **/\r
-    public void setViewMode(boolean isView) {\r
-        if (isView) {\r
-            this.jComboBoxUsage.setEnabled(!isView);\r
-            this.jTextFieldFeatureFlag.setEnabled(!isView);\r
-        }\r
+    return jButtonOk;\r
+  }\r
+\r
+  /**\r
+   * This method initializes jButtonCancel\r
+   * \r
+   * @return javax.swing.JButton\r
+   * \r
+   */\r
+  private JButton getJButtonCancel() {\r
+    if (jButtonCancel == null) {\r
+      jButtonCancel = new JButton();\r
+      jButtonCancel.setBounds(new java.awt.Rectangle(390, 182, 90, 20));\r
+      jButtonCancel.setText("Cancel");\r
+      jButtonCancel.addActionListener(this);\r
     }\r
-\r
-    /**\r
-     This method initializes jContentPane\r
-     \r
-     @return javax.swing.JPanel jContentPane\r
-     \r
-     **/\r
-    private JPanel getJContentPane() {\r
-        if (jContentPane == null) {\r
-            jArchCheckBox = new ArchCheckBox();\r
-            jArchCheckBox.setBounds(new java.awt.Rectangle(160, 135, 320, 20));\r
-            jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
-            jLabelHelpText = new JLabel();\r
-            jLabelHelpText.setBounds(new java.awt.Rectangle(14, 85, 140, 20));\r
-            jLabelHelpText.setText("Help Text");\r
-            jLabelArch = new JLabel();\r
-            jLabelArch.setBounds(new java.awt.Rectangle(15, 135, 140, 20));\r
-            jLabelArch.setText("Arch Type");\r
-            jLabelProtocolType = new JLabel();\r
-            jLabelProtocolType.setBounds(new java.awt.Rectangle(15, 10, 140, 20));\r
-            jLabelProtocolType.setText("Protocol Type");\r
-            jLabelUsage = new JLabel();\r
-            jLabelUsage.setText("Usage");\r
-            jLabelUsage.setBounds(new java.awt.Rectangle(15, 60, 140, 20));\r
-            jLabelFeatureFlag = new JLabel();\r
-            jLabelFeatureFlag.setText("Feature Flag");\r
-            jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 110, 140, 20));\r
-            jLabelC_Name = new JLabel();\r
-            jLabelC_Name.setText("C Name Type");\r
-            jLabelC_Name.setBounds(new java.awt.Rectangle(15, 35, 140, 20));\r
-\r
-            jContentPane = new JPanel();\r
-            jContentPane.setLayout(null);\r
-            jContentPane.setPreferredSize(new java.awt.Dimension(490, 190));\r
-\r
-            jContentPane.add(jLabelC_Name, null);\r
-            jContentPane.add(jLabelFeatureFlag, null);\r
-            jContentPane.add(getJTextFieldFeatureFlag(), null);\r
-            jContentPane.add(jLabelUsage, null);\r
-            jContentPane.add(getJComboBoxProtocolUsage(), null);\r
-            jContentPane.add(jLabelProtocolType, null);\r
-\r
-            jStarLabel1 = new StarLabel();\r
-            jStarLabel1.setBounds(new java.awt.Rectangle(0, 10, 10, 20));\r
-            jStarLabel2 = new StarLabel();\r
-            jStarLabel2.setBounds(new java.awt.Rectangle(0, 35, 10, 20));\r
-\r
-            jContentPane.add(jStarLabel1, null);\r
-            jContentPane.add(jStarLabel2, null);\r
-            jContentPane.add(jLabelArch, null);\r
-            jContentPane.add(getJComboBoxProtocolType(), null);\r
-            jContentPane.add(getJComboBoxCName(), null);\r
-            jContentPane.add(jLabelHelpText, null);\r
-            jContentPane.add(getJTextFieldHelpText(), null);\r
-            jContentPane.add(jArchCheckBox, null);\r
-            jContentPane.add(getJButtonOk(), null);\r
-            jContentPane.add(getJButtonCancel(), null);\r
-        }\r
-        return jContentPane;\r
+    return jButtonCancel;\r
+  }\r
+\r
+  public static void main(String[] args) {\r
+\r
+  }\r
+\r
+  /**\r
+   * This method initializes this\r
+   * \r
+   */\r
+  private void init() {\r
+    this.setSize(500, 255);\r
+    this.setContentPane(getJScrollPane());\r
+    this.setTitle("Protocols");\r
+    initFrame();\r
+    this.setViewMode(false);\r
+    this.centerWindow();\r
+  }\r
+\r
+  /**\r
+   * This method initializes this Fill values to all fields if these values are\r
+   * not empty\r
+   * \r
+   * @param inProtocolsId\r
+   * \r
+   */\r
+  private void init(ProtocolsIdentification inProtocolsId) {\r
+    init();\r
+    this.id = inProtocolsId;\r
+\r
+    if (this.id != null) {\r
+      this.jComboBoxCName.setSelectedItem(id.getName());\r
+      this.jComboBoxProtocolType.setSelectedItem(id.getType());\r
+      this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
+      this.jTextAreaHelpText.setText(id.getHelp());\r
+      this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());\r
+      this.jArchCheckBox.setSelectedItems(id.getSupArchList());\r
     }\r
-\r
-    /**\r
-     This method initializes Usage type\r
-     \r
-     **/\r
-    private void initFrame() {\r
-        Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());\r
-        Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllProtocolDeclarationsFromWorkspace());\r
-        Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());\r
+  }\r
+\r
+  /**\r
+   * This is the override edit constructor\r
+   * \r
+   * @param inProtocolsIdentification\r
+   * @param iFrame\r
+   * \r
+   */\r
+  public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification,\r
+      IFrame iFrame) {\r
+    super(iFrame, true);\r
+    init(inProtocolsIdentification);\r
+  }\r
+\r
+  /**\r
+   * Disable all components when the mode is view\r
+   * \r
+   * @param isView\r
+   *          true - The view mode; false - The non-view mode\r
+   * \r
+   */\r
+  public void setViewMode(boolean isView) {\r
+    if (isView) {\r
+      this.jComboBoxUsage.setEnabled(!isView);\r
+      this.jTextFieldFeatureFlag.setEnabled(!isView);\r
     }\r
-\r
-    /* (non-Javadoc)\r
-     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
-     *\r
-     * Override actionPerformed to listen all actions\r
-     * \r
-     */\r
-    public void actionPerformed(ActionEvent arg0) {\r
-        if (arg0.getSource() == jButtonOk) {\r
-            if (checkAdd()) {\r
-                getCurrentProtocols();\r
-                this.returnType = DataType.RETURN_TYPE_OK;\r
-                this.setVisible(false);\r
-            }\r
-        }\r
-\r
-        if (arg0.getSource() == jButtonCancel) {\r
-            this.returnType = DataType.RETURN_TYPE_CANCEL;\r
-            this.setVisible(false);\r
-        }\r
+  }\r
+\r
+  /**\r
+   * This method initializes jContentPane\r
+   * \r
+   * @return javax.swing.JPanel jContentPane\r
+   * \r
+   */\r
+  private JPanel getJContentPane() {\r
+    if (jContentPane == null) {\r
+      jStarLabel1 = new StarLabel();\r
+      jStarLabel1.setLocation(new java.awt.Point(2, 10));\r
+      jLabelProtocolType = new JLabel();\r
+      jLabelProtocolType.setBounds(new java.awt.Rectangle(15, 10, 145, 20));\r
+      jLabelProtocolType.setText("Select Protocol Type");\r
+\r
+      jStarLabel2 = new StarLabel();\r
+      jStarLabel2.setLocation(new java.awt.Point(2, 35));\r
+      jLabelC_Name = new JLabel();\r
+      jLabelC_Name.setText("Protocol Guid C Name");\r
+      jLabelC_Name.setBounds(new java.awt.Rectangle(15, 35, 145, 20));\r
+\r
+      jStarLabel3 = new StarLabel();\r
+      jStarLabel3.setLocation(new java.awt.Point(2, 60));\r
+      jLabelUsage = new JLabel();\r
+      jLabelUsage.setText("Usage");\r
+      jLabelUsage.setBounds(new java.awt.Rectangle(15, 60, 145, 20));\r
+\r
+      jLabelHelpText = new JLabel();\r
+      jLabelHelpText.setBounds(new java.awt.Rectangle(15, 85, 145, 20));\r
+      jLabelHelpText.setText("Help Text");\r
+\r
+      jLabelFeatureFlag = new JLabel();\r
+      jLabelFeatureFlag.setText("Feature Flag Expression");\r
+      jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 130, 145, 20));\r
+\r
+      jLabelArch = new JLabel();\r
+      jLabelArch.setBounds(new java.awt.Rectangle(15, 155, 145, 20));\r
+      jLabelArch.setText("Supported Architectures");\r
+      jArchCheckBox = new ArchCheckBox();\r
+      jArchCheckBox.setBounds(new java.awt.Rectangle(160, 155, 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(485, 210));\r
+\r
+      jContentPane.add(jStarLabel1, null);\r
+      jContentPane.add(jLabelProtocolType, null);\r
+      jContentPane.add(getJComboBoxProtocolType(), null);\r
+      jContentPane.add(jStarLabel2, null);\r
+      jContentPane.add(jLabelC_Name, null);\r
+      jContentPane.add(getJComboBoxCName(), null);\r
+      jContentPane.add(jStarLabel3, null);\r
+      jContentPane.add(jLabelUsage, null);\r
+      jContentPane.add(getJComboBoxProtocolUsage(), null);\r
+      jContentPane.add(jLabelHelpText, null);\r
+      jContentPane.add(getJScrollPaneHelpText(), null);\r
+      jContentPane.add(jLabelFeatureFlag, null);\r
+      jContentPane.add(getJTextFieldFeatureFlag(), null);\r
+      jContentPane.add(jLabelArch, null);\r
+      jContentPane.add(jArchCheckBox, null);\r
+      jContentPane.add(getJButtonOk(), null);\r
+      jContentPane.add(getJButtonCancel(), null);\r
     }\r
-\r
-    /**\r
-     Data validation for all fields\r
-     \r
-     @retval true - All datas are valid\r
-     @retval false - At least one data is invalid\r
-     \r
-     **/\r
-    public boolean checkAdd() {\r
-        //\r
-        // Check if all fields have correct data types \r
-        //\r
-\r
-        //\r
-        // Check Name \r
-        //\r
-        if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
-            if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {\r
-                Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        //\r
-        // Check FeatureFlag\r
-        //\r
-        if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r
-            if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r
-                Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        return true;\r
+    return jContentPane;\r
+  }\r
+\r
+  /**\r
+   * This method initializes Usage type\r
+   * \r
+   */\r
+  private void initFrame() {\r
+    Tools\r
+        .generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());\r
+    Tools.generateComboBoxByVector(jComboBoxCName, wt\r
+        .getAllProtocolDeclarationsFromWorkspace());\r
+    Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());\r
+  }\r
+\r
+  /*\r
+   * (non-Javadoc)\r
+   * \r
+   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
+   * \r
+   * Override actionPerformed to listen all actions\r
+   * \r
+   */\r
+  public void actionPerformed(ActionEvent arg0) {\r
+    if (arg0.getSource() == jButtonOk) {\r
+      if (checkAdd()) {\r
+        getCurrentProtocols();\r
+        this.returnType = DataType.RETURN_TYPE_OK;\r
+        this.setVisible(false);\r
+      }\r
     }\r
 \r
-    private ProtocolsIdentification getCurrentProtocols() {\r
-        String arg0 = this.jComboBoxCName.getSelectedItem().toString();\r
-        String arg1 = this.jComboBoxProtocolType.getSelectedItem().toString();\r
-        String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r
-\r
-        String arg3 = this.jTextFieldFeatureFlag.getText();\r
-        Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();\r
-        String arg5 = this.jTextFieldHelpText.getText();\r
-        id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
-        return id;\r
+    if (arg0.getSource() == jButtonCancel) {\r
+      this.returnType = DataType.RETURN_TYPE_CANCEL;\r
+      this.setVisible(false);\r
     }\r
+  }\r
+\r
+  /**\r
+   * Data validation for all fields\r
+   * \r
+   * @retval true - All datas are valid\r
+   * @retval false - At least one data is invalid\r
+   * \r
+   */\r
+  public boolean checkAdd() {\r
+    //\r
+    // Check if all fields have correct data types\r
+    //\r
 \r
-    /* (non-Javadoc)\r
-     * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)\r
-     *\r
-     * Reflesh the frame when selected item changed\r
-     * \r
-     */\r
-    public void itemStateChanged(ItemEvent arg0) {\r
-        if (arg0.getSource() == this.jComboBoxProtocolType && arg0.getStateChange() == ItemEvent.SELECTED) {\r
-            if (this.jComboBoxProtocolType.getSelectedItem().toString().equals(ed.getVProtocolType().get(0))) {\r
-                Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolUsage());\r
-            } else {\r
-                Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolNotifyUsage());\r
-            }\r
-        }\r
+    //\r
+    // Check Name\r
+    //\r
+    if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {\r
+      if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem()\r
+          .toString())) {\r
+        Log.wrn("Update Protocols",\r
+            "Incorrect data type for Protocol/ProtocolNotify Name");\r
+        return false;\r
+      }\r
     }\r
 \r
-    public ProtocolsIdentification getId() {\r
-        return id;\r
+    //\r
+    // Check FeatureFlag\r
+    //\r
+    if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {\r
+      if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {\r
+        Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");\r
+        return false;\r
+      }\r
     }\r
 \r
-    public void setId(ProtocolsIdentification id) {\r
-        this.id = id;\r
+    return true;\r
+  }\r
+\r
+  private ProtocolsIdentification getCurrentProtocols() {\r
+    String arg0 = this.jComboBoxCName.getSelectedItem().toString();\r
+    String arg1 = this.jComboBoxProtocolType.getSelectedItem().toString();\r
+    String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r
+\r
+    String arg3 = this.jTextFieldFeatureFlag.getText();\r
+    Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();\r
+    String arg5 = this.jTextAreaHelpText.getText();\r
+    id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);\r
+    return id;\r
+  } \r
+\r
+  /*\r
+   * (non-Javadoc)\r
+   * \r
+   * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)\r
+   * \r
+   * Reflesh the frame when selected item changed\r
+   * \r
+   */\r
+\r
+  public void itemStateChanged(ItemEvent arg0) {\r
+    if (arg0.getSource() == this.jComboBoxProtocolType\r
+        && arg0.getStateChange() == ItemEvent.SELECTED) {\r
+      if (this.jComboBoxProtocolType.getSelectedItem().toString().equals(\r
+          ed.getVProtocolType().get(0))) {\r
+        Tools.generateComboBoxByVector(this.jComboBoxUsage, ed\r
+            .getVProtocolUsage());\r
+      } else {\r
+        Tools.generateComboBoxByVector(this.jComboBoxUsage, ed\r
+            .getVProtocolNotifyUsage());\r
+      }\r
     }\r
+  }\r
+\r
+  public ProtocolsIdentification getId() {\r
+    return id;\r
+  }\r
+\r
+  public void setId(ProtocolsIdentification id) {\r
+    this.id = id;\r
+  }\r
 }\r