import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;\r
+import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;\r
+import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
\r
/**\r
- * The class is used to create, update Library Class Definition of MSA/MBD file\r
+ * The class is used to create, update Library Class Definition section of the MSA file\r
* \r
* It extends IDialog\r
* \r
- **/\r
+ */\r
public class LibraryClassDefsDlg extends IDialog {\r
\r
///\r
private JTextField getJTextFieldFeatureFlag() {\r
if (jTextFieldFeatureFlag == null) {\r
jTextFieldFeatureFlag = new JTextField();\r
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));\r
+ jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168,197,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
private JScrollPane getJScrollPaneModuleList() {\r
if (jScrollPaneModuleList == null) {\r
jScrollPaneModuleList = new JScrollPane();\r
- jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 137, 320, 80));\r
+ jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 112, 320, 80));\r
jScrollPaneModuleList.setPreferredSize(new java.awt.Dimension(320, 80));\r
jScrollPaneModuleList.setViewportView(getICheckBoxListSupModuleList());\r
}\r
This is the default constructor\r
\r
**/\r
- public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame) {\r
+ public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame, ModuleIdentification mid) {\r
super(iFrame, true);\r
- init(inLibraryClassIdentification);\r
+ init(inLibraryClassIdentification, mid);\r
}\r
\r
/**\r
This method initializes this\r
\r
**/\r
- private void init(LibraryClassIdentification inLibraryClassIdentification) {\r
+ private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {\r
init();\r
this.lcid = inLibraryClassIdentification;\r
+ \r
+ //\r
+ // Init arch with module's arch\r
+ //\r
+ this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));\r
+ \r
+ //\r
+ // Get defined library classes from dependent packages\r
+ //\r
+ Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);\r
+ if (vpid.size() <= 0) {\r
+ Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");\r
+ }\r
+ \r
+ Tools.generateComboBoxByVector(this.jComboBoxLibraryClassName,\r
+ wt.getAllLibraryClassDefinitionsFromPackages(wt.getPackageDependenciesOfModule(mid)));\r
+\r
if (lcid != null) {\r
this.jComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());\r
this.jComboBoxUsage.setSelectedItem(lcid.getUsage());\r
private JPanel getJContentPane() {\r
if (jContentPane == null) {\r
jArchCheckBox = new ArchCheckBox();\r
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 320, 20));\r
+ jArchCheckBox.setBounds(new java.awt.Rectangle(168, 87, 320, 20));\r
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));\r
jLabelHelpText = new JLabel();\r
jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 168, 20));\r
jLabelHelpText.setText("Help Text");\r
jLabelModuleList = new JLabel();\r
- jLabelModuleList.setBounds(new java.awt.Rectangle(12, 137, 168, 20));\r
+ jLabelModuleList.setBounds(new java.awt.Rectangle(12, 112, 168, 20));\r
jLabelModuleList.setText("Supported Module Types");\r
jLabelArch = new JLabel();\r
- jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 168, 20));\r
+ jLabelArch.setBounds(new java.awt.Rectangle(12, 87, 168, 20));\r
jLabelArch.setText("Supported Architectures");\r
jLabelFeatureFlag = new JLabel();\r
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 168, 20));\r
+ jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12,197,168,20));\r
jLabelFeatureFlag.setText("Feature Flag Expression");\r
+ jLabelFeatureFlag.setEnabled(false);\r
jLabelRecommendedInstanceGuid = new JLabel();\r
- jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 112, 200, 20));\r
+ jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 87, 200, 20));\r
jLabelRecommendedInstanceGuid.setText("Recommended Instance Guid");\r
jLabelRecommendedInstanceGuid.setVisible(false);\r
jLabelRecommendedInstanceVersion = new JLabel();\r
\r
**/\r
private void initFrame() {\r
- Tools.generateComboBoxByVector(jComboBoxLibraryClassName, wt.getAllLibraryClassDefinitionsFromWorkspace());\r
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());\r
this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());\r
}\r
// Check LibraryClass\r
//\r
if (this.jComboBoxLibraryClassName.getSelectedItem() == null) {\r
- Log.wrn("Update Library Class Definitions", "No Library Class can be added");\r
+ Log.wrn("Update Library Class Definitions", "Please select one Library Class");\r
return false;\r
}\r
if (!DataValidation.isLibraryClass(this.jComboBoxLibraryClassName.getSelectedItem().toString())) {\r