Replaced set*(null) with unset*() to clear empty attributes that were causing invalid SPD files. Tracker EDK137

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1023 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lhauch
2006-07-16 07:50:47 +00:00
parent 2f8a751769
commit 97796eaa70
2 changed files with 171 additions and 123 deletions

View File

@ -337,15 +337,25 @@ public class SpdFileContents {
lc.setHelpText(hlp); lc.setHelpText(hlp);
if (clsUsage != null) { if (clsUsage != null) {
lc.setRecommendedInstanceGuid(clsUsage); lc.setRecommendedInstanceGuid(clsUsage);
}
if (instanceVer != null){ if (instanceVer != null){
lc.setRecommendedInstanceVersion(instanceVer); lc.setRecommendedInstanceVersion(instanceVer);
} else {
lc.unsetRecommendedInstanceVersion();
} }
} else {
lc.unsetRecommendedInstanceGuid();
lc.unsetRecommendedInstanceVersion();
}
if (stringToList(hdrAttribArch) != null){ if (stringToList(hdrAttribArch) != null){
lc.setSupArchList(stringToList(hdrAttribArch)); lc.setSupArchList(stringToList(hdrAttribArch));
} else {
lc.unsetSupArchList();
} }
if (stringToList(hdrAttribModType) != null){ if (stringToList(hdrAttribModType) != null){
lc.setSupModuleList(stringToList(hdrAttribModType)); lc.setSupModuleList(stringToList(hdrAttribModType));
} else {
lc.unsetSupModuleList();
} }
} }
@ -390,19 +400,19 @@ public class SpdFileContents {
e.setGuidTypeList(stringToList(guidTypeList)); e.setGuidTypeList(stringToList(guidTypeList));
} }
else{ else{
e.setGuidTypeList(null); e.unsetGuidTypeList();
} }
if (stringToList(archList) != null){ if (stringToList(archList) != null){
e.setSupArchList(stringToList(archList)); e.setSupArchList(stringToList(archList));
} }
else{ else{
e.setSupArchList(null); e.unsetSupArchList();
} }
if (stringToList(modTypeList) != null) { if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList)); e.setSupModuleList(stringToList(modTypeList));
} }
else{ else{
e.setSupModuleList(null); e.unsetSupModuleList();
} }
} }
@ -430,13 +440,13 @@ public class SpdFileContents {
e.setSupArchList(stringToList(archList)); e.setSupArchList(stringToList(archList));
} }
else{ else{
e.setSupArchList(null); e.unsetSupArchList();
} }
if (stringToList(modTypeList) != null) { if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList)); e.setSupModuleList(stringToList(modTypeList));
} }
else{ else{
e.setSupModuleList(null); e.unsetSupModuleList();
} }
} }
cursor.dispose(); cursor.dispose();
@ -463,13 +473,13 @@ public class SpdFileContents {
e.setSupArchList(stringToList(archList)); e.setSupArchList(stringToList(archList));
} }
else{ else{
e.setSupArchList(null); e.unsetSupArchList();
} }
if (stringToList(modTypeList) != null) { if (stringToList(modTypeList) != null) {
e.setSupModuleList(stringToList(modTypeList)); e.setSupModuleList(stringToList(modTypeList));
} }
else{ else{
e.setSupModuleList(null); e.unsetSupModuleList();
} }
} }
cursor.dispose(); cursor.dispose();
@ -580,12 +590,14 @@ public class SpdFileContents {
libClass[i][1] = lc.getIncludeHeader(); libClass[i][1] = lc.getIncludeHeader();
libClass[i][2] = lc.getHelpText(); libClass[i][2] = lc.getHelpText();
// LAH added logic so you cannot set the version unless the GUID is defined. // LAH added logic so you cannot set the version unless the GUID is defined.
/* LAH do not set now
if (lc.getRecommendedInstanceGuid() != null) { if (lc.getRecommendedInstanceGuid() != null) {
libClass[i][3] = lc.getRecommendedInstanceGuid(); libClass[i][3] = lc.getRecommendedInstanceGuid();
if (lc.getRecommendedInstanceVersion() != null) { if (lc.getRecommendedInstanceVersion() != null) {
libClass[i][4] = lc.getRecommendedInstanceVersion(); libClass[i][4] = lc.getRecommendedInstanceVersion();
} }
} }
*/
if (lc.getSupArchList() != null) { if (lc.getSupArchList() != null) {
libClass[i][5] = listToString(lc.getSupArchList()); libClass[i][5] = listToString(lc.getSupArchList());
} }
@ -967,17 +979,21 @@ public class SpdFileContents {
lc.setIncludeHeader(clsIncludeFile); lc.setIncludeHeader(clsIncludeFile);
lc.setHelpText(help); lc.setHelpText(help);
// LAH added logic so you cannot set the version unless the GUID is defined. // LAH added logic so you cannot set the version unless the GUID is defined.
/* LAH
if (clsUsage != null) { if (clsUsage != null) {
lc.setRecommendedInstanceGuid(clsUsage); lc.setRecommendedInstanceGuid(clsUsage);
if (instanceVer != null) { if (instanceVer != null) {
lc.setRecommendedInstanceVersion(instanceVer); lc.setRecommendedInstanceVersion(instanceVer);
} }
} }
*/
if (hdrAttribArch != null) { if (hdrAttribArch != null) {
lc.setSupArchList(stringToList(hdrAttribArch)); lc.setSupArchList(stringToList(hdrAttribArch));
} }
if (hdrAttribModType != null) { if (hdrAttribModType != null) {
lc.setSupModuleList(stringToList(hdrAttribModType)); lc.setSupModuleList(stringToList(hdrAttribModType));
} else {
lc.unsetSupModuleList();
} }
} }
@ -1261,9 +1277,13 @@ public class SpdFileContents {
pe.setHelpText(help); pe.setHelpText(help);
if (archList != null){ if (archList != null){
pe.setSupArchList(stringToList(archList)); pe.setSupArchList(stringToList(archList));
} else {
pe.unsetSupArchList();
} }
if (modTypeList != null){ if (modTypeList != null){
pe.setSupModuleList(stringToList(modTypeList)); pe.setSupModuleList(stringToList(modTypeList));
} else {
pe.unsetSupModuleList();
} }
} }

View File

@ -87,11 +87,11 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private JButton jButtonRemove = null; private JButton jButtonRemove = null;
private JButton jButtonClearAll = null; private JButton jButtonRemoveAll = null;
private JLabel jLabel = null; private JLabel jLabelHdr = null;
private JTextField jTextField = null; private JTextField jTextFieldHdr = null;
private JButton jButtonBrowse = null; private JButton jButtonBrowse = null;
@ -127,16 +127,24 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private JLabel jLabel6SupModList = null; private JLabel jLabel6SupModList = null;
private JScrollPane jScrollPaneArch = null; private JScrollPane jScrollPaneModules = null;
private JScrollPane jScrollPane1 = null; private JScrollPane jScrollPane1Arch = null;
private ICheckBoxList iCheckBoxListArch = null; private ICheckBoxList iCheckBoxListModules = null;
private ICheckBoxList iCheckBoxList = null; private ICheckBoxList iCheckBoxList = null;
private JComboBox jComboBox = null; private JComboBox jComboBox = null;
private int cnClassName = 0;
private int cnHdrFile = 1;
private int cnHelpText = 2;
private int cnRecInstName = 3;
private int cnRecInstVer = 4;
private int cnSupArch = 5;
private int cnSupMod = 6;
HashMap<String, String> libNameGuidMap = new HashMap<String, String>(); HashMap<String, String> libNameGuidMap = new HashMap<String, String>();
@ -185,12 +193,15 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
This method initializes jScrollPane This method initializes jScrollPane
@return javax.swing.JScrollPane @return javax.swing.JScrollPane
Used for the Table of Library Classes that are provided by this package
**/ **/
private JScrollPane getJScrollPane() { private JScrollPane getJScrollPane() {
if (jScrollPane == null) { if (jScrollPane == null) {
jScrollPane = new JScrollPane(); jScrollPane = new JScrollPane();
jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253)); jScrollPane.setBounds(new java.awt.Rectangle(12,351,608,253));
jScrollPane.setPreferredSize(new java.awt.Dimension(330,150)); jScrollPane.setPreferredSize(new java.awt.Dimension(390,150));
jScrollPane.setViewportView(getJTable()); jScrollPane.setViewportView(getJTable());
} }
return jScrollPane; return jScrollPane;
@ -206,14 +217,17 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
model = new DefaultTableModel(); model = new DefaultTableModel();
jTable = new JTable(model); jTable = new JTable(model);
jTable.setRowHeight(20); jTable.setRowHeight(20);
jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); // jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
model.addColumn("Library Class"); jTable.setColumnSelectionAllowed(false);
model.addColumn("Include Header"); model.addColumn("Class Name");
model.addColumn("HelpText"); model.addColumn("Header");
model.addColumn("Recommended Instance"); model.addColumn("Help Text");
model.addColumn("Version"); model.addColumn("Reserved");
model.addColumn("Supported Arch"); model.addColumn("Reserved");
model.addColumn("Supported Module"); // model.addColumn("Recommended Instance");
// model.addColumn("Version");
model.addColumn("Sup. Arch");
model.addColumn("Mod. Types");
Vector<String> vArch = new Vector<String>(); Vector<String> vArch = new Vector<String>();
vArch.add("IA32"); vArch.add("IA32");
@ -222,7 +236,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
vArch.add("EBC"); vArch.add("EBC");
vArch.add("ARM"); vArch.add("ARM");
vArch.add("PPC"); vArch.add("PPC");
jTable.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vArch)); // jTable.getColumnModel().getColumn(cnSupArch).setCellEditor(new ListEditor(vArch));
Vector<String> vModule = new Vector<String>(); Vector<String> vModule = new Vector<String>();
vModule.add("BASE"); vModule.add("BASE");
@ -236,9 +250,10 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
vModule.add("DXE_SMM_DRIVER"); vModule.add("DXE_SMM_DRIVER");
vModule.add("UEFI_DRIVER"); vModule.add("UEFI_DRIVER");
vModule.add("UEFI_APPLICATION"); vModule.add("UEFI_APPLICATION");
vModule.add("TOOLS");
vModule.add("USER_DEFINED"); vModule.add("USER_DEFINED");
jTable.getColumnModel().getColumn(6).setCellEditor(new ListEditor(vModule)); vModule.add("NONE");
jTable.getColumnModel().getColumn(cnSupMod).setCellEditor(new ListEditor(vModule));
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
@ -268,18 +283,22 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
int row = arg0.getFirstRow(); int row = arg0.getFirstRow();
TableModel m = (TableModel)arg0.getSource(); TableModel m = (TableModel)arg0.getSource();
if (arg0.getType() == TableModelEvent.UPDATE){ if (arg0.getType() == TableModelEvent.UPDATE){
String lib = m.getValueAt(row, 0) + ""; String lib = m.getValueAt(row, cnClassName) + "";
String hdr = m.getValueAt(row, 1) + ""; String hdr = m.getValueAt(row, cnHdrFile) + "";
String hlp = m.getValueAt(row, 2) + ""; String hlp = m.getValueAt(row, cnHelpText) + "";
String name = m.getValueAt(row, 3) + ""; String name = m.getValueAt(row, cnRecInstName) + "";
String ver = m.getValueAt(row, 4) + ""; String ver = m.getValueAt(row, cnRecInstVer) + "";
String arch = null; String arch = null;
if (m.getValueAt(row, 5) != null) { if (m.getValueAt(row, cnSupArch) != null) {
arch = m.getValueAt(row, 5).toString(); arch = m.getValueAt(row, cnSupArch).toString();
} }
String module = null; String module = null;
if (m.getValueAt(row, 6) != null) { // if (lsm.isSelectionEmpty()) {
module = m.getValueAt(row, 6).toString(); if (m.getValueAt(row, cnSupMod) != null) {
module = m.getValueAt(row, cnSupMod).toString();
if (module == "NONE") {
module = null;
}
} }
String[] rowData = {lib, hdr, hlp}; String[] rowData = {lib, hdr, hlp};
if (!dataValidation(rowData)) { if (!dataValidation(rowData)) {
@ -287,10 +306,12 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
} }
docConsole.setSaved(false); docConsole.setSaved(false);
getLibInstances(lib); // LAH getLibInstances(lib);
String guid = nameToGuid(name);
sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module); // LAH String guid = nameToGuid(name);
// LAH WAS sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);
sfc.updateSpdLibClass(row, lib, hdr, hlp, null, null, arch, module);
} }
} }
@ -303,8 +324,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
if (jButtonAdd == null) { if (jButtonAdd == null) {
jButtonAdd = new JButton(); jButtonAdd = new JButton();
jButtonAdd.setText("Add"); jButtonAdd.setText("Add");
jButtonAdd.setSize(new java.awt.Dimension(80,20)); jButtonAdd.setSize(new java.awt.Dimension(99,20));
jButtonAdd.setLocation(new java.awt.Point(359,326)); jButtonAdd.setLocation(new java.awt.Point(321,326));
jButtonAdd.addActionListener(this); jButtonAdd.addActionListener(this);
} }
return jButtonAdd; return jButtonAdd;
@ -319,8 +340,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
if (jButtonRemove == null) { if (jButtonRemove == null) {
jButtonRemove = new JButton(); jButtonRemove = new JButton();
jButtonRemove.setText("Remove"); jButtonRemove.setText("Remove");
jButtonRemove.setSize(new java.awt.Dimension(80,20)); jButtonRemove.setSize(new java.awt.Dimension(99,20));
jButtonRemove.setLocation(new java.awt.Point(443,326)); jButtonRemove.setLocation(new java.awt.Point(424,326));
jButtonRemove.addActionListener(this); jButtonRemove.addActionListener(this);
} }
return jButtonRemove; return jButtonRemove;
@ -331,15 +352,15 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
@return javax.swing.JButton @return javax.swing.JButton
**/ **/
private JButton getJButtonClearAll() { private JButton getJButtonRemoveAll() {
if (jButtonClearAll == null) { if (jButtonRemoveAll == null) {
jButtonClearAll = new JButton(); jButtonRemoveAll = new JButton();
jButtonClearAll.setText("Clear All"); jButtonRemoveAll.setText("Remove All");
jButtonClearAll.setSize(new java.awt.Dimension(86,20)); jButtonRemoveAll.setSize(new java.awt.Dimension(99,20));
jButtonClearAll.setLocation(new java.awt.Point(530,326)); jButtonRemoveAll.setLocation(new java.awt.Point(527,326));
jButtonClearAll.addActionListener(this); jButtonRemoveAll.addActionListener(this);
} }
return jButtonClearAll; return jButtonRemoveAll;
} }
/** /**
@ -406,7 +427,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private JScrollPane getJContentPane(){ private JScrollPane getJContentPane(){
if (topScrollPane == null){ if (topScrollPane == null){
topScrollPane = new JScrollPane(); topScrollPane = new JScrollPane();
topScrollPane.setSize(new java.awt.Dimension(634,500)); topScrollPane.setSize(new java.awt.Dimension(634,590));
topScrollPane.setViewportView(getJContentPane1()); topScrollPane.setViewportView(getJContentPane1());
} }
return topScrollPane; return topScrollPane;
@ -418,10 +439,32 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
**/ **/
private JPanel getJContentPane1() { private JPanel getJContentPane1() {
if (jContentPane == null) { if (jContentPane == null) {
// Library Class
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(1,7));
jLabel1ClassName = new JLabel();
jLabel1ClassName.setBounds(new java.awt.Rectangle(16,6,82,20));
jLabel1ClassName.setText("Library Class");
// Help Text
starLabel = new StarLabel();
starLabel.setBounds(new java.awt.Rectangle(1,33,10,20));
jLabel2HelpText = new JLabel();
jLabel2HelpText.setBounds(new java.awt.Rectangle(16,33,82,20));
jLabel2HelpText.setText("Help Text");
// Header File
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(1,74));
jLabelHdr = new JLabel();
jLabelHdr.setBounds(new java.awt.Rectangle(14,74,199,22));
jLabelHdr.setText("Include Header for Specified Class");
jLabel6SupModList = new JLabel(); jLabel6SupModList = new JLabel();
jLabel6SupModList.setBounds(new java.awt.Rectangle(16,252,108,16)); jLabel6SupModList.setBounds(new java.awt.Rectangle(16,252,108,16));
jLabel6SupModList.setText("Supported Module"); jLabel6SupModList.setText("Supported Module");
jLabel6SupModList.setEnabled(true); jLabel6SupModList.setEnabled(true);
jLabel5SupArchList = new JLabel(); jLabel5SupArchList = new JLabel();
jLabel5SupArchList.setBounds(new java.awt.Rectangle(15,169,93,16)); jLabel5SupArchList.setBounds(new java.awt.Rectangle(15,169,93,16));
jLabel5SupArchList.setText("Supported Arch"); jLabel5SupArchList.setText("Supported Arch");
@ -434,26 +477,11 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jLabel3RecInstName.setBounds(new java.awt.Rectangle(17,112,195,16)); jLabel3RecInstName.setBounds(new java.awt.Rectangle(17,112,195,16));
jLabel3RecInstName.setEnabled(true); jLabel3RecInstName.setEnabled(true);
jLabel3RecInstName.setText("Recommended Instance Name"); jLabel3RecInstName.setText("Recommended Instance Name");
jLabel2HelpText = new JLabel();
jLabel2HelpText.setBounds(new java.awt.Rectangle(16,33,82,20));
jLabel2HelpText.setText("Help Text");
starLabel = new StarLabel();
starLabel.setBounds(new java.awt.Rectangle(1,33,10,20));
jLabel1ClassName = new JLabel();
jLabel1ClassName.setBounds(new java.awt.Rectangle(16,6,82,20));
jLabel1ClassName.setText("Library Class");
jStarLabel1 = new StarLabel();
jStarLabel1.setLocation(new java.awt.Point(1,7));
jStarLabel2 = new StarLabel();
jStarLabel2.setLocation(new java.awt.Point(-1,74));
jLabel = new JLabel();
jLabel.setBounds(new java.awt.Rectangle(14,74,199,22));
jLabel.setText("Include Header for Specified Class");
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setPreferredSize(new Dimension(480, 400)); jContentPane.setPreferredSize(new Dimension(480, 400));
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.add(jLabel, null); jContentPane.add(jLabelHdr, null);
jContentPane.add(jStarLabel1, null); jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null); jContentPane.add(jStarLabel2, null);
jContentPane.add(getJTextFieldAdd(), null); jContentPane.add(getJTextFieldAdd(), null);
@ -461,9 +489,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jContentPane.add(getJScrollPane(), null); jContentPane.add(getJScrollPane(), null);
jContentPane.add(getJButtonAdd(), null); jContentPane.add(getJButtonAdd(), null);
jContentPane.add(getJButtonRemove(), null); jContentPane.add(getJButtonRemove(), null);
jContentPane.add(getJButtonClearAll(), null); jContentPane.add(getJButtonRemoveAll(), null);
jContentPane.add(getJTextField(), null); jContentPane.add(getJTextFieldHdr(), null);
jContentPane.add(getJButtonBrowse(), null); jContentPane.add(getJButtonBrowse(), null);
jContentPane.add(jLabel1ClassName, null); jContentPane.add(jLabel1ClassName, null);
jContentPane.add(starLabel, null); jContentPane.add(starLabel, null);
@ -477,8 +505,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jContentPane.add(jLabel5SupArchList, null); jContentPane.add(jLabel5SupArchList, null);
jContentPane.add(jLabel6SupModList, null); jContentPane.add(jLabel6SupModList, null);
jContentPane.add(getJScrollPaneArch(), null); jContentPane.add(getJScrollPaneModules(), null);
jContentPane.add(getJScrollPane1(), null); jContentPane.add(getJScrollPane1Arch(), null);
// LAH jContentPane.add(getJComboBox(), null); // LAH jContentPane.add(getJComboBox(), null);
} }
@ -541,16 +569,16 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
//ToDo: check before add //ToDo: check before add
// LAH WAS String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2RecInstVer.getText(), null, null}; // LAH WAS String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2RecInstVer.getText(), null, null};
String[] row = {null, null, null, null, null, null, null}; String[] row = {null, null, null, null, null, null, null};
row[0] = jTextFieldAdd.getText(); row[cnClassName] = jTextFieldAdd.getText();
row[1] = jTextField.getText().replace('\\', '/'); row[cnHdrFile] = jTextFieldHdr.getText().replace('\\', '/');
row[2] = jTextFieldHelp.getText(); row[cnHelpText] = jTextFieldHelp.getText();
row[5] = vectorToString(iCheckBoxList.getAllCheckedItemsString()); row[cnSupArch] = vectorToString(iCheckBoxList.getAllCheckedItemsString());
if (row[5].length() == 0){ if (row[cnSupArch].length() == 0) {
row[5] = null; row[cnSupArch] = null;
} }
row[6] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString()); row[cnSupMod] = vectorToString(iCheckBoxListModules.getAllCheckedItemsString());
if (row[6].length() == 0){ if (row[cnSupMod].length() == 0){
row[6] = null; row[cnSupMod] = null;
} }
if (!dataValidation(row)) { if (!dataValidation(row)) {
return; return;
@ -566,7 +594,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
// LAH recommendGuid = nameToGuid(row[3]); // LAH recommendGuid = nameToGuid(row[3]);
// LAH WAS sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]); // LAH WAS sfc.genSpdLibClassDeclarations(row[0], recommendGuid, row[1], row[2], row[5], null, null, row[4], null, row[6]);
sfc.genSpdLibClassDeclarations(row[0], null, row[1], row[2], row[5], null, null, row[4], null, row[6]); sfc.genSpdLibClassDeclarations(row[cnClassName], null, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, row[cnRecInstVer], null, row[cnSupMod]);
} }
// //
@ -583,7 +611,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
} }
} }
if (arg0.getSource() == jButtonClearAll) { if (arg0.getSource() == jButtonRemoveAll) {
if (model.getRowCount() == 0) { if (model.getRowCount() == 0) {
return; return;
} }
@ -594,15 +622,15 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
} }
private boolean dataValidation(String[] row) { private boolean dataValidation(String[] row) {
if (!DataValidation.isKeywordType(row[0])) { if (!DataValidation.isKeywordType(row[cnClassName])) {
JOptionPane.showMessageDialog(frame, "Library Class is NOT KeyWord Type."); JOptionPane.showMessageDialog(frame, "Library Class is NOT KeyWord Type.");
return false; return false;
} }
if (!DataValidation.isPathAndFilename(row[1])) { if (!DataValidation.isPathAndFilename(row[cnHdrFile])) {
JOptionPane.showMessageDialog(frame, "Include Header is NOT PathAndFilename Type."); JOptionPane.showMessageDialog(frame, "Include Header is NOT PathAndFilename Type.");
} }
if (row[2].length() == 0) { if (row[cnHelpText].length() == 0) {
JOptionPane.showMessageDialog(frame, "HelpText could NOT be empty."); JOptionPane.showMessageDialog(frame, "Help Text Must NOT be empty.");
} }
return true; return true;
} }
@ -618,13 +646,13 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
@return javax.swing.JTextField @return javax.swing.JTextField
**/ **/
private JTextField getJTextField() { private JTextField getJTextFieldHdr() {
if (jTextField == null) { if (jTextFieldHdr == null) {
jTextField = new JTextField(); jTextFieldHdr = new JTextField();
jTextField.setBounds(new java.awt.Rectangle(218,75,290,21)); jTextFieldHdr.setBounds(new java.awt.Rectangle(218,75,305,21));
jTextField.setPreferredSize(new java.awt.Dimension(260,20)); jTextFieldHdr.setPreferredSize(new java.awt.Dimension(260,20));
} }
return jTextField; return jTextFieldHdr;
} }
/** /**
@ -635,9 +663,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private JButton getJButtonBrowse() { private JButton getJButtonBrowse() {
if (jButtonBrowse == null) { if (jButtonBrowse == null) {
jButtonBrowse = new JButton(); jButtonBrowse = new JButton();
jButtonBrowse.setBounds(new java.awt.Rectangle(528,75,90,20)); jButtonBrowse.setBounds(new java.awt.Rectangle(527,75,90,20));
jButtonBrowse.setText("Browse"); jButtonBrowse.setText("Browse");
jButtonBrowse.setPreferredSize(new java.awt.Dimension(80,20)); jButtonBrowse.setPreferredSize(new java.awt.Dimension(99,20));
jButtonBrowse.addActionListener(new AbstractAction() { jButtonBrowse.addActionListener(new AbstractAction() {
/** /**
@ -674,7 +702,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
headerDest = theFile.getPath(); headerDest = theFile.getPath();
int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length()); int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length());
jTextField.setText(headerDest.substring(fileIndex + 1).replace('\\', '/')); jTextFieldHdr.setText(headerDest.substring(fileIndex + 1).replace('\\', '/'));
} }
@ -688,7 +716,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth); resizeComponentWidth(this.jTextFieldAdd, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth); resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth); resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth-10);
} }
/** /**
@ -734,20 +762,20 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
return jTextField2RecInstVer; return jTextField2RecInstVer;
} }
private JScrollPane getJScrollPaneArch() { private JScrollPane getJScrollPaneModules() {
if (jScrollPaneArch == null) { if (jScrollPaneModules == null) {
jScrollPaneArch = new JScrollPane(); jScrollPaneModules = new JScrollPane();
jScrollPaneArch.setBounds(new java.awt.Rectangle(218,245,293,73)); jScrollPaneModules.setBounds(new java.awt.Rectangle(218,245,293,73));
jScrollPaneArch.setPreferredSize(new java.awt.Dimension(320, 80)); jScrollPaneModules.setPreferredSize(new java.awt.Dimension(320, 80));
jScrollPaneArch.setViewportView(getICheckBoxListSupportedArchitectures()); jScrollPaneModules.setViewportView(getICheckBoxListSupportedModules());
} }
return jScrollPaneArch; return jScrollPaneModules;
} }
private ICheckBoxList getICheckBoxListSupportedArchitectures() { private ICheckBoxList getICheckBoxListSupportedModules() {
if (iCheckBoxListArch == null) { if (iCheckBoxListModules == null) {
iCheckBoxListArch = new ICheckBoxList(); iCheckBoxListModules = new ICheckBoxList();
iCheckBoxListArch.setBounds(new java.awt.Rectangle(218,246,292,73)); iCheckBoxListModules.setBounds(new java.awt.Rectangle(218,246,292,73));
Vector<String> v = new Vector<String>(); Vector<String> v = new Vector<String>();
v.add("BASE"); v.add("BASE");
v.add("SEC"); v.add("SEC");
@ -761,9 +789,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
v.add("UEFI_DRIVER"); v.add("UEFI_DRIVER");
v.add("UEFI_APPLICATION"); v.add("UEFI_APPLICATION");
v.add("USER_DEFINED"); v.add("USER_DEFINED");
iCheckBoxListArch.setAllItems(v); iCheckBoxListModules.setAllItems(v);
} }
return iCheckBoxListArch; return iCheckBoxListModules;
} }
private String vectorToString(Vector<String> v) { private String vectorToString(Vector<String> v) {
@ -775,14 +803,14 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
return s.trim(); return s.trim();
} }
private JScrollPane getJScrollPane1() { private JScrollPane getJScrollPane1Arch() {
if (jScrollPane1 == null) { if (jScrollPane1Arch == null) {
jScrollPane1 = new JScrollPane(); jScrollPane1Arch = new JScrollPane();
jScrollPane1.setBounds(new java.awt.Rectangle(218,170,293,73)); jScrollPane1Arch.setBounds(new java.awt.Rectangle(218,170,293,73));
jScrollPane1.setPreferredSize(new java.awt.Dimension(320, 80)); jScrollPane1Arch.setPreferredSize(new java.awt.Dimension(320, 80));
jScrollPane1.setViewportView(getICheckBoxList()); jScrollPane1Arch.setViewportView(getICheckBoxList());
} }
return jScrollPane1; return jScrollPane1Arch;
} }
/** /**
* This method initializes iCheckBoxList * This method initializes iCheckBoxList