1. Fix the bug missing TokenSpaceGuidCName when editing a pcd entry in Msa
2. Fix the bug missing EventType selection when editing events in Msa
3. Fix the bug missing adding new node under moduledescription when creating a new package
4. Fix the bug in DataValidation
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@996 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/Tools/Source/FrameworkWizard/FrameworkWizard.msa b/Tools/Source/FrameworkWizard/FrameworkWizard.msa
index 233289b..b007e09 100644
--- a/Tools/Source/FrameworkWizard/FrameworkWizard.msa
+++ b/Tools/Source/FrameworkWizard/FrameworkWizard.msa
@@ -127,6 +127,8 @@
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java</Filename>
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java</Filename>
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java</Filename>
+ <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java</Filename>
+ <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java</Filename>
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java</Filename>
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java</Filename>
<Filename>src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java</Filename>
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
index 1da3259..71e50f3 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
@@ -1795,7 +1795,8 @@
int result = cso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "Create Far Done!";
- JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
+ JOptionPane.INFORMATION_MESSAGE);
}
cso.dispose();
}
@@ -1805,7 +1806,8 @@
int result = iso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Install Far Done! <br>The WORKSPACE will be refreshed!</html>";
- JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
+ JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
iso.dispose();
@@ -1816,7 +1818,8 @@
int result = dso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Delete Far Done! <br>The WORKSPACE will be refreshed!</html>";
- JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
+ JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
dso.dispose();
@@ -1827,7 +1830,8 @@
int result = uso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Update Far Done! <br>The WORKSPACE will be refreshed!</html>";
- JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
+ JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
uso.dispose();
@@ -2872,13 +2876,23 @@
e.printStackTrace();
}
vPackageList.addElement(smb.getPid());
+
+ //
+ // Add to Module Description node
+ //
+ IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(),
+ IDefaultMutableTreeNode.MODULE_PACKAGE,
+ false, vPackageList.lastElement());
+
+ iTree.addNode(dmtnModuleDescription, node);
+
//
// Add new SpdHeader node to the tree
//
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(),
- IDefaultMutableTreeNode.SPD_HEADER, true,
- vPackageList.lastElement());
+ node = new IDefaultMutableTreeNode(vPackageList.lastElement().getName(),
+ IDefaultMutableTreeNode.SPD_HEADER, true, vPackageList.lastElement());
iTree.addNode(dmtnPackageDescription, node);
+
this.openPackage(smb.getPid().getPath());
}
} else if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
index 402f428..aeff9ac 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
@@ -309,7 +309,7 @@
**/
public static boolean isHexWordArrayType(String arg0) {
- return isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0);
+ return arg0.length() <=6 && isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0);
}
/**
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
index 8cb8dc0..0bfca45 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
@@ -28,6 +28,8 @@
import javax.swing.JOptionPane;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
@@ -50,25 +52,25 @@
**/
public static void main(String[] args) {
System.out.println(getCurrentDateTime());
-// Vector<String> v = new Vector<String>();
-// Vector<String> v1 = new Vector<String>();
-//
-// v.addElement("CAC");
-// v1.addElement("1111");
-// v.addElement("1AC");
-// v1.addElement("2222");
-// v.addElement("ABC");
-// v1.addElement("3333");
-// v.addElement("0C");
-// v1.addElement("4444");
-// v.addElement("AAC");
-// v1.addElement("5555");
-// Vector<Integer> vs = new Vector<Integer>();
-// vs = Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending);
-// Tools.sortVectorString(v1, Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending));
-//
-// Tools.sortVectorString(v, DataType.Sort_Type_Ascending);
-// Tools.sortVectorString(v, DataType.Sort_Type_Descending);
+ // Vector<String> v = new Vector<String>();
+ // Vector<String> v1 = new Vector<String>();
+ //
+ // v.addElement("CAC");
+ // v1.addElement("1111");
+ // v.addElement("1AC");
+ // v1.addElement("2222");
+ // v.addElement("ABC");
+ // v1.addElement("3333");
+ // v.addElement("0C");
+ // v1.addElement("4444");
+ // v.addElement("AAC");
+ // v1.addElement("5555");
+ // Vector<Integer> vs = new Vector<Integer>();
+ // vs = Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending);
+ // Tools.sortVectorString(v1, Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending));
+ //
+ // Tools.sortVectorString(v, DataType.Sort_Type_Ascending);
+ // Tools.sortVectorString(v, DataType.Sort_Type_Descending);
}
/**
@@ -166,27 +168,27 @@
}
}
}
-
+
/**
- Generate selection items for JList by input vector
-
- **/
- public static void generateListByVector(JList jl, Vector<String> vector) {
- if (jl != null) {
- DefaultListModel listModel = (DefaultListModel) jl.getModel();
- listModel.removeAllElements();
-
- if (vector != null) {
- for (int index = 0; index < vector.size(); index++) {
- listModel.addElement(vector.get(index));
- }
- }
-
- if (listModel.size() > 0) {
- jl.setSelectedIndex(0);
- }
- }
- }
+ Generate selection items for JList by input vector
+
+ **/
+ public static void generateListByVector(JList jl, Vector<String> vector) {
+ if (jl != null) {
+ DefaultListModel listModel = (DefaultListModel) jl.getModel();
+ listModel.removeAllElements();
+
+ if (vector != null) {
+ for (int index = 0; index < vector.size(); index++) {
+ listModel.addElement(vector.get(index));
+ }
+ }
+
+ if (listModel.size() > 0) {
+ jl.setSelectedIndex(0);
+ }
+ }
+ }
/**
Get path only from a path
@@ -395,7 +397,7 @@
String tempStr = v.get(indexI);
v.setElementAt(v.get(indexJ), indexI);
v.setElementAt(tempStr, indexJ);
-
+
//
// Swap sequences
//
@@ -427,14 +429,14 @@
}
}
}
-
+
/**
Sort all modules
@param v
@param mode
-
- **/
+
+ **/
public static void sortModules(Vector<ModuleIdentification> v, int mode) {
if (v != null) {
//
@@ -452,54 +454,79 @@
}
}
}
+
+ /**
+ Sort all packages
+
+ @param v
+ @param mode
+
+ **/
+ public static void sortPackages(Vector<PackageIdentification> v, int mode) {
+ if (v != null) {
+ //
+ // sort by name
+ //
+ for (int indexI = 0; indexI < v.size(); indexI++) {
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
+ if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
+ || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
+ PackageIdentification temp = v.get(indexI);
+ v.setElementAt(v.get(indexJ), indexI);
+ v.setElementAt(temp, indexJ);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ Sort all platforms
+
+ @param v
+ @param mode
+
+ **/
+ public static void sortPlatforms(Vector<PlatformIdentification> v, int mode) {
+ if (v != null) {
+ //
+ // sort by name
+ //
+ for (int indexI = 0; indexI < v.size(); indexI++) {
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
+ if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
+ || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
+ PlatformIdentification temp = v.get(indexI);
+ v.setElementAt(v.get(indexJ), indexI);
+ v.setElementAt(temp, indexJ);
+ }
+ }
+ }
+ }
+ }
/**
- Sort all packages
+ Sort all pcd entries
+
+ @param v
+ @param mode
- @param v
- @param mode
-
- **/
- public static void sortPackages(Vector<PackageIdentification> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PackageIdentification temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all platforms
-
- @param v
- @param mode
-
- **/
- public static void sortPlatforms(Vector<PlatformIdentification> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PlatformIdentification temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
+ **/
+ public static void sortPcds(PcdVector v, int mode) {
+ if (v != null) {
+ //
+ // sort by name
+ //
+ for (int indexI = 0; indexI < v.size(); indexI++) {
+ for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
+ if ((v.getPcd(indexJ).getName().compareTo(v.getPcd(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
+ || (v.getPcd(indexI).getName().compareTo(v.getPcd(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
+ PcdIdentification temp = v.getPcd(indexI);
+ v.setPcd(v.getPcd(indexJ), indexI);
+ v.setPcd(temp, indexJ);
+ }
+ }
+ }
+ }
+ }
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
index 5691232..24e1683 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
@@ -33,14 +33,17 @@
private String featureFlag = null;
private String help = null;
+
+ private String group = null;
- public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
+ public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5, String arg6) {
this.name = (arg0 == null ? "" : arg0);
this.type = (arg1 == null ? "" : arg1);
this.usage = (arg2 == null ? "" : arg2);
this.featureFlag = (arg3 == null ? "" : arg3);
this.supArchList = arg4;
this.help = (arg5 == null ? "" : arg5);
+ this.group = (arg6 == null ? "" : arg6);
}
public String getFeatureFlag() {
@@ -97,4 +100,12 @@
public void setHelp(String help) {
this.help = help;
}
+
+ public String getGroup() {
+ return group;
+ }
+
+ public void setGroup(String group) {
+ this.group = group;
+ }
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
index 7d8529f..e5d6e91 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
@@ -1,6 +1,6 @@
/** @file
- The file is used to define Package Dependencies Vector
+ The file is used to define PcdCoded Vector
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDefinitions.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDefinitions.java
index 8fd573c..5732035 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDefinitions.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDefinitions.java
@@ -26,7 +26,6 @@
import org.tianocore.ModuleDefinitionsDocument;
import org.tianocore.ModuleSurfaceAreaDocument;
import org.tianocore.ModuleDefinitionsDocument.ModuleDefinitions.ClonedFrom;
-import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.EnumerationData;
import org.tianocore.frameworkwizard.common.Log;
@@ -137,7 +136,12 @@
if (iCheckBoxListArch == null) {
iCheckBoxListArch = new ICheckBoxList();
iCheckBoxListArch.addFocusListener(this);
- iCheckBoxListArch.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
+ iCheckBoxListArch.setToolTipText("<html>Deselecting a checkbox will restrict this module<br>" +
+ "for use with the selected architectures, <br>" +
+ "based on the list of items that are checked. <br>" +
+ "If all boxes are checked, <br>" +
+ "then the module will support all <br>" +
+ "current AND FUTURE architectures</html>");
}
return iCheckBoxListArch;
}
@@ -153,7 +157,14 @@
jComboBoxBinaryModule.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
jComboBoxBinaryModule.setPreferredSize(new java.awt.Dimension(320, 20));
jComboBoxBinaryModule.addFocusListener(this);
- jComboBoxBinaryModule.setToolTipText("Modules are either source modules which can be compiled or binary modules which are linked. A module cannot contain both. The GUID numbers should be identical for a binary and source MSA, but the BINARY MSA should have a higher version number.");
+ jComboBoxBinaryModule.setToolTipText("<html>Modules are either source modules <br>" +
+ "which can be compiled or binary <br>" +
+ "modules which are linked. <br>" +
+ "A module cannot contain both. <br>" +
+ "The GUID numbers should be identical <br>" +
+ "for a binary and source MSA, <br>" +
+ "but the BINARY MSA should have <br>" +
+ "a higher version number.</html>");
}
return jComboBoxBinaryModule;
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
index 676b7ac..52d4ff9 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
@@ -27,6 +27,7 @@
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
+import org.tianocore.EventTypes;
import org.tianocore.EventsDocument;
import org.tianocore.ProtocolNotifyUsage;
import org.tianocore.ProtocolUsage;
@@ -239,7 +240,8 @@
Vector<String> arg4 = Tools.convertListToVector(events.getCreateEvents().getEventTypesList()
.get(index).getSupArchList());
String arg5 = events.getCreateEvents().getEventTypesList().get(index).getHelpText();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ String arg6 = events.getCreateEvents().getEventTypesList().get(index).getEventType().toString();
+ id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
vid.addEvents(id);
}
}
@@ -258,7 +260,8 @@
Vector<String> arg4 = Tools.convertListToVector(events.getSignalEvents().getEventTypesList()
.get(index).getSupArchList());
String arg5 = events.getSignalEvents().getEventTypesList().get(index).getHelpText();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ String arg6 = events.getSignalEvents().getEventTypesList().get(index).getEventType().toString();
+ id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
vid.addEvents(id);
}
}
@@ -422,6 +425,9 @@
if (!isEmpty(vid.getEvents(index).getHelp())) {
e.setHelpText(vid.getEvents(index).getHelp());
}
+ if (!isEmpty(vid.getEvents(index).getGroup())) {
+ e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
+ }
ce.addNewEventTypes();
ce.setEventTypesArray(ce.getEventTypesList().size() - 1, e);
}
@@ -443,6 +449,9 @@
if (!isEmpty(vid.getEvents(index).getHelp())) {
e.setHelpText(vid.getEvents(index).getHelp());
}
+ if (!isEmpty(vid.getEvents(index).getGroup())) {
+ e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
+ }
se.addNewEventTypes();
se.setEventTypesArray(ce.getEventTypesList().size() - 1, e);
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
index 250eb9d..c529bc0 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
@@ -27,6 +27,7 @@
import javax.swing.JTextArea;
import javax.swing.JTextField;
+import org.tianocore.ModuleDefinitionsDocument;
import org.tianocore.ModuleSurfaceAreaDocument;
import org.tianocore.ModuleTypeDef;
import org.tianocore.MsaHeaderDocument;
@@ -134,6 +135,8 @@
private JScrollPane jScrollPane = null;
private OpeningModuleType omt = null;
+
+ private EnumerationData ed = new EnumerationData();
/**
This method initializes jTextFieldBaseName
@@ -235,6 +238,8 @@
jTextAreaDescription.setLineWrap(true);
jTextAreaDescription.addFocusListener(this);
jTextAreaDescription.setToolTipText("A verbose description of the module");
+ jTextAreaDescription.setSelectionStart(0);
+ jTextAreaDescription.setSelectionEnd(0);
}
return jTextAreaDescription;
}
@@ -436,6 +441,17 @@
super();
this.omt = inMsa;
this.msa = omt.getXmlMsa();
+
+ //
+ // Set module definitions default value
+ //
+ if (msa.getModuleDefinitions() == null) {
+ ModuleDefinitionsDocument.ModuleDefinitions md = ModuleDefinitionsDocument.ModuleDefinitions.Factory.newInstance();
+ md.setOutputFileBasename(msa.getMsaHeader().getModuleName());
+ md.setBinaryModule(false);
+ md.setSupportedArchitectures(ed.getVSupportedArchitectures());
+ msa.setModuleDefinitions(md);
+ }
init(msa.getMsaHeader());
this.setVisible(true);
this.setViewMode(false);
@@ -506,12 +522,16 @@
}
if (this.msaHeader.getDescription() != null) {
this.jTextAreaDescription.setText(this.msaHeader.getDescription());
+ jTextAreaDescription.setSelectionStart(0);
+ jTextAreaDescription.setSelectionEnd(0);
}
if (this.msaHeader.getCopyright() != null) {
this.jTextFieldCopyright.setText(this.msaHeader.getCopyright());
}
if (this.msaHeader.getLicense() != null) {
this.jTextAreaLicense.setText(this.msaHeader.getLicense().getStringValue());
+ jTextAreaLicense.setSelectionStart(0);
+ jTextAreaLicense.setSelectionEnd(0);
}
if (this.msaHeader.getLicense() != null && this.msaHeader.getLicense().getURL() != null) {
this.jTextFieldURL.setText(this.msaHeader.getLicense().getURL());
@@ -795,6 +815,7 @@
// this.msaHeader.setSpecification(this.jTextFieldSpecification.getText());
msaHeader.setSpecification(this.jTextFieldSpecification.getText());
+ msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));
msa.setMsaHeader(msaHeader);
this.omt.setSaved(false);
} catch (Exception e) {
@@ -880,7 +901,7 @@
// Check Module Type
//
if (arg0.getSource() == this.jComboBoxModuleType) {
- msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));
+ //msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));
}
//
@@ -956,7 +977,7 @@
//this.jTextFieldCopyright.requestFocus();
return;
}
- this.msaHeader.setDescription(this.jTextFieldCopyright.getText());
+ this.msaHeader.setCopyright(this.jTextFieldCopyright.getText());
}
//
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
index 11510fd..663397d 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
@@ -62,12 +62,18 @@
private JComboBox jComboBoxGuidC_Name = null;
private JLabel jLabelUsage = null;
+
+ private JLabel jLabelGroup = null;
private JComboBox jComboBoxUsage = null;
+
+ private JComboBox jComboBoxEventGroup = null;
private StarLabel jStarLabel1 = null;
private StarLabel jStarLabel2 = null;
+
+ private StarLabel jStarLabel3 = null;
private JComboBox jComboBoxEventsType = null;
@@ -123,26 +129,42 @@
private JComboBox getJComboBoxUsage() {
if (jComboBoxUsage == null) {
jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
+ jComboBoxUsage.setBounds(new java.awt.Rectangle(160, 85, 320, 20));
jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
}
return jComboBoxUsage;
}
+
+ /**
+ This method initializes jComboBoxType
+
+ @return javax.swing.JComboBox jComboBoxType
+
+ **/
+ private JComboBox getJComboBoxEventsType() {
+ if (jComboBoxEventsType == null) {
+ jComboBoxEventsType = new JComboBox();
+ jComboBoxEventsType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
+ jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxEventsType
+ .setToolTipText("<html>Select Create event if the Module has an event that<br> 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.</html>");
+ }
+ return jComboBoxEventsType;
+ }
/**
* This method initializes jComboBoxEventsType
*
* @return javax.swing.JComboBox
*/
- private JComboBox getJComboBoxEventsType() {
- if (jComboBoxEventsType == null) {
- jComboBoxEventsType = new JComboBox();
- jComboBoxEventsType.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
- jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));
- 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.");
+ private JComboBox getJComboBoxEventGroup() {
+ if (jComboBoxEventGroup == null) {
+ jComboBoxEventGroup = new JComboBox();
+ jComboBoxEventGroup.setBounds(new java.awt.Rectangle(160, 60, 320, 20));
+ jComboBoxEventGroup.setPreferredSize(new java.awt.Dimension(320, 20));
+
}
- return jComboBoxEventsType;
+ return jComboBoxEventGroup;
}
/**
@@ -166,7 +188,7 @@
private JTextField getJTextFieldFeatureFlag() {
if (jTextFieldFeatureFlag == null) {
jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 110, 320, 20));
+ jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(160, 135, 320, 20));
jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
}
return jTextFieldFeatureFlag;
@@ -181,7 +203,7 @@
private JTextField getJTextFieldHelpText() {
if (jTextFieldHelpText == null) {
jTextFieldHelpText = new JTextField();
- jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 85, 320, 20));
+ jTextFieldHelpText.setBounds(new java.awt.Rectangle(160, 110, 320, 20));
jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));
}
return jTextFieldHelpText;
@@ -196,7 +218,7 @@
private JButton getJButtonOk() {
if (jButtonOk == null) {
jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 165, 90, 20));
+ jButtonOk.setBounds(new java.awt.Rectangle(290, 190, 90, 20));
jButtonOk.setText("Ok");
jButtonOk.addActionListener(this);
}
@@ -212,7 +234,7 @@
private JButton getJButtonCancel() {
if (jButtonCancel == null) {
jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 165, 90, 20));
+ jButtonCancel.setBounds(new java.awt.Rectangle(390, 190, 90, 20));
jButtonCancel.setText("Cancel");
jButtonCancel.addActionListener(this);
}
@@ -228,7 +250,7 @@
**/
private void init() {
- this.setSize(500, 225);
+ this.setSize(500, 255);
this.setContentPane(getJScrollPane());
this.setTitle("Events");
initFrame();
@@ -255,6 +277,7 @@
jTextFieldFeatureFlag.setText(id.getFeatureFlag());
this.jArchCheckBox.setSelectedItems(id.getSupArchList());
+ this.jComboBoxEventGroup.setSelectedItem(id.getGroup());
}
}
@@ -295,29 +318,33 @@
jArchCheckBox.setBounds(new java.awt.Rectangle(160, 135, 320, 20));
jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 110, 140, 20));
+ jLabelFeatureFlag.setBounds(new java.awt.Rectangle(15, 135, 140, 20));
jLabelFeatureFlag.setText("Feature Flag");
jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(15, 135, 140, 20));
+ jLabelArch.setBounds(new java.awt.Rectangle(15, 160, 140, 20));
jLabelArch.setText("Arch");
jLabelUsage = new JLabel();
jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(15, 60, 140, 20));
+ jLabelUsage.setBounds(new java.awt.Rectangle(15, 85, 140, 20));
jLabelC_Name = new JLabel();
jLabelC_Name.setText("Guid C_Name");
jLabelC_Name.setBounds(new java.awt.Rectangle(15, 35, 140, 20));
+ jLabelGroup = new JLabel();
+ jLabelGroup.setText("Even Type");
+ jLabelGroup.setBounds(new java.awt.Rectangle(15, 60, 140, 20));
jLabelEventType = new JLabel();
- jLabelEventType.setText("Event Type");
+ jLabelEventType.setText("Type");
jLabelEventType.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(14, 85, 140, 20));
+ jLabelHelpText.setBounds(new java.awt.Rectangle(14, 110, 140, 20));
jLabelHelpText.setText("Help Text");
jContentPane = new JPanel();
jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 190));
+ jContentPane.setPreferredSize(new java.awt.Dimension(490, 220));
jContentPane.add(jLabelEventType, null);
+ jContentPane.add(jLabelGroup, null);
jContentPane.add(jLabelC_Name, null);
jContentPane.add(getJComboBoxGuidC_Name(), null);
jContentPane.add(jLabelUsage, null);
@@ -326,9 +353,12 @@
jStarLabel1.setBounds(new java.awt.Rectangle(0, 10, 10, 20));
jStarLabel2 = new StarLabel();
jStarLabel2.setBounds(new java.awt.Rectangle(0, 35, 10, 20));
-
+ jStarLabel3 = new StarLabel();
+ jStarLabel3.setBounds(new java.awt.Rectangle(0, 60, 10, 20));
+
jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null);
+ jContentPane.add(jStarLabel3, null);
jContentPane.add(getJComboBoxEventsType(), null);
jContentPane.add(jLabelArch, null);
@@ -339,6 +369,7 @@
jContentPane.add(jArchCheckBox, null);
jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null);
+ jContentPane.add(getJComboBoxEventGroup(), null);
}
return jContentPane;
}
@@ -349,6 +380,7 @@
**/
private void initFrame() {
Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());
+ Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());
Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());
Tools.generateComboBoxByVector(jComboBoxGuidC_Name, wt.getAllGuidDeclarationsFromWorkspace());
}
@@ -422,7 +454,8 @@
String arg3 = this.jTextFieldFeatureFlag.getText();
Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
String arg5 = this.jTextFieldHelpText.getText();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
+ String arg6 = this.jComboBoxEventGroup.getSelectedItem().toString();
+ id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
return id;
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
index 7972926..463cb3c 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
@@ -15,6 +15,8 @@
package org.tianocore.frameworkwizard.module.ui.dialog;
import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
import java.util.Vector;
import javax.swing.JButton;
@@ -26,7 +28,6 @@
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
@@ -34,16 +35,15 @@
import org.tianocore.frameworkwizard.common.ui.IFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
/**
The class is used to create, update PCD of MSA/MBD file
It extends IInternalFrame
-
-
**/
-public class PCDsDlg extends IDialog {
+public class PCDsDlg extends IDialog implements ItemListener {
///
/// Define class Serial Version UID
@@ -100,10 +100,10 @@
//
private PcdCodedIdentification id = null;
- private EnumerationData ed = new EnumerationData();
-
private WorkspaceTools wt = new WorkspaceTools();
+ private PcdVector pcd = wt.getAllPcdDeclarationsFromWorkspace();
+
/**
This method initializes jComboBoxItemType
@@ -130,6 +130,8 @@
jComboBoxCName = new JComboBox();
jComboBoxCName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxCName.addItemListener(this);
+ //jComboBoxCName.addActionListener(this);
}
return jComboBoxCName;
}
@@ -374,8 +376,11 @@
**/
private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxCName, wt.getAllPcdDeclarationsFromWorkspace());
- Tools.generateComboBoxByVector(jComboBoxItemType, ed.getVPcdItemTypes());
+ for (int index = 0; index < pcd.size(); index++) {
+ jComboBoxCName.addItem(pcd.getPcd(index));
+ }
+
+ //Tools.generateComboBoxByVector(jComboBoxItemType, ed.getVPcdItemTypes());
}
/* (non-Javadoc)
@@ -424,12 +429,12 @@
//
// Check TokenSpaceGuid
//
- // if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {
- // if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {
- // Log.err("Incorrect data type for Token Space C_Name");
- // return false;
- // }
- // }
+ if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {
+ if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {
+ Log.err("Incorrect data type for the selected pcd entry, please check in in spd file");
+ return false;
+ }
+ }
//
// Check DefaultValue
@@ -483,4 +488,26 @@
public void setId(PcdCodedIdentification id) {
this.id = id;
}
+
+ /* (non-Javadoc)
+ * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
+ *
+ * Reflesh the frame when selected item changed
+ *
+ */
+ public void itemStateChanged(ItemEvent arg0) {
+ int index = this.jComboBoxCName.getSelectedIndex();
+ if (arg0.getSource() == this.jComboBoxCName && arg0.getStateChange() == ItemEvent.SELECTED ) {
+ if (pcd.getPcd(index).getGuidCName() == null || isEmpty(pcd.getPcd(index).getGuidCName())
+ || pcd.getPcd(index).getType() == null || pcd.getPcd(index).getHelp() == null || isEmpty(pcd.getPcd(index).getHelp())) {
+ Log.err("select pcd entry when editing msa", "The selected is defined incorrectly.\r\nPlease check it in spd file");
+ } else {
+ this.jTextFieldTokenSpaceGuid.setText(pcd.getPcd(index).getGuidCName());
+ Tools.generateComboBoxByVector(this.jComboBoxItemType, pcd.getPcd(index).getType());
+ this.jTextFieldHelpText.setText(pcd.getPcd(index).getHelp());
+ this.jTextFieldHelpText.setSelectionStart(0);
+ this.jTextFieldHelpText.setSelectionEnd(0);
+ }
+ }
+ }
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
index 7aff45a..3f39727 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
@@ -503,6 +503,14 @@
jTextFieldSpecification.setText(sfc.getSpdHdrSpec());
}
sfc.setSpdHdrSpec(jTextFieldSpecification.getText());
+
+ if (!sfc.getSpdPkgDefsRdOnly().equals("true")) {
+ sfc.setSpdPkgDefsRdOnly("false");
+ }
+ if (!sfc.getSpdPkgDefsRePkg().equals("true")) {
+ sfc.setSpdPkgDefsRePkg("false");
+ }
+
}
/**
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
index 46c325e..19ed620 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
@@ -41,6 +41,8 @@
import org.tianocore.frameworkwizard.far.FarHeader;
import org.tianocore.frameworkwizard.far.FarIdentification;
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;
+import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
import org.tianocore.frameworkwizard.packaging.PackageIdentification;
import org.tianocore.frameworkwizard.platform.PlatformIdentification;
@@ -538,16 +540,22 @@
@return Vector
**/
- public Vector<String> getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {
- Vector<String> vector = new Vector<String>();
+ public PcdVector getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {
+ PcdVector vector = new PcdVector();
if (spd.getPcdDeclarations() != null) {
if (spd.getPcdDeclarations().getPcdEntryList().size() > 0) {
for (int index = 0; index < spd.getPcdDeclarations().getPcdEntryList().size(); index++) {
- vector.addElement(spd.getPcdDeclarations().getPcdEntryList().get(index).getCName());
+ String name = spd.getPcdDeclarations().getPcdEntryList().get(index).getCName();
+ String guidCName = spd.getPcdDeclarations().getPcdEntryList().get(index).getTokenSpaceGuidCName();
+ String help = spd.getPcdDeclarations().getPcdEntryList().get(index).getHelpText();
+ Vector<String> type = Tools.convertListToVector(spd.getPcdDeclarations().getPcdEntryList()
+ .get(index).getValidUsage());
+
+ vector.addPcd(new PcdIdentification(name, guidCName, help, type));
}
}
}
- Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
+ Tools.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}
@@ -657,17 +665,16 @@
return vector;
}
- public Vector<String> getAllPcdDeclarationsFromWorkspace() {
+ public PcdVector getAllPcdDeclarationsFromWorkspace() {
//
// First get all packages
//
this.getAllPackages();
- Vector<String> vector = new Vector<String>();
+ PcdVector vector = new PcdVector();
for (int index = 0; index < this.vPackageList.size(); index++) {
try {
- Vector<String> v = getAllPcdDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index)
- .getPath()));
+ PcdVector v = getAllPcdDeclarationsFromPackage(OpenFile.openSpdFile(vPackageList.get(index).getPath()));
if (v != null && v.size() > 0) {
vector.addAll(v);
}
@@ -679,7 +686,7 @@
// TODO Auto-generated catch block
}
}
- Tools.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
+ Tools.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
return vector;
}