1. Add scroll bars to Package Library Class Declarations editor.

2. Add GuidType UI support to protocol and ppi declarations according to latest schema.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1081 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16
2006-07-24 08:16:26 +00:00
parent a8bcbf3d11
commit 1be13d3fdd
4 changed files with 60 additions and 29 deletions

View File

@ -436,7 +436,7 @@ public class SpdFileContents {
} }
public void updateSpdPpiDecl(int i, String name, String cName, String guid, String hlp, String archList, public void updateSpdPpiDecl(int i, String name, String cName, String guid, String hlp, String archList,
String modTypeList){ String modTypeList, String guidTypeList){
XmlObject o = psaRoot.getPpiDeclarations(); XmlObject o = psaRoot.getPpiDeclarations();
if (o == null){ if (o == null){
return; return;
@ -452,6 +452,14 @@ public class SpdFileContents {
e.setCName(cName); e.setCName(cName);
e.setGuidValue(guid); e.setGuidValue(guid);
e.setHelpText(hlp); e.setHelpText(hlp);
if (stringToList(guidTypeList) != null) {
e.setGuidTypeList(stringToList(guidTypeList));
}
else{
if (e.isSetGuidTypeList()) {
e.unsetGuidTypeList();
}
}
if (stringToList(archList) != null){ if (stringToList(archList) != null){
e.setSupArchList(stringToList(archList)); e.setSupArchList(stringToList(archList));
} }
@ -473,7 +481,7 @@ public class SpdFileContents {
} }
public void updateSpdProtocolDecl(int i, String name, String cName, String guid, String hlp, String archList, public void updateSpdProtocolDecl(int i, String name, String cName, String guid, String hlp, String archList,
String modTypeList){ String modTypeList, String guidTypeList){
XmlObject o = psaRoot.getProtocolDeclarations(); XmlObject o = psaRoot.getProtocolDeclarations();
if (o == null){ if (o == null){
return; return;
@ -489,6 +497,14 @@ public class SpdFileContents {
e.setCName(cName); e.setCName(cName);
e.setGuidValue(guid); e.setGuidValue(guid);
e.setHelpText(hlp); e.setHelpText(hlp);
if (stringToList(guidTypeList) != null) {
e.setGuidTypeList(stringToList(guidTypeList));
}
else{
if (e.isSetGuidTypeList()) {
e.unsetGuidTypeList();
}
}
if (stringToList(archList) != null){ if (stringToList(archList) != null){
e.setSupArchList(stringToList(archList)); e.setSupArchList(stringToList(archList));
} }
@ -792,6 +808,7 @@ public class SpdFileContents {
protocol[i][3] = e.getHelpText(); protocol[i][3] = e.getHelpText();
protocol[i][4] = listToString(e.getSupArchList()); protocol[i][4] = listToString(e.getSupArchList());
protocol[i][5] = listToString(e.getSupModuleList()); protocol[i][5] = listToString(e.getSupModuleList());
protocol[i][6] = listToString(e.getGuidTypeList());
i++; i++;
} }
} }
@ -831,7 +848,7 @@ public class SpdFileContents {
ppi[i][3] = e.getHelpText(); ppi[i][3] = e.getHelpText();
ppi[i][4] = listToString(e.getSupArchList()); ppi[i][4] = listToString(e.getSupArchList());
ppi[i][5] = listToString(e.getSupModuleList()); ppi[i][5] = listToString(e.getSupModuleList());
ppi[i][6] = listToString(e.getGuidTypeList());
i++; i++;
} }
} }
@ -1171,13 +1188,13 @@ public class SpdFileContents {
**/ **/
public void genSpdProtocolDeclarations(String protocolDeclEntryName, String protocolDeclCName, public void genSpdProtocolDeclarations(String protocolDeclEntryName, String protocolDeclCName,
String protocolDeclGuid, String protocolDeclFeatureFlag, String protocolDeclGuid, String protocolDeclFeatureFlag,
Vector<String> archList, Vector<String> modTypeList) { Vector<String> archList, Vector<String> modTypeList, Vector<String> guidTypeList) {
if (getSpdProtocolDeclarations() == null) { if (getSpdProtocolDeclarations() == null) {
spdProtocolDeclarations = psaRoot.addNewProtocolDeclarations(); spdProtocolDeclarations = psaRoot.addNewProtocolDeclarations();
} }
setSpdEntry(protocolDeclEntryName, protocolDeclCName, protocolDeclGuid, protocolDeclFeatureFlag, setSpdEntry(protocolDeclEntryName, protocolDeclCName, protocolDeclGuid, protocolDeclFeatureFlag,
archList, modTypeList, null, spdProtocolDeclarations); archList, modTypeList, guidTypeList, spdProtocolDeclarations);
} }
/** /**
@ -1189,12 +1206,12 @@ public class SpdFileContents {
@param ppiDeclFeatureFlag Reserved @param ppiDeclFeatureFlag Reserved
**/ **/
public void genSpdPpiDeclarations(String ppiDeclEntryName, String ppiDeclCName, String ppiDeclGuid, public void genSpdPpiDeclarations(String ppiDeclEntryName, String ppiDeclCName, String ppiDeclGuid,
String ppiDeclFeatureFlag, Vector<String> archList, Vector<String> modTypeList) { String ppiDeclFeatureFlag, Vector<String> archList, Vector<String> modTypeList, Vector<String> guidTypeList) {
if (getSpdPpiDeclarations() == null) { if (getSpdPpiDeclarations() == null) {
spdPpiDeclarations = psaRoot.addNewPpiDeclarations(); spdPpiDeclarations = psaRoot.addNewPpiDeclarations();
} }
setSpdEntry(ppiDeclEntryName, ppiDeclCName, ppiDeclGuid, ppiDeclFeatureFlag, archList, modTypeList, null, spdPpiDeclarations); setSpdEntry(ppiDeclEntryName, ppiDeclCName, ppiDeclGuid, ppiDeclFeatureFlag, archList, modTypeList, guidTypeList, spdPpiDeclarations);
} }
/** /**
@ -1250,6 +1267,14 @@ public class SpdFileContents {
pe.setCName(cName); pe.setCName(cName);
pe.setGuidValue(guid); pe.setGuidValue(guid);
pe.setHelpText(help); pe.setHelpText(help);
if (guidTypeList != null) {
pe.setGuidTypeList(guidTypeList);
}
else{
if (pe.isSetGuidTypeList()) {
pe.unsetGuidTypeList();
}
}
if (archList != null) { if (archList != null) {
pe.setSupArchList(archList); pe.setSupArchList(archList);
} }
@ -1276,6 +1301,14 @@ public class SpdFileContents {
ppe.setCName(cName); ppe.setCName(cName);
ppe.setGuidValue(guid); ppe.setGuidValue(guid);
ppe.setHelpText(help); ppe.setHelpText(help);
if (guidTypeList != null) {
ppe.setGuidTypeList(guidTypeList);
}
else{
if (ppe.isSetGuidTypeList()) {
ppe.unsetGuidTypeList();
}
}
if (archList != null) { if (archList != null) {
ppe.setSupArchList(archList); ppe.setSupArchList(archList);
} }

View File

@ -201,7 +201,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
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(390,150)); jScrollPane.setPreferredSize(new java.awt.Dimension(500,419));
jScrollPane.setViewportView(getJTable()); jScrollPane.setViewportView(getJTable());
} }
return jScrollPane; return jScrollPane;
@ -316,7 +316,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jButtonAdd = new JButton(); jButtonAdd = new JButton();
jButtonAdd.setText("Add"); jButtonAdd.setText("Add");
jButtonAdd.setSize(new java.awt.Dimension(99,20)); jButtonAdd.setSize(new java.awt.Dimension(99,20));
jButtonAdd.setLocation(new java.awt.Point(321,326)); jButtonAdd.setBounds(new java.awt.Rectangle(321,326,99,20));
jButtonAdd.addActionListener(this); jButtonAdd.addActionListener(this);
} }
return jButtonAdd; return jButtonAdd;
@ -332,7 +332,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jButtonRemove = new JButton(); jButtonRemove = new JButton();
jButtonRemove.setText("Remove"); jButtonRemove.setText("Remove");
jButtonRemove.setSize(new java.awt.Dimension(99,20)); jButtonRemove.setSize(new java.awt.Dimension(99,20));
jButtonRemove.setLocation(new java.awt.Point(424,326)); jButtonRemove.setBounds(new java.awt.Rectangle(424,326,99,20));
jButtonRemove.addActionListener(this); jButtonRemove.addActionListener(this);
} }
return jButtonRemove; return jButtonRemove;
@ -348,7 +348,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jButtonRemoveAll = new JButton(); jButtonRemoveAll = new JButton();
jButtonRemoveAll.setText("Remove All"); jButtonRemoveAll.setText("Remove All");
jButtonRemoveAll.setSize(new java.awt.Dimension(99,20)); jButtonRemoveAll.setSize(new java.awt.Dimension(99,20));
jButtonRemoveAll.setLocation(new java.awt.Point(527,326)); jButtonRemoveAll.setBounds(new java.awt.Rectangle(527,326,99,20));
jButtonRemoveAll.addActionListener(this); jButtonRemoveAll.addActionListener(this);
} }
return jButtonRemoveAll; return jButtonRemoveAll;
@ -418,7 +418,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,590)); // topScrollPane.setSize(new java.awt.Dimension(634,590));
topScrollPane.setViewportView(getJContentPane1()); topScrollPane.setViewportView(getJContentPane1());
} }
return topScrollPane; return topScrollPane;
@ -470,7 +470,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
jLabel3RecInstName.setText("Recommended Instance Name"); jLabel3RecInstName.setText("Recommended Instance Name");
jContentPane = new JPanel(); jContentPane = new JPanel();
jContentPane.setPreferredSize(new Dimension(480, 400)); jContentPane.setPreferredSize(new Dimension(680, 600));
jContentPane.setLayout(null); jContentPane.setLayout(null);
jContentPane.add(jLabelHdr, null); jContentPane.add(jLabelHdr, null);
jContentPane.add(jStarLabel1, null); jContentPane.add(jStarLabel1, null);

View File

@ -51,12 +51,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
protected void initFrame() { protected void initFrame() {
this.setTitle("PPI Declarations"); this.setTitle("PPI Declarations");
getJScrollPaneGuid().setVisible(false);
getJLabel3().setVisible(false);
getJTable().getColumn("GuidTypes").setPreferredWidth(0);
getJTable().getColumn("GuidTypes").setWidth(0);
getJTable().getColumn("GuidTypes").setHeaderValue(" ");
} }
protected void init(SpdFileContents sfc){ protected void init(SpdFileContents sfc){
@ -67,7 +62,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (sfc.getSpdPpiDeclarationCount() == 0) { if (sfc.getSpdPpiDeclarationCount() == 0) {
return ; return ;
} }
String[][] saa = new String[sfc.getSpdPpiDeclarationCount()][6]; String[][] saa = new String[sfc.getSpdPpiDeclarationCount()][7];
sfc.getSpdPpiDeclarations(saa); sfc.getSpdPpiDeclarations(saa);
int i = 0; int i = 0;
while (i < saa.length) { while (i < saa.length) {
@ -89,12 +84,16 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (m.getValueAt(row, 5) != null) { if (m.getValueAt(row, 5) != null) {
modTypeList = m.getValueAt(row, 5).toString(); modTypeList = m.getValueAt(row, 5).toString();
} }
String guidTypeList = null;
if (m.getValueAt(row, 6) != null) {
guidTypeList = m.getValueAt(row, 6).toString();
}
String[] rowData = {name, cName, guid, help}; String[] rowData = {name, cName, guid, help};
if (!dataValidation(rowData)){ if (!dataValidation(rowData)){
return; return;
} }
docConsole.setSaved(false); docConsole.setSaved(false);
sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList); sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
} }
protected void addRow(String[] row) { protected void addRow(String[] row) {
@ -103,7 +102,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
return; return;
} }
docConsole.setSaved(false); docConsole.setSaved(false);
sfc.genSpdPpiDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5])); sfc.genSpdPpiDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
} }
protected void removeRow(int i){ protected void removeRow(int i){

View File

@ -51,12 +51,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
protected void initFrame() { protected void initFrame() {
this.setTitle("Protocol Declarations"); this.setTitle("Protocol Declarations");
getJScrollPaneGuid().setVisible(false);
getJLabel3().setVisible(false);
getJTable().getColumn("GuidTypes").setPreferredWidth(0);
getJTable().getColumn("GuidTypes").setWidth(0);
getJTable().getColumn("GuidTypes").setHeaderValue(" ");
} }
protected void init(SpdFileContents sfc){ protected void init(SpdFileContents sfc){
@ -67,7 +62,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
if (sfc.getSpdProtocolDeclarationCount() == 0) { if (sfc.getSpdProtocolDeclarationCount() == 0) {
return ; return ;
} }
String[][] saa = new String[sfc.getSpdProtocolDeclarationCount()][6]; String[][] saa = new String[sfc.getSpdProtocolDeclarationCount()][7];
sfc.getSpdProtocolDeclarations(saa); sfc.getSpdProtocolDeclarations(saa);
int i = 0; int i = 0;
while (i < saa.length) { while (i < saa.length) {
@ -90,12 +85,16 @@ public class SpdProtocolDecls extends SpdGuidDecls {
if (m.getValueAt(row, 5) != null) { if (m.getValueAt(row, 5) != null) {
modTypeList = m.getValueAt(row, 5).toString(); modTypeList = m.getValueAt(row, 5).toString();
} }
String guidTypeList = null;
if (m.getValueAt(row, 6) != null) {
guidTypeList = m.getValueAt(row, 6).toString();
}
String[] rowData = {name, cName, guid, help}; String[] rowData = {name, cName, guid, help};
if (!dataValidation(rowData)){ if (!dataValidation(rowData)){
return; return;
} }
docConsole.setSaved(false); docConsole.setSaved(false);
sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList); sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
} }
protected void addRow(String[] row) { protected void addRow(String[] row) {
@ -103,7 +102,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
return; return;
} }
docConsole.setSaved(false); docConsole.setSaved(false);
sfc.genSpdProtocolDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5])); sfc.genSpdProtocolDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
} }
protected void removeRow(int i){ protected void removeRow(int i){