]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
1. Restructure some folders and files
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / module / ui / ModuleEvents.java
index 165fbd60686bf1078cd757cf212f2c2a3cf4cc50..26c8a62c36518669c5a9779c7c455aa80f28c0e6 100644 (file)
@@ -38,13 +38,14 @@ import org.tianocore.frameworkwizard.common.DataType;
 import org.tianocore.frameworkwizard.common.DataValidation;\r
 import org.tianocore.frameworkwizard.common.EnumerationData;\r
 import org.tianocore.frameworkwizard.common.Log;\r
-import org.tianocore.frameworkwizard.common.OpeningModuleType;\r
 import org.tianocore.frameworkwizard.common.Tools;\r
+import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;\r
 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
 import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
 import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
-import org.tianocore.frameworkwizard.module.Identification.Events.EventsIdentification;\r
-import org.tianocore.frameworkwizard.module.Identification.Events.EventsVector;\r
+import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;\r
+import org.tianocore.frameworkwizard.module.Identifications.Events.EventsVector;\r
+import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
 \r
 /**\r
  The class is used to create, update Event of MSA/MBD file\r
@@ -69,7 +70,7 @@ public class ModuleEvents extends IInternalFrame {
 \r
     private JLabel jLabelC_Name = null;\r
 \r
-    private JTextField jTextFieldC_Name = null;\r
+    private JComboBox jComboBoxGuidC_Name = null;\r
 \r
     private JLabel jLabelUsage = null;\r
 \r
@@ -125,6 +126,8 @@ public class ModuleEvents extends IInternalFrame {
     private EventsVector vid = new EventsVector();\r
 \r
     private EnumerationData ed = new EnumerationData();\r
+    \r
+    private WorkspaceTools wt = new WorkspaceTools();\r
 \r
     /**\r
      This method initializes jTextFieldC_Name \r
@@ -132,13 +135,14 @@ public class ModuleEvents extends IInternalFrame {
      @return javax.swing.JTextField jTextFieldC_Name\r
      \r
      **/\r
-    private JTextField getJTextFieldC_Name() {\r
-        if (jTextFieldC_Name == null) {\r
-            jTextFieldC_Name = new JTextField();\r
-            jTextFieldC_Name.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
-            jTextFieldC_Name.setPreferredSize(new java.awt.Dimension(320, 20));\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 jTextFieldC_Name;\r
+        return jComboBoxGuidC_Name;\r
     }\r
 \r
     /**\r
@@ -166,6 +170,7 @@ public class ModuleEvents extends IInternalFrame {
             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.setToolTipText("Select Create event if the Module has an event that is waiting to be signaled.  Select Signal if the Module will signal all events in an event group.  Signal Event The events are named by GUID.");\r
         }\r
         return jComboBoxEventsType;\r
     }\r
@@ -445,7 +450,7 @@ public class ModuleEvents extends IInternalFrame {
      **/\r
     public void setViewMode(boolean isView) {\r
         if (isView) {\r
-            this.jTextFieldC_Name.setEnabled(!isView);\r
+            this.jComboBoxGuidC_Name.setEnabled(!isView);\r
             this.jComboBoxUsage.setEnabled(!isView);\r
         }\r
     }\r
@@ -483,7 +488,7 @@ public class ModuleEvents extends IInternalFrame {
 \r
             jContentPane.add(jLabelEventType, null);\r
             jContentPane.add(jLabelC_Name, null);\r
-            jContentPane.add(getJTextFieldC_Name(), null);\r
+            jContentPane.add(getJComboBoxGuidC_Name(), null);\r
             jContentPane.add(jLabelUsage, null);\r
             jContentPane.add(getJComboBoxUsage(), null);\r
             jStarLabel1 = new StarLabel();\r
@@ -517,6 +522,7 @@ public class ModuleEvents extends IInternalFrame {
     private void initFrame() {\r
         Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());\r
         Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());\r
+        Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
         \r
         this.iCheckBoxListArch.setAllItems(ed.getVSupportedArchitectures());\r
     }\r
@@ -560,13 +566,13 @@ public class ModuleEvents extends IInternalFrame {
         //\r
         // Check Name \r
         //\r
-        if (isEmpty(this.jTextFieldC_Name.getText())) {\r
+        if (isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
             Log.err("Event Name couldn't be empty");\r
             return false;\r
         }\r
         \r
-        if (!isEmpty(this.jTextFieldC_Name.getText())) {\r
-            if (!DataValidation.isC_NameType(this.jTextFieldC_Name.getText())) {\r
+        if (!isEmpty(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
+            if (!DataValidation.isC_NameType(this.jComboBoxGuidC_Name.getSelectedItem().toString())) {\r
                 Log.err("Incorrect data type for Event Name");\r
                 return false;\r
             }\r
@@ -673,7 +679,7 @@ public class ModuleEvents extends IInternalFrame {
         int intPreferredHeight = this.getJContentPane().getPreferredSize().height;\r
 \r
         resizeComponentWidth(jComboBoxEventsType, intCurrentWidth, intPreferredWidth);\r
-        resizeComponentWidth(jTextFieldC_Name, intCurrentWidth, intPreferredWidth);\r
+        resizeComponentWidth(jComboBoxGuidC_Name, intCurrentWidth, intPreferredWidth);\r
         resizeComponentWidth(jComboBoxUsage, intCurrentWidth, intPreferredWidth);\r
         resizeComponentWidth(jTextFieldHelpText, intCurrentWidth, intPreferredWidth);\r
         resizeComponentWidth(jTextFieldFeatureFlag, intCurrentWidth, intPreferredWidth);\r
@@ -687,7 +693,7 @@ public class ModuleEvents extends IInternalFrame {
     }\r
     \r
     private EventsIdentification getCurrentEvents() {\r
-        String arg0 = this.jTextFieldC_Name.getText();\r
+        String arg0 = this.jComboBoxGuidC_Name.getSelectedItem().toString();\r
         String arg1 = this.jComboBoxEventsType.getSelectedItem().toString();\r
         String arg2 = this.jComboBoxUsage.getSelectedItem().toString();\r
 \r
@@ -811,7 +817,7 @@ public class ModuleEvents extends IInternalFrame {
             //\r
             intSelectedItemId = jComboBoxList.getSelectedIndex();\r
 \r
-            this.jTextFieldC_Name.setText(vid.getEvents(intSelectedItemId).getName());\r
+            this.jComboBoxGuidC_Name.setSelectedItem(vid.getEvents(intSelectedItemId).getName());\r
             this.jComboBoxEventsType.setSelectedItem(vid.getEvents(intSelectedItemId).getType());\r
             this.jComboBoxUsage.setSelectedItem(vid.getEvents(intSelectedItemId).getUsage());\r
             this.jTextFieldHelpText.setText(vid.getEvents(intSelectedItemId).getHelp());\r