1. Fix EDKT321 A module's all top level elements' arch should be in range of the module's arch

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1620 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x
2006-09-26 00:47:40 +00:00
parent ee2db09328
commit e08433efeb
27 changed files with 200 additions and 69 deletions

View File

@ -158,22 +158,22 @@ public class ArchCheckBox extends JPanel {
public Vector<String> getSelectedItemsVector() { public Vector<String> getSelectedItemsVector() {
Vector<String> v = new Vector<String>(); Vector<String> v = new Vector<String>();
if (this.jCheckBoxIa32.isSelected()) { if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
v.addElement(jCheckBoxIa32.getText()); v.addElement(jCheckBoxIa32.getText());
} }
if (this.jCheckBoxX64.isSelected()) { if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
v.addElement(jCheckBoxX64.getText()); v.addElement(jCheckBoxX64.getText());
} }
if (this.jCheckBoxIpf.isSelected()) { if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
v.addElement(jCheckBoxIpf.getText()); v.addElement(jCheckBoxIpf.getText());
} }
if (this.jCheckBoxEbc.isSelected()) { if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
v.addElement(jCheckBoxEbc.getText()); v.addElement(jCheckBoxEbc.getText());
} }
if (this.jCheckBoxArm.isSelected()) { if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
v.addElement(jCheckBoxArm.getText()); v.addElement(jCheckBoxArm.getText());
} }
if (this.jCheckBoxPpc.isSelected()) { if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
v.addElement(jCheckBoxPpc.getText()); v.addElement(jCheckBoxPpc.getText());
} }
return v; return v;
@ -181,22 +181,22 @@ public class ArchCheckBox extends JPanel {
public String getSelectedItemsString() { public String getSelectedItemsString() {
String s = ""; String s = "";
if (this.jCheckBoxIa32.isSelected()) { if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
s = s + jCheckBoxIa32.getText() + " "; s = s + jCheckBoxIa32.getText() + " ";
} }
if (this.jCheckBoxX64.isSelected()) { if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
s = s + jCheckBoxX64.getText() + " "; s = s + jCheckBoxX64.getText() + " ";
} }
if (this.jCheckBoxIpf.isSelected()) { if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
s = s + jCheckBoxIpf.getText() + " "; s = s + jCheckBoxIpf.getText() + " ";
} }
if (this.jCheckBoxEbc.isSelected()) { if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
s = s + jCheckBoxEbc.getText() + " "; s = s + jCheckBoxEbc.getText() + " ";
} }
if (this.jCheckBoxArm.isSelected()) { if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
s = s + jCheckBoxArm.getText() + " "; s = s + jCheckBoxArm.getText() + " ";
} }
if (this.jCheckBoxPpc.isSelected()) { if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
s = s + jCheckBoxPpc.getText() + " "; s = s + jCheckBoxPpc.getText() + " ";
} }
return s.trim(); return s.trim();

View File

@ -289,7 +289,7 @@ public class ModuleBootModes extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
BootModesDlg dlg = new BootModesDlg(vid.getBootModes(index), new IFrame()); BootModesDlg dlg = new BootModesDlg(vid.getBootModes(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -286,7 +286,7 @@ public class ModuleDataHubs extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
DataHubsDlg dlg = new DataHubsDlg(vid.getDataHubs(index), new IFrame()); DataHubsDlg dlg = new DataHubsDlg(vid.getDataHubs(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -315,7 +315,7 @@ public class ModuleEvents extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
EventsDlg dlg = new EventsDlg(vid.getEvents(index), new IFrame()); EventsDlg dlg = new EventsDlg(vid.getEvents(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -344,7 +344,7 @@ public class ModuleExterns extends IInternalFrame implements ItemListener {
} }
private void showEdit(int index) { private void showEdit(int index) {
ExternsDlg dlg = new ExternsDlg(vid.getExterns(index), new IFrame()); ExternsDlg dlg = new ExternsDlg(vid.getExterns(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -215,7 +215,7 @@ public class ModuleHiiPackages extends IInternalFrame {
private void init(HiiPackages inHiiPackages) { private void init(HiiPackages inHiiPackages) {
init(); init();
this.hiiPackages = inHiiPackages; this.hiiPackages = inHiiPackages;
if (this.hiiPackages != null) { if (this.hiiPackages != null) {
if (this.hiiPackages.getHiiPackageList().size() > 0) { if (this.hiiPackages.getHiiPackageList().size() > 0) {
for (int index = 0; index < this.hiiPackages.getHiiPackageList().size(); index++) { for (int index = 0; index < this.hiiPackages.getHiiPackageList().size(); index++) {
@ -286,7 +286,7 @@ public class ModuleHiiPackages extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
HiiPackagesDlg dlg = new HiiPackagesDlg(vid.getHiiPackages(index), new IFrame()); HiiPackagesDlg dlg = new HiiPackagesDlg(vid.getHiiPackages(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -289,7 +289,7 @@ public class ModuleHobs extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
HobsDlg dlg = new HobsDlg(vid.getHobs(index), new IFrame()); HobsDlg dlg = new HobsDlg(vid.getHobs(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -294,7 +294,7 @@ public class ModulePackageDependencies extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
PackageDepDlg pdd = new PackageDepDlg(vid.getPackageDependencies(index), new IFrame()); PackageDepDlg pdd = new PackageDepDlg(vid.getPackageDependencies(index), new IFrame(), omt.getId());
int result = pdd.showDialog(); int result = pdd.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -348,8 +348,7 @@ public class ModuleSourceFiles extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), new IFrame(), omt.getId() SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), new IFrame(), omt.getId());
.getPath());
int result = sfd.showDialog(); int result = sfd.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -286,7 +286,7 @@ public class ModuleSystemTables extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
SystemTablesDlg dlg = new SystemTablesDlg(vid.getSystemTables(index), new IFrame()); SystemTablesDlg dlg = new SystemTablesDlg(vid.getSystemTables(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -286,7 +286,7 @@ public class ModuleVariables extends IInternalFrame {
} }
private void showEdit(int index) { private void showEdit(int index) {
VariablesDlg dlg = new VariablesDlg(vid.getVariables(index), new IFrame()); VariablesDlg dlg = new VariablesDlg(vid.getVariables(index), new IFrame(), omt.getId());
int result = dlg.showDialog(); int result = dlg.showDialog();
if (result == DataType.RETURN_TYPE_OK) { if (result == DataType.RETURN_TYPE_OK) {
if (index == -1) { if (index == -1) {

View File

@ -39,7 +39,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification; import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
* The class is used to create, update BootModes of MSA/MBD file * The class is used to create, update BootModes of MSA/MBD file
@ -97,6 +99,8 @@ public class BootModesDlg extends IDialog {
private BootModesIdentification id = null; private BootModesIdentification id = null;
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
/** /**
* This method initializes jComboBoxBootModeName * This method initializes jComboBoxBootModeName
@ -263,10 +267,15 @@ public class BootModesDlg extends IDialog {
* @param inBootModesId * @param inBootModesId
* *
*/ */
private void init(BootModesIdentification inBootModesId) { private void init(BootModesIdentification inBootModesId, ModuleIdentification mid) {
init(); init();
this.id = inBootModesId; this.id = inBootModesId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jComboBoxBootModeName.setSelectedItem(id.getName()); this.jComboBoxBootModeName.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -283,9 +292,9 @@ public class BootModesDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame) { public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inBootModesIdentification); init(inBootModesIdentification, mid);
} }
/** /**

View File

@ -39,7 +39,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification; import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
* The class is used to create, update DataHub of the MSA file * The class is used to create, update DataHub of the MSA file
@ -97,6 +99,8 @@ public class DataHubsDlg extends IDialog {
private DataHubsIdentification id = null; private DataHubsIdentification id = null;
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
/** /**
* This method initializes jTextFieldDataHubRecord * This method initializes jTextFieldDataHubRecord
@ -254,10 +258,15 @@ public class DataHubsDlg extends IDialog {
* @param inDataHubsId * @param inDataHubsId
* *
*/ */
private void init(DataHubsIdentification inDataHubsId) { private void init(DataHubsIdentification inDataHubsId, ModuleIdentification mid) {
init(); init();
this.id = inDataHubsId; this.id = inDataHubsId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jTextFieldDataHubRecord.setText(id.getName()); this.jTextFieldDataHubRecord.setText(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -274,9 +283,9 @@ public class DataHubsDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public DataHubsDlg(DataHubsIdentification inDataHubsIdentification, IFrame iFrame) { public DataHubsDlg(DataHubsIdentification inDataHubsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inDataHubsIdentification); init(inDataHubsIdentification, mid);
} }
/** /**

View File

@ -34,6 +34,7 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
@ -303,10 +304,15 @@ public class EventsDlg extends IDialog {
* @param inEventsId * @param inEventsId
* *
*/ */
private void init(EventsIdentification inEventsId) { private void init(EventsIdentification inEventsId, ModuleIdentification mid) {
init(); init();
this.id = inEventsId; this.id = inEventsId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxEventsType.setSelectedItem(id.getType()); this.jComboBoxEventsType.setSelectedItem(id.getType());
@ -326,9 +332,9 @@ public class EventsDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame) { public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inEventsIdentification); init(inEventsIdentification, mid);
} }
/** /**

View File

@ -35,7 +35,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
* The class is used to create, update Externs section of the MSA file * The class is used to create, update Externs section of the MSA file
@ -135,6 +137,10 @@ public class ExternsDlg extends IDialog implements ItemListener {
private ExternsIdentification id = null; private ExternsIdentification id = null;
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
private Vector<String> vArchList = new Vector<String>();
/** /**
This method initializes jComboBoxType This method initializes jComboBoxType
@ -511,9 +517,14 @@ public class ExternsDlg extends IDialog implements ItemListener {
@param inExternsId @param inExternsId
**/ **/
private void init(ExternsIdentification inExternsId) { private void init(ExternsIdentification inExternsId, ModuleIdentification mid) {
init(); init();
this.id = inExternsId; this.id = inExternsId;
//
// Init arch with module's arch
//
this.vArchList = wt.getModuleArch(mid);
if (this.id != null) { if (this.id != null) {
String type = id.getType(); String type = id.getType();
@ -576,9 +587,9 @@ public class ExternsDlg extends IDialog implements ItemListener {
@param iFrame @param iFrame
**/ **/
public ExternsDlg(ExternsIdentification inExternsIdentification, IFrame iFrame) { public ExternsDlg(ExternsIdentification inExternsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inExternsIdentification); init(inExternsIdentification, mid);
} }
/** /**
@ -878,7 +889,7 @@ public class ExternsDlg extends IDialog implements ItemListener {
this.jPanelDriver.setVisible(false); this.jPanelDriver.setVisible(false);
this.jPanelCallBack.setVisible(false); this.jPanelCallBack.setVisible(false);
this.jLabelArch.setEnabled(true); this.jLabelArch.setEnabled(true);
this.jArchCheckBox.setAllItemsEnabled(true); this.jArchCheckBox.setEnabledItems(this.vArchList);
this.jLabelArch.setLocation(12, 87); this.jLabelArch.setLocation(12, 87);
this.jArchCheckBox.setLocation(168, 87); this.jArchCheckBox.setLocation(168, 87);
this.jLabelFeatureFlag.setLocation(12, 112); this.jLabelFeatureFlag.setLocation(12, 112);
@ -890,7 +901,7 @@ public class ExternsDlg extends IDialog implements ItemListener {
this.jPanelDriver.setVisible(false); this.jPanelDriver.setVisible(false);
this.jPanelCallBack.setVisible(false); this.jPanelCallBack.setVisible(false);
this.jLabelArch.setEnabled(true); this.jLabelArch.setEnabled(true);
this.jArchCheckBox.setAllItemsEnabled(true); this.jArchCheckBox.setEnabledItems(this.vArchList);
this.jLabelArch.setLocation(12, 87); this.jLabelArch.setLocation(12, 87);
this.jArchCheckBox.setLocation(168, 87); this.jArchCheckBox.setLocation(168, 87);
this.jLabelFeatureFlag.setLocation(12, 112); this.jLabelFeatureFlag.setLocation(12, 112);
@ -902,7 +913,7 @@ public class ExternsDlg extends IDialog implements ItemListener {
this.jPanelDriver.setVisible(true); this.jPanelDriver.setVisible(true);
this.jPanelCallBack.setVisible(false); this.jPanelCallBack.setVisible(false);
this.jLabelArch.setEnabled(true); this.jLabelArch.setEnabled(true);
this.jArchCheckBox.setAllItemsEnabled(true); this.jArchCheckBox.setEnabledItems(this.vArchList);
this.jLabelArch.setLocation(12, 137); this.jLabelArch.setLocation(12, 137);
this.jArchCheckBox.setLocation(168, 137); this.jArchCheckBox.setLocation(168, 137);
this.jLabelFeatureFlag.setLocation(12, 162); this.jLabelFeatureFlag.setLocation(12, 162);
@ -914,7 +925,7 @@ public class ExternsDlg extends IDialog implements ItemListener {
this.jPanelDriver.setVisible(false); this.jPanelDriver.setVisible(false);
this.jPanelCallBack.setVisible(true); this.jPanelCallBack.setVisible(true);
this.jLabelArch.setEnabled(true); this.jLabelArch.setEnabled(true);
this.jArchCheckBox.setAllItemsEnabled(true); this.jArchCheckBox.setEnabledItems(this.vArchList);
this.jLabelArch.setLocation(12, 87); this.jLabelArch.setLocation(12, 87);
this.jArchCheckBox.setLocation(168, 87); this.jArchCheckBox.setLocation(168, 87);
this.jLabelFeatureFlag.setLocation(12, 112); this.jLabelFeatureFlag.setLocation(12, 112);

View File

@ -261,6 +261,14 @@ public class GuidsDlg extends IDialog {
init(); init();
this.id = inGuidsId; this.id = inGuidsId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined guids from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid); Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) { if (vpid.size() <= 0) {
Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added"); Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");

View File

@ -34,7 +34,9 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification; import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
* The class is used to create, update Hii Packages of the MSA file * The class is used to create, update Hii Packages of the MSA file
@ -92,6 +94,8 @@ public class HiiPackagesDlg extends IDialog {
private HiiPackagesIdentification id = null; private HiiPackagesIdentification id = null;
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
/** /**
* *
@ -257,10 +261,15 @@ public class HiiPackagesDlg extends IDialog {
* @param inHiiPackagesId * @param inHiiPackagesId
* *
**/ **/
private void init(HiiPackagesIdentification inHiiPackagesId) { private void init(HiiPackagesIdentification inHiiPackagesId, ModuleIdentification mid) {
init(); init();
this.id = inHiiPackagesId; this.id = inHiiPackagesId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jTextFieldName.setText(id.getName()); this.jTextFieldName.setText(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -277,9 +286,9 @@ public class HiiPackagesDlg extends IDialog {
* @param iFrame * @param iFrame
* *
**/ **/
public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification, IFrame iFrame) { public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inHiiPackagesIdentification); init(inHiiPackagesIdentification, mid);
} }
/** /**

View File

@ -34,6 +34,7 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification; import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
@ -283,10 +284,15 @@ public class HobsDlg extends IDialog {
* @param inHobsId * @param inHobsId
* *
*/ */
private void init(HobsIdentification inHobsId) { private void init(HobsIdentification inHobsId, ModuleIdentification mid) {
init(); init();
this.id = inHobsId; this.id = inHobsId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxHobType.setSelectedItem(id.getType()); this.jComboBoxHobType.setSelectedItem(id.getType());
@ -304,9 +310,9 @@ public class HobsDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame) { public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inHobsIdentification); init(inHobsIdentification, mid);
} }
/** /**

View File

@ -330,6 +330,14 @@ public class LibraryClassDefsDlg extends IDialog {
init(); init();
this.lcid = inLibraryClassIdentification; this.lcid = inLibraryClassIdentification;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined library classes from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid); Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) { if (vpid.size() <= 0) {
Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added"); Log.wrn("Init Library Class", "This module hasn't defined any package dependency, so there is no library class can be added");

View File

@ -313,6 +313,14 @@ public class PCDsDlg extends IDialog implements ItemListener {
init(); init();
this.id = inPcdCodedId; this.id = inPcdCodedId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined pcds from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid); Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) { if (vpid.size() <= 0) {
Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added"); Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");

View File

@ -33,6 +33,7 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification; import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification;
import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
@ -224,9 +225,15 @@ public class PackageDepDlg extends IDialog implements ItemListener {
* This method initializes this * This method initializes this
* *
*/ */
private void init(PackageDependenciesIdentification inPackageDependenciesIdentification) { private void init(PackageDependenciesIdentification inPackageDependenciesIdentification, ModuleIdentification mid) {
init(); init();
this.pdid = inPackageDependenciesIdentification; this.pdid = inPackageDependenciesIdentification;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (pdid != null) { if (pdid != null) {
this.jComboBoxPackageName.setSelectedItem(pdid.getName()); this.jComboBoxPackageName.setSelectedItem(pdid.getName());
this.jTextFieldPackageVersion.setText(pdid.getVersion()); this.jTextFieldPackageVersion.setText(pdid.getVersion());
@ -240,9 +247,9 @@ public class PackageDepDlg extends IDialog implements ItemListener {
* This is the default constructor * This is the default constructor
* *
*/ */
public PackageDepDlg(PackageDependenciesIdentification inPackageDependenciesIdentification, IFrame iFrame) { public PackageDepDlg(PackageDependenciesIdentification inPackageDependenciesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inPackageDependenciesIdentification); init(inPackageDependenciesIdentification, mid);
} }
/** /**

View File

@ -274,7 +274,15 @@ public class PpisDlg extends IDialog implements ItemListener {
private void init(PpisIdentification inPpisId, ModuleIdentification mid) { private void init(PpisIdentification inPpisId, ModuleIdentification mid) {
init(); init();
this.id = inPpisId; this.id = inPpisId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined ppis from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid); Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) { if (vpid.size() <= 0) {
Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added"); Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");

View File

@ -290,6 +290,14 @@ public class ProtocolsDlg extends IDialog implements ItemListener {
init(); init();
this.id = inProtocolsId; this.id = inProtocolsId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
//
// Get defined protocols from dependent packages
//
Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid); Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
if (vpid.size() <= 0) { if (vpid.size() <= 0) {
Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added"); Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");

View File

@ -35,7 +35,9 @@ import org.tianocore.frameworkwizard.common.ui.IComboBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification; import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/** /**
* The class is used to create, update SourceFiles section of the MSA file * The class is used to create, update SourceFiles section of the MSA file
@ -99,6 +101,8 @@ public class SourceFilesDlg extends IDialog {
private String msaFileName = ""; private String msaFileName = "";
private EnumerationData ed = new EnumerationData(); private EnumerationData ed = new EnumerationData();
private WorkspaceTools wt = new WorkspaceTools();
/** /**
This method initializes jTextFieldFileName This method initializes jTextFieldFileName
@ -261,9 +265,9 @@ public class SourceFilesDlg extends IDialog {
This is the default constructor This is the default constructor
**/ **/
public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, String fileName) { public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inSourceFilesIdentification, fileName); init(inSourceFilesIdentification, mid);
} }
/** /**
@ -287,10 +291,14 @@ public class SourceFilesDlg extends IDialog {
@param inSourceFiles The input data of SourceFilesDocument.SourceFiles @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
**/ **/
private void init(SourceFilesIdentification inSourceFilesIdentifications, String fileName) { private void init(SourceFilesIdentification inSourceFilesIdentifications, ModuleIdentification mid) {
init(); init();
//this.sfid = inSourceFilesIdentifications; this.msaFileName = mid.getPath();
this.msaFileName = fileName;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (inSourceFilesIdentifications != null) { if (inSourceFilesIdentifications != null) {
this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename()); this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename());

View File

@ -35,6 +35,7 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification; import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
@ -252,10 +253,15 @@ public class SystemTablesDlg extends IDialog {
* @param inSystemTablesId * @param inSystemTablesId
* *
*/ */
private void init(SystemTablesIdentification inSystemTablesId) { private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {
init(); init();
this.id = inSystemTablesId; this.id = inSystemTablesId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jComboBoxGuidC_Name.setSelectedItem(id.getName()); this.jComboBoxGuidC_Name.setSelectedItem(id.getName());
this.jComboBoxUsage.setSelectedItem(id.getUsage()); this.jComboBoxUsage.setSelectedItem(id.getUsage());
@ -272,9 +278,9 @@ public class SystemTablesDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame) { public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inSystemTablesIdentification); init(inSystemTablesIdentification, mid);
} }
/** /**

View File

@ -35,6 +35,7 @@ import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IDialog;
import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification; import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
@ -273,9 +274,14 @@ public class VariablesDlg extends IDialog {
* @param inVariablesId * @param inVariablesId
* *
*/ */
private void init(VariablesIdentification inVariablesId) { private void init(VariablesIdentification inVariablesId, ModuleIdentification mid) {
init(); init();
this.id = inVariablesId; this.id = inVariablesId;
//
// Init arch with module's arch
//
this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
if (this.id != null) { if (this.id != null) {
this.jTextFieldVariableName.setText(id.getName()); this.jTextFieldVariableName.setText(id.getName());
@ -294,9 +300,9 @@ public class VariablesDlg extends IDialog {
* @param iFrame * @param iFrame
* *
*/ */
public VariablesDlg(VariablesIdentification inVariablesIdentification, IFrame iFrame) { public VariablesDlg(VariablesIdentification inVariablesIdentification, IFrame iFrame, ModuleIdentification mid) {
super(iFrame, true); super(iFrame, true);
init(inVariablesIdentification); init(inVariablesIdentification, mid);
} }
/** /**

View File

@ -467,12 +467,13 @@ public class WorkspaceTools {
Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING); Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
return vector; return vector;
} }
public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) { public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {
Vector<String> vector = new Vector<String>(); Vector<String> vector = new Vector<String>();
for (int index = 0; index < vpid.size(); index++) { for (int index = 0; index < vpid.size(); index++) {
Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList
.getPackageSurfaceAreaFromId(vpid.get(index))); .getPackageSurfaceAreaFromId(vpid
.get(index)));
if (v != null && v.size() > 0) { if (v != null && v.size() > 0) {
vector.addAll(v); vector.addAll(v);
} }
@ -804,7 +805,7 @@ public class WorkspaceTools {
} }
return vpid; return vpid;
} }
public Vector<String> getAllModuleGuidXref() { public Vector<String> getAllModuleGuidXref() {
Vector<String> v = new Vector<String>(); Vector<String> v = new Vector<String>();
for (int index = 0; index < GlobalData.openingModuleList.size(); index++) { for (int index = 0; index < GlobalData.openingModuleList.size(); index++) {
@ -813,4 +814,18 @@ public class WorkspaceTools {
} }
return v; return v;
} }
public Vector<String> getModuleArch(ModuleIdentification id) {
Vector<String> v = new Vector<String>();
ModuleSurfaceArea msa = null;
if (id != null) {
msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(id);
}
if (msa != null) {
if (msa.getModuleDefinitions() != null) {
v = Tools.convertListToVector(msa.getModuleDefinitions().getSupportedArchitectures());
}
}
return v;
}
} }