import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
- * The class is used to create, update SystemTable of MSA/MBD file It extends\r
- * IInternalFrame\r
- * \r
+ * The class is used to create, update SystemTables section of the MSA file\r
* \r
+ * It extends IDialog\r
* \r
*/\r
public class SystemTablesDlg extends IDialog {\r
private JComboBox getJComboBoxGuidC_Name() {\r
if (jComboBoxGuidC_Name == null) {\r
jComboBoxGuidC_Name = new JComboBox();\r
- jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
+ jComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 12, 320, 20));\r
jComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));\r
jComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the System Table");\r
}\r
private JComboBox getJComboBoxUsage() {\r
if (jComboBoxUsage == null) {\r
jComboBoxUsage = new JComboBox();\r
- jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 35, 320, 20));\r
+ jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));\r
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));\r
jComboBoxUsage\r
.setToolTipText("<html><table>"\r
private JTextField getJTextFieldFeatureFlag() {\r
if (jTextFieldFeatureFlag == null) {\r
jTextFieldFeatureFlag = new JTextField();\r
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 105, 320, 20));\r
+ jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));\r
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));\r
jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");\r
+ jTextFieldFeatureFlag.setEnabled(false);\r
}\r
return jTextFieldFeatureFlag;\r
}\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.setLocation(new java.awt.Point(168, 62));\r
jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());\r
}\r
return jScrollPaneHelpText;\r
private JButton getJButtonOk() {\r
if (jButtonOk == null) {\r
jButtonOk = new JButton();\r
- jButtonOk.setBounds(new java.awt.Rectangle(290, 157, 90, 20));\r
+ jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));\r
jButtonOk.setText("Ok");\r
jButtonOk.addActionListener(this);\r
}\r
private JButton getJButtonCancel() {\r
if (jButtonCancel == null) {\r
jButtonCancel = new JButton();\r
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 157, 90, 20));\r
+ jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));\r
jButtonCancel.setText("Cancel");\r
jButtonCancel.addActionListener(this);\r
}\r
* \r
*/\r
private void init() {\r
- this.setSize(500, 230);\r
+ this.setSize(505, 235);\r
this.setContentPane(getJScrollPane());\r
this.setTitle("System Tables");\r
initFrame();\r
* @param inSystemTablesId\r
* \r
*/\r
- private void init(SystemTablesIdentification inSystemTablesId) {\r
+ private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {\r
init();\r
this.id = inSystemTablesId;\r
\r
+ //\r
+ // Init arch with module's arch\r
+ //\r
+ this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
+\r
+ //\r
+ // Get defined guids from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log\r
+ .wrn("Init Guid",\r
+ "This module hasn't defined any package dependency, so there is no guid value can be added for system table");\r
+ }\r
+ //\r
+ // Init guids drop down list\r
+ //\r
+ Tools\r
+ .generateComboBoxByVector(jComboBoxGuidC_Name,\r
+ wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));\r
+\r
+\r
if (this.id != null) {\r
this.jComboBoxGuidC_Name.setSelectedItem(id.getName());\r
this.jComboBoxUsage.setSelectedItem(id.getUsage());\r
* @param iFrame\r
* \r
*/\r
- public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame) {\r
+ public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,\r
+ ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inSystemTablesIdentification);\r
+ init(inSystemTablesIdentification, mid);\r
}\r
\r
/**\r
private JPanel getJContentPane() {\r
if (jContentPane == null) {\r
jStarLabel1 = new StarLabel();\r
- jStarLabel1.setLocation(new java.awt.Point(2, 10));\r
+ jStarLabel1.setLocation(new java.awt.Point(2, 12));\r
jLabelEntry = new JLabel();\r
jLabelEntry.setText("Table's GUID C Name");\r
- jLabelEntry.setBounds(new java.awt.Rectangle(15, 10, 145, 20));\r
+ jLabelEntry.setBounds(new java.awt.Rectangle(12, 12, 155, 20));\r
jStarLabel2 = new StarLabel();\r
- jStarLabel2.setLocation(new java.awt.Point(2, 35));\r
+ jStarLabel2.setLocation(new java.awt.Point(2, 37));\r
jLabelUsage = new JLabel();\r
jLabelUsage.setText("Usage");\r
- jLabelUsage.setBounds(new java.awt.Rectangle(15, 35, 145, 20));\r
+ jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));\r
jLabelHelpText = new JLabel();\r
- jLabelHelpText.setBounds(new java.awt.Rectangle(14, 60, 145, 20));\r
+ jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));\r
jLabelHelpText.setText("Help Text");\r
jLabelFeatureFlag = new JLabel();\r
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 105, 140, 20));\r
+ jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));\r
jLabelFeatureFlag.setText("Feature Flag Expression");\r
+ jLabelFeatureFlag.setEnabled(false);\r
jLabelArch = new JLabel();\r
- jLabelArch.setBounds(new java.awt.Rectangle(15, 130, 145, 20));\r
+ jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));\r
jLabelArch.setText("Supported Architectures");\r
jArchCheckBox = new ArchCheckBox();\r
- jArchCheckBox.setBounds(new java.awt.Rectangle(160, 130, 320, 20));\r
+ jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 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, 185));\r
+ jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));\r
\r
jContentPane.add(jLabelEntry, null);\r
jContentPane.add(jLabelFeatureFlag, null);\r
*/\r
private void initFrame() {\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());\r
- Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());\r
}\r
\r
/*\r
//\r
// Check if all fields have correct data types\r
//\r
+ \r
+ //\r
+ // Check Name\r
+ //\r
+ if (this.jComboBoxGuidC_Name.getSelectedItem() == null) {\r
+ Log.wrn("Update Guids", "Please select one System Table Name");\r
+ return false;\r
+ }\r
\r
//\r
// Check FeatureFlag\r