diff options
author | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-22 23:54:09 +0000 |
---|---|---|
committer | jlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-22 23:54:09 +0000 |
commit | 5f97c029843ca4ab400c750b38487e45f4d4af19 (patch) | |
tree | 763bf35d85e0f6cbc6ea393e8c434c5eb768b747 /Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard | |
parent | 8a11d13aa30c03625afd77034603e4c9de090da5 (diff) | |
download | edk2-5f97c029843ca4ab400c750b38487e45f4d4af19.zip edk2-5f97c029843ca4ab400c750b38487e45f4d4af19.tar.gz edk2-5f97c029843ca4ab400c750b38487e45f4d4af19.tar.bz2 |
Change radio button in package header editor to a label.
Force user to select GUID type when adding a GUID declaration.
Check duplicated PCD cName and toke value when adding a PCD declaration.
Change PCD token space text field to a drop-down list containing GUIDs with "TOKEN_SPACE_GUID" type and without type specified from GUID declarations in this package.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1355 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard')
7 files changed, 159 insertions, 68 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java index 00e7f81..922d135 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java @@ -730,6 +730,17 @@ public class SpdFileContents { }
}
+ public void getSpdGuidDeclWithType (Vector<String> vGuidCName, String type) {
+ if (psaRoot.getGuidDeclarations() == null) {
+ return;
+ }
+ List<GuidDeclarationsDocument.GuidDeclarations.Entry> l = psaRoot.getGuidDeclarations().getEntryList();
+ for (int i = 0; i < l.size(); ++i) {
+ if (l.get(i).getGuidTypeList() == null || l.get(i).getGuidTypeList().contains(type)) {
+ vGuidCName.add(l.get(i).getCName());
+ }
+ }
+ }
/**
Get the number of GUID declarations from the size of List
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java index 94e2e96..2b8f3dd 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java @@ -67,7 +67,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ private JPanel jContentPane = null;
- private JTextField jTextFieldAdd = null;
+ private JTextField jTextFieldGuid = null;
private JScrollPane jScrollPane = null;
@@ -107,11 +107,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,213"
- private JLabel jLabelVer = null;
+ private JLabel jLabelCName = null;
private GenGuidDialog guidDialog = null;
- private JTextField jTextFieldVersion = null;
+ private JTextField jTextFieldCName = null;
private JLabel jLabelHelp = null;
@@ -142,18 +142,18 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ }
/**
- This method initializes jTextFieldAdd
+ This method initializes jTextFieldGuid
@return javax.swing.JTextField
**/
- protected JTextField getJTextFieldAdd() {
- if (jTextFieldAdd == null) {
- jTextFieldAdd = new JTextField();
- jTextFieldAdd.setBounds(new java.awt.Rectangle(137,35,337,20));
- jTextFieldAdd.setPreferredSize(new java.awt.Dimension(335,20));
+ protected JTextField getJTextFieldGuid() {
+ if (jTextFieldGuid == null) {
+ jTextFieldGuid = new JTextField();
+ jTextFieldGuid.setBounds(new java.awt.Rectangle(137,60,435,20));
+ jTextFieldGuid.setPreferredSize(new java.awt.Dimension(200,20));
}
- return jTextFieldAdd;
+ return jTextFieldGuid;
}
/**
@@ -466,11 +466,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ jLabelHelp.setText("HelpText");
jLabelHelp.setSize(new java.awt.Dimension(109,20));
jLabelHelp.setLocation(new java.awt.Point(14,85));
- jLabelVer = new JLabel();
- jLabelVer.setBounds(new java.awt.Rectangle(14,60,111,20));
- jLabelVer.setText("C_Name");
+ jLabelCName = new JLabel();
+ jLabelCName.setBounds(new java.awt.Rectangle(14,35,111,20));
+ jLabelCName.setText("C_Name");
jLabelGuid = new JLabel();
- jLabelGuid.setBounds(new java.awt.Rectangle(15,35,112,20));
+ jLabelGuid.setBounds(new java.awt.Rectangle(15,60,112,20));
jLabelGuid.setText("Guid Value");
jLabelName = new JLabel();
jLabelName.setBounds(new java.awt.Rectangle(15,10,113,20));
@@ -491,9 +491,9 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ jContentPane.add(jStarLabel2, null);
jContentPane.add(jStarLabel3, null);
jContentPane.add(jStarLabel4, null);
- jContentPane.add(jLabelVer, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJTextFieldAdd(), null);
+ jContentPane.add(jLabelCName, null);
+ jContentPane.add(getJTextFieldCName(), null);
+ jContentPane.add(getJTextFieldGuid(), null);
jContentPane.add(getJScrollPane(), null);
jContentPane.add(getJButtonAdd(), null);
jContentPane.add(getJButtonRemove(), null);
@@ -545,8 +545,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ //ToDo: check before add
String[] row = {"", "", "", "", "", "", ""};
row[3] = jTextFieldHelp.getText();
- row[2] = jTextFieldAdd.getText();
- row[1] = jTextFieldVersion.getText();
+ row[2] = jTextFieldGuid.getText();
+ row[1] = jTextFieldCName.getText();
row[0] = jTextFieldName.getText();
row[4] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());
if (row[4].length() == 0) {
@@ -565,9 +565,12 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ return;
}
+ if (addRow(row) == -1) {
+ return;
+ }
model.addRow(row);
jTable.changeSelection(model.getRowCount()-1, 0, false, false);
- addRow(row);
+
}
//
// remove selected line
@@ -592,11 +595,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ }
if (arg0.getSource() == jButtonGen) {
- jTextFieldAdd.setText(Tools.generateUuidString());
+ jTextFieldGuid.setText(Tools.generateUuidString());
}
if (arg0.getActionCommand().equals("GenGuidValue")) {
- jTextFieldAdd.setText(guidDialog.getGuid());
+ jTextFieldGuid.setText(guidDialog.getGuid());
}
}
@@ -621,7 +624,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ return true;
}
- protected void addRow(String[] row) {
+ protected int addRow(String[] row) {
Vector<String> vArch = iCheckBoxListArch.getAllCheckedItemsString();
if (vArch.size() == 0) {
vArch = null;
@@ -634,10 +637,15 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ if (vguidType.size() == 0) {
vguidType = null;
}
+ if (vguidType == null) {
+ JOptionPane.showMessageDialog(this, "You must select one GUID type.");
+ return -1;
+ }
if (docConsole != null) {
docConsole.setSaved(false);
}
sfc.genSpdGuidDeclarations(row[0], row[1], row[2], row[3], vArch, vModType, vguidType);
+ return 0;
}
protected void removeRow(int i){
@@ -692,25 +700,25 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{ }
/**
- * This method initializes jTextFieldVersion
+ * This method initializes jTextFieldCName
*
* @return javax.swing.JTextField
*/
- protected JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(137,60,225,20));
- jTextFieldVersion.setPreferredSize(new java.awt.Dimension(225,20));
+ protected JTextField getJTextFieldCName() {
+ if (jTextFieldCName == null) {
+ jTextFieldCName = new JTextField();
+ jTextFieldCName.setBounds(new java.awt.Rectangle(137,35,337,20));
+ jTextFieldCName.setPreferredSize(new java.awt.Dimension(335,20));
}
- return jTextFieldVersion;
+ return jTextFieldCName;
}
public void componentResized(ComponentEvent arg0) {
int intPreferredWidth = 500;
Tools.resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
+
+ Tools.resizeComponentWidth(this.jTextFieldCName, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
Tools.relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40);
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java index 310d027..6f660f5 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java @@ -200,8 +200,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253));
- jScrollPane.setPreferredSize(new java.awt.Dimension(500,419));
+ jScrollPane.setBounds(new java.awt.Rectangle(12,351,400,253));
jScrollPane.setViewportView(getJTable());
}
return jScrollPane;
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java index 342f13d..018c377 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java @@ -21,7 +21,6 @@ import javax.swing.DefaultCellEditor; import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
-import javax.swing.JRadioButton;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.JComboBox;
@@ -68,7 +67,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe private JPanel jContentPane = null;
- private JRadioButton jRadioButtonSelect = null;
+ private JLabel jLabelSelect = null;
private JComboBox jComboBoxSelect = null;
@@ -117,15 +116,14 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe @return javax.swing.JRadioButton
**/
- private JRadioButton getJRadioButtonSelect() {
- if (jRadioButtonSelect == null) {
- jRadioButtonSelect = new JRadioButton();
- jRadioButtonSelect.setBounds(new java.awt.Rectangle(9,10,198,20));
- jRadioButtonSelect.setText("Select Existing ModuleType");
- jRadioButtonSelect.addActionListener(this);
- jRadioButtonSelect.setSelected(true);
+ private JLabel getJLabelSelect() {
+ if (jLabelSelect == null) {
+ jLabelSelect = new JLabel();
+ jLabelSelect.setBounds(new java.awt.Rectangle(14,10,198,20));
+ jLabelSelect.setText("Select ModuleType");
+
}
- return jRadioButtonSelect;
+ return jLabelSelect;
}
/**
@@ -321,7 +319,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe jContentPane.add(jLabel, null);
jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null);
- jContentPane.add(getJRadioButtonSelect(), null);
+ jContentPane.add(getJLabelSelect(), null);
jContentPane.add(getJComboBoxSelect(), null);
jContentPane.add(getJButtonAdd(), null);
jContentPane.add(getJButtonRemove(), null);
@@ -374,9 +372,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe if (arg0.getSource() == jButtonAdd) {
String strLibClass = "";
- if (jRadioButtonSelect.isSelected()) {
- strLibClass = jComboBoxSelect.getSelectedItem().toString();
- }
+ strLibClass = jComboBoxSelect.getSelectedItem().toString();
//ToDo: check before add
String[] row = {"", ""};
row[0] = strLibClass;
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java index cbcb5a9..8eeef72 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java @@ -102,7 +102,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ private JLabel jLabelTokenSpace = null;
- private JTextField jTextFieldTsGuid = null;
+ private JComboBox jComboBoxTsGuid = null;
private JLabel jLabelVarVal = null;
@@ -270,11 +270,12 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ }
}
});
- initFrame();
+
this.setVisible(true);
}
private void init(SpdFileContents sfc){
+ initFrame(sfc);
if (sfc.getSpdPcdDefinitionCount() == 0) {
return ;
}
@@ -379,7 +380,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jContentPane.add(jLabelItemType, null);
jContentPane.add(jLabelC_Name, null);
jContentPane.add(jLabelTokenSpace, null);
- jContentPane.add(getJTextFieldTsGuid(), null);
+ jContentPane.add(getJComboBoxTsGuid(), null);
jContentPane.add(jLabelVarVal, null);
jContentPane.add(getJTextFieldC_Name(), null);
jContentPane.add(jLabelToken, null);
@@ -431,7 +432,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jContentPane.add(jLabelTokenSpace, null);
**/
- private void initFrame() {
+ private void initFrame(SpdFileContents sfc) {
jComboBoxDataType.addItem("UINT8");
jComboBoxDataType.addItem("UINT16");
@@ -440,11 +441,17 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jComboBoxDataType.addItem("VOID*");
jComboBoxDataType.addItem("BOOLEAN");
jComboBoxDataType.setSelectedIndex(0);
+
+ Vector<String> vGuidCName = new Vector<String>();
+ sfc.getSpdGuidDeclWithType(vGuidCName, "TOKEN_SPACE_GUID");
+ for (int i = 0; i < vGuidCName.size(); ++i) {
+ jComboBoxTsGuid.addItem(vGuidCName.get(i));
+ }
}
public void actionPerformed(ActionEvent arg0) {
- docConsole.setSaved(false);
+
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();
@@ -455,6 +462,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ if (arg0.getSource() == jButtonAdd) {
//ToDo: check before add
+
boolean[] b = {jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected()};
if (!checkValidUsage(b)) {
return;
@@ -468,7 +476,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ modTypeList = null;
}
Object[] row = {jTextFieldC_Name.getText(), jTextFieldToken.getText(),
- jTextFieldTsGuid.getText(), jComboBoxDataType.getSelectedItem(),
+ jComboBoxTsGuid.getSelectedItem(), jComboBoxDataType.getSelectedItem(),
jTextFieldDefaultValue.getText(), jTextFieldHelp.getText(),
jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(),
jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected(),
@@ -476,6 +484,11 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ if (!dataValidation(row)) {
return;
}
+
+ if (tokenCNameExisted(jTextFieldToken.getText(), jTextFieldC_Name.getText())) {
+ return;
+ }
+
model.addRow(row);
jTable.changeSelection(model.getRowCount()-1, 0, false, false);
String usage = getValidUsage(jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected());
@@ -483,6 +496,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ usage = null;
}
sfc.genSpdPcdDefinitions(row[0]+"", row[1]+"", row[3]+"", usage, row[2]+"", row[4]+"", row[5]+"", archList, modTypeList);
+ docConsole.setSaved(false);
}
//
// remove selected line
@@ -495,6 +509,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ if (rowSelected >= 0) {
model.removeRow(rowSelected);
sfc.removeSpdPcdDefinition(rowSelected);
+ docConsole.setSaved(false);
}
}
@@ -504,6 +519,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ }
model.setRowCount(0);
sfc.removeSpdPcdDefinition();
+ docConsole.setSaved(false);
}
}
@@ -513,18 +529,17 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ }
/**
- * This method initializes jTextFieldTsGuid
+ * This method initializes jComboBoxTsGuid
*
- * @return javax.swing.JTextField
+ * @return javax.swing.JComboBox
*/
- private JTextField getJTextFieldTsGuid() {
- if (jTextFieldTsGuid == null) {
- jTextFieldTsGuid = new JTextField();
- jTextFieldTsGuid.setPreferredSize(new java.awt.Dimension(315,20));
- jTextFieldTsGuid.setSize(new java.awt.Dimension(317,20));
- jTextFieldTsGuid.setLocation(new java.awt.Point(156,58));
+ private JComboBox getJComboBoxTsGuid() {
+ if (jComboBoxTsGuid == null) {
+ jComboBoxTsGuid = new JComboBox();
+ jComboBoxTsGuid.setBounds(new java.awt.Rectangle(156,58,315,20));
+
}
- return jTextFieldTsGuid;
+ return jComboBoxTsGuid;
}
/**
@@ -609,7 +624,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ Tools.resizeComponentWidth(this.jTextFieldC_Name, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldToken, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldTsGuid, this.getWidth(), intPreferredWidth);
+ Tools.resizeComponentWidth(this.jComboBoxTsGuid, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);
Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
@@ -812,6 +827,16 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jCheckBoxFeatureFlag.setBounds(new java.awt.Rectangle(156,161,100,21));
jCheckBoxFeatureFlag.setText("Feature Flag");
jCheckBoxFeatureFlag.setPreferredSize(new java.awt.Dimension(21,20));
+ jCheckBoxFeatureFlag.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (jCheckBoxFeatureFlag.isSelected()) {
+ jCheckBoxPatchInMod.setSelected(false);
+ jCheckBoxFixedAtBuild.setSelected(false);
+ jCheckBoxDyn.setSelected(false);
+ jCheckBoxDynEx.setSelected(false);
+ }
+ }
+ });
}
return jCheckBoxFeatureFlag;
}
@@ -827,6 +852,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jCheckBoxFixedAtBuild.setBounds(new java.awt.Rectangle(312,133,108,20));
jCheckBoxFixedAtBuild.setText("Fixed at Build");
jCheckBoxFixedAtBuild.setPreferredSize(new java.awt.Dimension(21,20));
+ jCheckBoxFixedAtBuild.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (jCheckBoxFixedAtBuild.isSelected()) {
+ jCheckBoxFeatureFlag.setSelected(false);
+ }
+ }
+ });
}
return jCheckBoxFixedAtBuild;
}
@@ -842,6 +874,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jCheckBoxPatchInMod.setBounds(new java.awt.Rectangle(156,133,154,20));
jCheckBoxPatchInMod.setText("Patchable in Module");
jCheckBoxPatchInMod.setPreferredSize(new java.awt.Dimension(21,20));
+ jCheckBoxPatchInMod.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (jCheckBoxPatchInMod.isSelected()) {
+ jCheckBoxFeatureFlag.setSelected(false);
+ }
+ }
+ });
}
return jCheckBoxPatchInMod;
}
@@ -857,6 +896,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jCheckBoxDyn.setBounds(new java.awt.Rectangle(278,161,80,20));
jCheckBoxDyn.setText("Dynamic");
jCheckBoxDyn.setPreferredSize(new java.awt.Dimension(21,20));
+ jCheckBoxDyn.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (jCheckBoxDyn.isSelected()) {
+ jCheckBoxFeatureFlag.setSelected(false);
+ }
+ }
+ });
}
return jCheckBoxDyn;
}
@@ -872,6 +918,13 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ jCheckBoxDynEx.setBounds(new java.awt.Rectangle(371,161,99,20));
jCheckBoxDynEx.setText("DynamicEx");
jCheckBoxDynEx.setPreferredSize(new java.awt.Dimension(21,20));
+ jCheckBoxDynEx.addItemListener(new java.awt.event.ItemListener() {
+ public void itemStateChanged(java.awt.event.ItemEvent e) {
+ if (jCheckBoxDynEx.isSelected()) {
+ jCheckBoxFeatureFlag.setSelected(false);
+ }
+ }
+ });
}
return jCheckBoxDynEx;
}
@@ -897,6 +950,28 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{ return usage.trim();
}
+ private boolean tokenCNameExisted(String token, String cName) {
+ Integer inputToken = Integer.decode(token);
+
+ for (int i = 0; i < jTable.getRowCount(); ++i) {
+ if (jTable.getValueAt(i, 0).equals(cName)) {
+ JOptionPane.showMessageDialog(frame, "C_Name already existed in table.");
+ return true;
+ }
+ if (jTable.getValueAt(i, 1).equals(token)) {
+ JOptionPane.showMessageDialog(frame, "Token already existed in table.");
+ return true;
+ }
+ Integer tokenValue = Integer.decode(jTable.getValueAt(i, 1)+"");
+ if (tokenValue.equals(inputToken)) {
+ JOptionPane.showMessageDialog(frame, "Same token value already existed in table.");
+ return true;
+ }
+
+ }
+ return false;
+ }
+
private boolean checkValidUsage(boolean[] b) {
if (!(b[0] || b[1] || b[2] || b[3] || b[4])){
JOptionPane.showMessageDialog(frame, "You must specify at least one usage.");
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java index b33f8c7..9f6cec6 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java @@ -109,13 +109,14 @@ public class SpdPpiDecls extends SpdGuidDecls { sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
}
- protected void addRow(String[] row) {
+ protected int addRow(String[] row) {
if (!dataValidation(row)){
- return;
+ return -1;
}
docConsole.setSaved(false);
sfc.genSpdPpiDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
+ return 0;
}
protected void removeRow(int i){
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java index e545394..b188d12 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java @@ -110,12 +110,13 @@ public class SpdProtocolDecls extends SpdGuidDecls { sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
}
- protected void addRow(String[] row) {
+ protected int addRow(String[] row) {
if (!dataValidation(row)){
- return;
+ return -1;
}
docConsole.setSaved(false);
sfc.genSpdProtocolDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
+ return 0;
}
protected void removeRow(int i){
|