Adapt to new Main UI interface.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@782 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jlin16 2006-07-06 03:16:57 +00:00
parent 848e907b35
commit d6d24759a0
16 changed files with 273 additions and 51 deletions

View File

@ -2376,32 +2376,30 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private void showPlatformElement(int elementType, OpeningPlatformType fpd) { private void showPlatformElement(int elementType, OpeningPlatformType fpd) {
this.cleanDesktopPanePlatform(); this.cleanDesktopPanePlatform();
fpd.setSaved(false);
switch (elementType) { switch (elementType) {
case IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS: case IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS:
FpdPlatformDefs frmFpdPlatformDefs = new FpdPlatformDefs(fpd.getXmlFpd()); FpdPlatformDefs frmFpdPlatformDefs = new FpdPlatformDefs(fpd);
getJDesktopPanePlatform().add(frmFpdPlatformDefs, 1); getJDesktopPanePlatform().add(frmFpdPlatformDefs, 1);
break; break;
case IDefaultMutableTreeNode.FPD_PLATFORMHEADER: case IDefaultMutableTreeNode.FPD_PLATFORMHEADER:
FpdHeader frmFpdHeader = new FpdHeader(fpd.getXmlFpd()); FpdHeader frmFpdHeader = new FpdHeader(fpd);
getJDesktopPanePlatform().add(frmFpdHeader, 1); getJDesktopPanePlatform().add(frmFpdHeader, 1);
break; break;
case IDefaultMutableTreeNode.FPD_FLASH: case IDefaultMutableTreeNode.FPD_FLASH:
FpdFlash frmFpdFlash = new FpdFlash(fpd.getXmlFpd()); FpdFlash frmFpdFlash = new FpdFlash(fpd);
getJDesktopPanePlatform().add(frmFpdFlash, 1); getJDesktopPanePlatform().add(frmFpdFlash, 1);
break; break;
case IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES: case IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES:
FpdFrameworkModules frmFpdFrameworkModules = new FpdFrameworkModules(fpd.getXmlFpd()); FpdFrameworkModules frmFpdFrameworkModules = new FpdFrameworkModules(fpd);
getJDesktopPanePlatform().add(frmFpdFrameworkModules, 1); getJDesktopPanePlatform().add(frmFpdFrameworkModules, 1);
break; break;
case IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS: case IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS:
FpdDynamicPcdBuildDefinitions frmFpdDynamicPcdBuildDefinitions = new FpdDynamicPcdBuildDefinitions( FpdDynamicPcdBuildDefinitions frmFpdDynamicPcdBuildDefinitions = new FpdDynamicPcdBuildDefinitions(fpd);
fpd
.getXmlFpd());
getJDesktopPanePlatform().add(frmFpdDynamicPcdBuildDefinitions, 1); getJDesktopPanePlatform().add(frmFpdDynamicPcdBuildDefinitions, 1);
break; break;
case IDefaultMutableTreeNode.FPD_BUILDOPTIONS: case IDefaultMutableTreeNode.FPD_BUILDOPTIONS:
FpdBuildOptions frmFpdBuildOptions = new FpdBuildOptions(fpd.getXmlFpd()); FpdBuildOptions frmFpdBuildOptions = new FpdBuildOptions(fpd);
getJDesktopPanePlatform().add(frmFpdBuildOptions, 1); getJDesktopPanePlatform().add(frmFpdBuildOptions, 1);
break; break;
} }
@ -2419,42 +2417,41 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
private void showPackageElement(int elementType, OpeningPackageType spd) { private void showPackageElement(int elementType, OpeningPackageType spd) {
this.cleanDesktopPanePackage(); this.cleanDesktopPanePackage();
Tools.dirForNewSpd = spd.getId().getPath(); Tools.dirForNewSpd = spd.getId().getPath();
spd.setSaved(false);
switch (elementType) { switch (elementType) {
case IDefaultMutableTreeNode.SPD_HEADER: case IDefaultMutableTreeNode.SPD_HEADER:
SpdHeader frmSpdHeader = new SpdHeader(spd.getXmlSpd()); SpdHeader frmSpdHeader = new SpdHeader(spd);
getJDesktopPanePackage().add(frmSpdHeader, 1); getJDesktopPanePackage().add(frmSpdHeader, 1);
break; break;
case IDefaultMutableTreeNode.SPD_PACKAGEDEFINITIONS: case IDefaultMutableTreeNode.SPD_PACKAGEDEFINITIONS:
SpdPackageDefinitions frmSpdPackageDefinitions = new SpdPackageDefinitions(spd.getXmlSpd()); SpdPackageDefinitions frmSpdPackageDefinitions = new SpdPackageDefinitions(spd);
getJDesktopPanePackage().add(frmSpdPackageDefinitions, 1); getJDesktopPanePackage().add(frmSpdPackageDefinitions, 1);
break; break;
case IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS: case IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS:
SpdLibClassDecls frmSlcd = new SpdLibClassDecls(spd.getXmlSpd()); SpdLibClassDecls frmSlcd = new SpdLibClassDecls(spd);
getJDesktopPanePackage().add(frmSlcd, 1); getJDesktopPanePackage().add(frmSlcd, 1);
break; break;
case IDefaultMutableTreeNode.SPD_MSAFILES: case IDefaultMutableTreeNode.SPD_MSAFILES:
SpdMsaFiles frmSmf = new SpdMsaFiles(spd.getXmlSpd()); SpdMsaFiles frmSmf = new SpdMsaFiles(spd);
getJDesktopPanePackage().add(frmSmf, 1); getJDesktopPanePackage().add(frmSmf, 1);
break; break;
case IDefaultMutableTreeNode.SPD_PACKAGEHEADERS: case IDefaultMutableTreeNode.SPD_PACKAGEHEADERS:
SpdPackageHeaders frmSph = new SpdPackageHeaders(spd.getXmlSpd()); SpdPackageHeaders frmSph = new SpdPackageHeaders(spd);
getJDesktopPanePackage().add(frmSph, 1); getJDesktopPanePackage().add(frmSph, 1);
break; break;
case IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS: case IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS:
SpdGuidDecls frmSgd = new SpdGuidDecls(spd.getXmlSpd()); SpdGuidDecls frmSgd = new SpdGuidDecls(spd);
getJDesktopPanePackage().add(frmSgd, 1); getJDesktopPanePackage().add(frmSgd, 1);
break; break;
case IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS: case IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS:
SpdProtocolDecls frmSprod = new SpdProtocolDecls(spd.getXmlSpd()); SpdProtocolDecls frmSprod = new SpdProtocolDecls(spd);
getJDesktopPanePackage().add(frmSprod, 1); getJDesktopPanePackage().add(frmSprod, 1);
break; break;
case IDefaultMutableTreeNode.SPD_PPIDECLARATIONS: case IDefaultMutableTreeNode.SPD_PPIDECLARATIONS:
SpdPpiDecls frmSppid = new SpdPpiDecls(spd.getXmlSpd()); SpdPpiDecls frmSppid = new SpdPpiDecls(spd);
getJDesktopPanePackage().add(frmSppid, 1); getJDesktopPanePackage().add(frmSppid, 1);
break; break;
case IDefaultMutableTreeNode.SPD_PCDDECLARATIONS: case IDefaultMutableTreeNode.SPD_PCDDECLARATIONS:
SpdPcdDefs frmSpcdd = new SpdPcdDefs(spd.getXmlSpd()); SpdPcdDefs frmSpcdd = new SpdPcdDefs(spd);
getJDesktopPanePackage().add(frmSpcdd, 1); getJDesktopPanePackage().add(frmSpcdd, 1);
break; break;
} }

View File

@ -38,6 +38,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
@ -58,6 +59,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private JTable jTable = null; private JTable jTable = null;
private DefaultTableModel model = null; private DefaultTableModel model = null;
@ -249,6 +252,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
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){
docConsole.setSaved(false);
updateRow(row, m); updateRow(row, m);
} }
} }
@ -372,6 +376,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdGuidDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -504,6 +513,9 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/ */
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.dispose(); this.dispose();

View File

@ -33,6 +33,7 @@ import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -115,6 +116,8 @@ public class SpdHeader extends IInternalFrame {
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private JTextField jTextFieldCopyright = null; private JTextField jTextFieldCopyright = null;
private JScrollPane topScrollPane = null; private JScrollPane topScrollPane = null;
@ -140,6 +143,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "Package Name is NOT UiNameType."); JOptionPane.showMessageDialog(frame, "Package Name is NOT UiNameType.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrPkgName(jTextFieldBaseName.getText()); sfc.setSpdHdrPkgName(jTextFieldBaseName.getText());
} }
}); });
@ -164,6 +168,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "Guid is NOT GuidType."); JOptionPane.showMessageDialog(frame, "Guid is NOT GuidType.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrGuidValue(jTextFieldGuid.getText()); sfc.setSpdHdrGuidValue(jTextFieldGuid.getText());
} }
}); });
@ -188,6 +193,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "Version is NOT version type."); JOptionPane.showMessageDialog(frame, "Version is NOT version type.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrVer(jTextFieldVersion.getText()); sfc.setSpdHdrVer(jTextFieldVersion.getText());
} }
}); });
@ -221,7 +227,7 @@ public class SpdHeader extends IInternalFrame {
if (jTextAreaLicense == null) { if (jTextAreaLicense == null) {
jTextAreaLicense = new JTextArea(); jTextAreaLicense = new JTextArea();
jTextAreaLicense.setText(""); jTextAreaLicense.setText("");
jTextAreaLicense.setPreferredSize(new java.awt.Dimension(317,77)); // jTextAreaLicense.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaLicense.setLineWrap(true); jTextAreaLicense.setLineWrap(true);
jTextAreaLicense.addFocusListener(new FocusAdapter(){ jTextAreaLicense.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){ public void focusLost(FocusEvent e){
@ -229,6 +235,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "License contents could NOT be empty."); JOptionPane.showMessageDialog(frame, "License contents could NOT be empty.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrLicense(jTextAreaLicense.getText()); sfc.setSpdHdrLicense(jTextAreaLicense.getText());
} }
}); });
@ -246,13 +253,14 @@ public class SpdHeader extends IInternalFrame {
if (jTextAreaDescription == null) { if (jTextAreaDescription == null) {
jTextAreaDescription = new JTextArea(); jTextAreaDescription = new JTextArea();
jTextAreaDescription.setLineWrap(true); jTextAreaDescription.setLineWrap(true);
jTextAreaDescription.setPreferredSize(new java.awt.Dimension(317,77)); // jTextAreaDescription.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaDescription.addFocusListener(new FocusAdapter(){ jTextAreaDescription.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){ public void focusLost(FocusEvent e){
if (jTextAreaDescription.getText().length() == 0) { if (jTextAreaDescription.getText().length() == 0) {
JOptionPane.showMessageDialog(frame, "Description contents could NOT be empty."); JOptionPane.showMessageDialog(frame, "Description contents could NOT be empty.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrDescription(jTextAreaDescription.getText()); sfc.setSpdHdrDescription(jTextAreaDescription.getText());
} }
}); });
@ -365,6 +373,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "Abstract could NOT be empty."); JOptionPane.showMessageDialog(frame, "Abstract could NOT be empty.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrAbs(jTextFieldAbstract.getText()); sfc.setSpdHdrAbs(jTextFieldAbstract.getText());
} }
}); });
@ -389,6 +398,7 @@ public class SpdHeader extends IInternalFrame {
JOptionPane.showMessageDialog(frame, "Copyright contents could not be empty."); JOptionPane.showMessageDialog(frame, "Copyright contents could not be empty.");
return; return;
} }
docConsole.setSaved(false);
sfc.setSpdHdrCopyright(jTextFieldCopyright.getText()); sfc.setSpdHdrCopyright(jTextFieldCopyright.getText());
} }
}); });
@ -410,6 +420,7 @@ public class SpdHeader extends IInternalFrame {
public void focusLost(FocusEvent e){ public void focusLost(FocusEvent e){
sfc.setSpdHdrLicense(jTextAreaLicense.getText()); sfc.setSpdHdrLicense(jTextAreaLicense.getText());
sfc.setSpdHdrUrl(jTextField.getText()); sfc.setSpdHdrUrl(jTextField.getText());
docConsole.setSaved(false);
} }
}); });
} }
@ -441,6 +452,11 @@ public class SpdHeader extends IInternalFrame {
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdHeader(OpeningPackageType opt){
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -587,6 +603,7 @@ public class SpdHeader extends IInternalFrame {
* *
*/ */
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.setEdited(true); this.setEdited(true);

View File

@ -43,6 +43,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList; import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
@ -99,6 +100,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private JLabel jLabel1 = null; private JLabel jLabel1 = null;
private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,53" private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,53"
@ -317,6 +320,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
if (!dataValidation(rowData)) { if (!dataValidation(rowData)) {
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module); sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, ver, arch, module);
} }
} }
@ -401,6 +405,11 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdLibClassDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -574,6 +583,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/ */
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.dispose(); this.dispose();
@ -733,7 +744,6 @@ 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('\\', '/')); jTextField.setText(headerDest.substring(fileIndex + 1).replace('\\', '/'));
} }

View File

@ -39,6 +39,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -85,6 +86,8 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private int selectedRow = -1; private int selectedRow = -1;
/** /**
@ -238,6 +241,11 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdMsaFiles(OpeningPackageType opt){
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -324,6 +332,8 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/ */
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.dispose(); this.dispose();
@ -377,6 +387,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type."); JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type.");
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdMsaFile(row, file, null, null, null); sfc.updateSpdMsaFile(row, file, null, null, null);
} }
} }

View File

@ -20,6 +20,7 @@ import javax.swing.JComboBox;
import java.awt.Dimension; import java.awt.Dimension;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -37,6 +38,7 @@ public class SpdPackageDefinitions extends IInternalFrame {
private StarLabel starLabel = null; private StarLabel starLabel = null;
private StarLabel starLabel1 = null; private StarLabel starLabel1 = null;
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
/** /**
* This is the default constructor * This is the default constructor
@ -52,6 +54,11 @@ public class SpdPackageDefinitions extends IInternalFrame {
init(sfc); init(sfc);
} }
public SpdPackageDefinitions(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
private void init(SpdFileContents sfc) { private void init(SpdFileContents sfc) {
if (sfc.getSpdPkgDefsRdOnly() != null) { if (sfc.getSpdPkgDefsRdOnly() != null) {
jComboBoxReadOnly.setSelectedItem(sfc.getSpdPkgDefsRdOnly()); jComboBoxReadOnly.setSelectedItem(sfc.getSpdPkgDefsRdOnly());
@ -121,6 +128,7 @@ public class SpdPackageDefinitions extends IInternalFrame {
jComboBoxReadOnly.setSelectedIndex(1); jComboBoxReadOnly.setSelectedIndex(1);
jComboBoxReadOnly.addItemListener(new java.awt.event.ItemListener() { jComboBoxReadOnly.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
docConsole.setSaved(false);
sfc.setSpdPkgDefsRdOnly(jComboBoxReadOnly.getSelectedItem()+""); sfc.setSpdPkgDefsRdOnly(jComboBoxReadOnly.getSelectedItem()+"");
} }
}); });
@ -143,6 +151,7 @@ public class SpdPackageDefinitions extends IInternalFrame {
jComboBoxRePackage.setSelectedIndex(0); jComboBoxRePackage.setSelectedIndex(0);
jComboBoxRePackage.addItemListener(new java.awt.event.ItemListener() { jComboBoxRePackage.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
docConsole.setSaved(false);
sfc.setSpdPkgDefsRePkg(jComboBoxRePackage.getSelectedItem()+""); sfc.setSpdPkgDefsRePkg(jComboBoxRePackage.getSelectedItem()+"");
} }
}); });

View File

@ -43,6 +43,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -61,6 +62,8 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private DefaultTableModel model = null; private DefaultTableModel model = null;
private JPanel jContentPane = null; private JPanel jContentPane = null;
@ -251,6 +254,11 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdPackageHeaders(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -352,6 +360,8 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/ */
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.dispose(); this.dispose();
@ -561,6 +571,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
if (!dataValidation(rowData)) { if (!dataValidation(rowData)) {
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdPkgHdr(row, pkg, hdr); sfc.updateSpdPkgHdr(row, pkg, hdr);
} }
} }

View File

@ -39,6 +39,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -86,6 +87,8 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private StarLabel jStarLabel2 = null; private StarLabel jStarLabel2 = null;
private StarLabel jStarLabel3 = null; private StarLabel jStarLabel3 = null;
@ -246,6 +249,11 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa); sfc = new SpdFileContents(inPsa);
init(sfc); init(sfc);
} }
public SpdPcdDefs(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -435,6 +443,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
this.save(); this.save();
this.dispose(); this.dispose();
@ -732,6 +741,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
if (!dataValidation(o)){ if (!dataValidation(o)){
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdPcdDefinition(row, cName, token, dataType, usage, ts, defaultVal, help, archList, modTypeList); sfc.updateSpdPcdDefinition(row, cName, token, dataType, usage, ts, defaultVal, help, archList, modTypeList);
} }
} }

View File

@ -16,6 +16,7 @@ import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
/** /**
GUI for create library definition elements of spd file. GUI for create library definition elements of spd file.
@ -29,6 +30,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
public SpdPpiDecls() { public SpdPpiDecls() {
super(); super();
@ -41,6 +43,11 @@ public class SpdPpiDecls extends SpdGuidDecls {
init(sfc); init(sfc);
} }
public SpdPpiDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
protected void initFrame() { protected void initFrame() {
this.setTitle("PPI Declarations"); this.setTitle("PPI Declarations");
@ -86,6 +93,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (!dataValidation(rowData)){ if (!dataValidation(rowData)){
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList); sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList);
} }
@ -94,6 +102,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (!dataValidation(row)){ if (!dataValidation(row)){
return; return;
} }
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]));
} }

View File

@ -16,6 +16,7 @@ import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument; import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
/** /**
GUI for create library definition elements of spd file. GUI for create library definition elements of spd file.
@ -29,6 +30,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private SpdFileContents sfc = null; private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
public SpdProtocolDecls() { public SpdProtocolDecls() {
super(); super();
@ -41,6 +43,11 @@ public class SpdProtocolDecls extends SpdGuidDecls {
init(sfc); init(sfc);
} }
public SpdProtocolDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
protected void initFrame() { protected void initFrame() {
this.setTitle("Protocol Declarations"); this.setTitle("Protocol Declarations");
@ -87,7 +94,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
if (!dataValidation(rowData)){ if (!dataValidation(rowData)){
return; return;
} }
docConsole.setSaved(false);
sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList); sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList);
} }

View File

@ -26,6 +26,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -43,6 +45,8 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableModel; import javax.swing.table.TableModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -53,6 +57,7 @@ import java.util.Vector;
public class FpdBuildOptions extends IInternalFrame { public class FpdBuildOptions extends IInternalFrame {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
static JFrame frame;
private JPanel jContentPane = null; private JPanel jContentPane = null;
private JPanel jPanel = null; private JPanel jPanel = null;
private JPanel jPanel1 = null; private JPanel jPanel1 = null;
@ -105,6 +110,7 @@ public class FpdBuildOptions extends IInternalFrame {
private JButton jButton17 = null; private JButton jButton17 = null;
private JButton jButton18 = null; private JButton jButton18 = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
private JButton jButton19 = null; private JButton jButton19 = null;
private JCheckBox jCheckBox9 = null; private JCheckBox jCheckBox9 = null;
private JCheckBox jCheckBox10 = null; private JCheckBox jCheckBox10 = null;
@ -319,12 +325,16 @@ public class FpdBuildOptions extends IInternalFrame {
jButton4.setText("Add"); jButton4.setText("Add");
jButton4.addActionListener(new ActionListener() { jButton4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (!DataValidation.isInt(jTextField3.getText())) {
JOptionPane.showMessageDialog(frame, "ID must be an integer.");
return;
}
Object[] o = {jTextField3.getText(), null, null}; Object[] o = {jTextField3.getText(), null, null};
o[1] = jTextField2.getText(); o[1] = jTextField2.getText();
o[2] = jTextField4.getText(); o[2] = jTextField4.getText();
ffc.genBuildOptionsUserDefAntTask(o[0]+"", null, o[2]+""); ffc.genBuildOptionsUserDefAntTask(o[0]+"", null, o[2]+"");
antTaskTableModel.addRow(o); antTaskTableModel.addRow(o);
docConsole.setSaved(false);
} }
}); });
} }
@ -344,6 +354,7 @@ public class FpdBuildOptions extends IInternalFrame {
jButton5.addActionListener(new ActionListener() { jButton5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (selectedRow >= 0) { if (selectedRow >= 0) {
docConsole.setSaved(false);
antTaskTableModel.removeRow(selectedRow); antTaskTableModel.removeRow(selectedRow);
ffc.removeBuildOptionsUserDefAntTask(selectedRow); ffc.removeBuildOptionsUserDefAntTask(selectedRow);
} }
@ -544,7 +555,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTextField6 == null) { if (jTextField6 == null) {
jTextField6 = new JTextField(); jTextField6 = new JTextField();
jTextField6.setPreferredSize(new java.awt.Dimension(100,20)); jTextField6.setPreferredSize(new java.awt.Dimension(100,20));
jTextField6.setEditable(false); jTextField6.setEditable(true);
jTextField6.addFocusListener(new java.awt.event.FocusAdapter() { jTextField6.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) { public void focusLost(java.awt.event.FocusEvent e) {
if (jTable.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0) {
@ -577,6 +588,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTextField6.getText().length() > 0) { if (jTextField6.getText().length() > 0) {
String[] row = {jTextField6.getText()}; String[] row = {jTextField6.getText()};
ffsTableModel.addRow(row); ffsTableModel.addRow(row);
docConsole.setSaved(false);
ffc.genBuildOptionsFfs(jTextField6.getText(), jTextField.getText()); ffc.genBuildOptionsFfs(jTextField6.getText(), jTextField.getText());
} }
} }
@ -605,6 +617,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
ffc.removeBuildOptionsFfs(jTable.getSelectedRow()); ffc.removeBuildOptionsFfs(jTable.getSelectedRow());
} }
}); });
@ -657,6 +670,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (value.length() == 0){ if (value.length() == 0){
return; return;
} }
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsAttribute(jTable.getSelectedRow(), row, name, value); ffc.updateBuildOptionsFfsAttribute(jTable.getSelectedRow(), row, name, value);
} }
} }
@ -826,7 +840,14 @@ public class FpdBuildOptions extends IInternalFrame {
cb.addItem("CYGWIN"); cb.addItem("CYGWIN");
cb.addItem("INTEL"); cb.addItem("INTEL");
toolFamilyCol.setCellEditor(new DefaultCellEditor(cb)); toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
Vector<String> vArch = new Vector<String>();
vArch.add("IA32");
vArch.add("X64");
vArch.add("IPF");
vArch.add("EBC");
vArch.add("ARM");
vArch.add("PPC");
jTable5.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch));
jTable5.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jTable5.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable5.getSelectionModel().addListSelectionListener(new ListSelectionListener(){ jTable5.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) { public void valueChanged(ListSelectionEvent e) {
@ -859,17 +880,19 @@ public class FpdBuildOptions extends IInternalFrame {
} }
String toolChain = m.getValueAt(row, 1) + ""; String toolChain = m.getValueAt(row, 1) + "";
String archs = m.getValueAt(row, 2) + ""; String archs = m.getValueAt(row, 2) + "";
Vector<Object> supArch = new Vector<Object>(); Vector<Object> supArch = null;
if (archs.length() > 0) {
supArch = new Vector<Object>();
String[] sArray1 = archs.split("( )+"); String[] sArray1 = archs.split("( )+");
for (int i = 0; i < sArray1.length; ++i) { for (int i = 0; i < sArray1.length; ++i) {
supArch.add(sArray1[i]); supArch.add(sArray1[i]);
} }
if (supArch.size() == 0) {
supArch.add("IA32");
} }
String toolCmd = m.getValueAt(row, 3) + ""; String toolCmd = m.getValueAt(row, 3) + "";
String tagName = m.getValueAt(row, 4) + ""; String tagName = m.getValueAt(row, 4) + "";
String contents = m.getValueAt(row, 5) + ""; String contents = m.getValueAt(row, 5) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents); ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);
} }
} }
@ -901,7 +924,7 @@ public class FpdBuildOptions extends IInternalFrame {
Object[] o = {jTextField12.getText(), jComboBox2.getSelectedItem(), s, Object[] o = {jTextField12.getText(), jComboBox2.getSelectedItem(), s,
jTextField8.getText(), jTextField13.getText(), jTextField7.getText()}; jTextField8.getText(), jTextField13.getText(), jTextField7.getText()};
optionsTableModel.addRow(o); optionsTableModel.addRow(o);
docConsole.setSaved(false);
ffc.genBuildOptionsOpt(stringToVector(jTextField12.getText()), jComboBox2.getSelectedItem()+"", jTextField13.getText(), jTextField8.getText(), stringToVector(s), jTextField7.getText()); ffc.genBuildOptionsOpt(stringToVector(jTextField12.getText()), jComboBox2.getSelectedItem()+"", jTextField13.getText(), jTextField8.getText(), stringToVector(s), jTextField7.getText());
} }
}); });
@ -911,10 +934,13 @@ public class FpdBuildOptions extends IInternalFrame {
private Vector<Object> stringToVector(String s) { private Vector<Object> stringToVector(String s) {
String[] sArray = s.split(" "); String[] sArray = s.split(" ");
Vector<Object> v = new Vector<Object>(); Vector<Object> v = null;
if (s.length() > 0) {
v = new Vector<Object>();
for (int i = 0; i < sArray.length; ++i) { for (int i = 0; i < sArray.length; ++i) {
v.add(sArray[i]); v.add(sArray[i]);
} }
}
return v; return v;
} }
@ -963,6 +989,7 @@ public class FpdBuildOptions extends IInternalFrame {
public void actionPerformed(java.awt.event.ActionEvent e) { public void actionPerformed(java.awt.event.ActionEvent e) {
if (selectedRow >= 0) { if (selectedRow >= 0) {
optionsTableModel.removeRow(selectedRow); optionsTableModel.removeRow(selectedRow);
docConsole.setSaved(false);
ffc.removeBuildOptionsOpt(selectedRow); ffc.removeBuildOptionsOpt(selectedRow);
} }
} }
@ -993,6 +1020,7 @@ public class FpdBuildOptions extends IInternalFrame {
} }
Object[] o = {"", ""}; Object[] o = {"", ""};
ffsAttributesTableModel.addRow(o); ffsAttributesTableModel.addRow(o);
docConsole.setSaved(false);
ffc.genBuildOptionsFfsAttribute(jTable.getSelectedRow(), "", ""); ffc.genBuildOptionsFfsAttribute(jTable.getSelectedRow(), "", "");
} }
}); });
@ -1021,6 +1049,7 @@ public class FpdBuildOptions extends IInternalFrame {
return; return;
} }
if (jTable4.getSelectedRow() >= 0){ if (jTable4.getSelectedRow() >= 0){
docConsole.setSaved(false);
ffsAttributesTableModel.removeRow(jTable4.getSelectedRow()); ffsAttributesTableModel.removeRow(jTable4.getSelectedRow());
ffc.removeBuildOptionsFfsAttribute(jTable.getSelectedRow(), jTable4.getSelectedRow()); ffc.removeBuildOptionsFfsAttribute(jTable.getSelectedRow(), jTable4.getSelectedRow());
} }
@ -1240,7 +1269,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (id.length() == 0) { if (id.length() == 0) {
return; return;
} }
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsKey(row, id); ffc.updateBuildOptionsFfsKey(row, id);
} }
} }
@ -1304,7 +1333,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){ if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check. //ToDo Data Validition check.
String type = m.getValueAt(row, 0) + ""; String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row, type); ffc.updateBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row, type);
} }
} }
@ -1366,6 +1395,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){ if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check. //ToDo Data Validition check.
String type = m.getValueAt(row, 0) + ""; String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), row, type); ffc.updateBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), row, type);
} }
} }
@ -1425,6 +1455,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
String[] row = {"EFI_SECTION_RAW"}; String[] row = {"EFI_SECTION_RAW"};
sectionTableModel.addRow(row); sectionTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row[0]); ffc.genBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row[0]);
@ -1450,6 +1481,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable1.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0 || jTable1.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
sectionTableModel.removeRow(jTable1.getSelectedRow()); sectionTableModel.removeRow(jTable1.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), jTable1.getSelectedRow()); ffc.removeBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), jTable1.getSelectedRow());
} }
@ -1473,6 +1505,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
String[] row = {"EFI_SECTION_RAW"}; String[] row = {"EFI_SECTION_RAW"};
subsectionsTableModel.addRow(row); subsectionsTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), row[0]); ffc.genBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), row[0]);
@ -1498,6 +1531,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0 || jTable3.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0 || jTable3.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
subsectionsTableModel.removeRow(jTable3.getSelectedRow()); subsectionsTableModel.removeRow(jTable3.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), jTable3.getSelectedRow()); ffc.removeBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), jTable3.getSelectedRow());
} }
@ -1521,6 +1555,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
String[] row = {""}; String[] row = {""};
sectionsTableModel.addRow(row); sectionsTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), ""); ffc.genBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), "");
@ -1545,6 +1580,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) { if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) {
return; return;
} }
docConsole.setSaved(false);
sectionsTableModel.removeRow(jTable6.getSelectedRow()); sectionsTableModel.removeRow(jTable6.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), jTable6.getSelectedRow()); ffc.removeBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), jTable6.getSelectedRow());
} }
@ -1612,6 +1648,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){ if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check. //ToDo Data Validition check.
String encapType = m.getValueAt(row, 0) + ""; String encapType = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), row, encapType); ffc.updateBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), row, encapType);
} }
} }
@ -1643,6 +1680,11 @@ public class FpdBuildOptions extends IInternalFrame {
init(ffc); init(ffc);
} }
public FpdBuildOptions(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
private void init(FpdFileContents ffc) { private void init(FpdFileContents ffc) {
initOptionTable(); initOptionTable();
initAntTaskTable(); initAntTaskTable();

View File

@ -12,6 +12,7 @@ import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import java.awt.FlowLayout; import java.awt.FlowLayout;
@ -35,6 +36,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
private DynPcdTableModel model = null; private DynPcdTableModel model = null;
private DynPcdTableModel model1 = null; private DynPcdTableModel model1 = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
private JPanel jPanel3 = null; private JPanel jPanel3 = null;
private JCheckBox jCheckBox = null; private JCheckBox jCheckBox = null;
private JPanel jPanel4 = null; private JPanel jPanel4 = null;
@ -71,6 +73,11 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
init(fpd); init(fpd);
} }
public FpdDynamicPcdBuildDefinitions(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
public void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) { public void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
if (ffc == null) { if (ffc == null) {
ffc = new FpdFileContents(fpd); ffc = new FpdFileContents(fpd);
@ -492,7 +499,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
if (pcdSelected < 0) { if (pcdSelected < 0) {
return; return;
} }
docConsole.setSaved(false);
updateSkuInfo(pcdSelected); updateSkuInfo(pcdSelected);
} }

View File

@ -24,6 +24,7 @@ import javax.swing.JButton;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -108,7 +109,7 @@ public class FpdFlash extends IInternalFrame {
private JButton jButton6 = null; private JButton jButton6 = null;
private JCheckBox jCheckBox3 = null; private JCheckBox jCheckBox3 = null;
private JPanel jPanel6 = null; private JPanel jPanel6 = null;
private OpeningPlatformType docConsole = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private JPanel jPanel7 = null; private JPanel jPanel7 = null;
private JCheckBox jCheckBox = null; private JCheckBox jCheckBox = null;
@ -139,6 +140,11 @@ public class FpdFlash extends IInternalFrame {
init(ffc); init(ffc);
} }
public FpdFlash(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
/** /**
* This method initializes jPanel * This method initializes jPanel
* *
@ -391,6 +397,7 @@ public class FpdFlash extends IInternalFrame {
if (jTextField.getText().length() > 0 && jTextField1.getText().length() > 0){ if (jTextField.getText().length() > 0 && jTextField1.getText().length() > 0){
String[] row = {jTextField.getText(), jTextField1.getText()}; String[] row = {jTextField.getText(), jTextField1.getText()};
fvPropertyTableModel.addRow(row); fvPropertyTableModel.addRow(row);
docConsole.setSaved(false);
ffc.genFvImagesNameValue(row[0], row[1]); ffc.genFvImagesNameValue(row[0], row[1]);
} }
} }
@ -454,7 +461,7 @@ public class FpdFlash extends IInternalFrame {
String name = m.getValueAt(row, 0) + ""; String name = m.getValueAt(row, 0) + "";
String value = m.getValueAt(row, 1) + ""; String value = m.getValueAt(row, 1) + "";
docConsole.setSaved(false);
ffc.updateFvImagesNameValue(row, name, value); ffc.updateFvImagesNameValue(row, name, value);
} }
} }
@ -501,6 +508,7 @@ public class FpdFlash extends IInternalFrame {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (jTable.getSelectedRow() >= 0){ if (jTable.getSelectedRow() >= 0){
fvPropertyTableModel.removeRow(jTable.getSelectedRow()); fvPropertyTableModel.removeRow(jTable.getSelectedRow());
docConsole.setSaved(false);
ffc.removeFvImagesNameValue(jTable.getSelectedRow()); ffc.removeFvImagesNameValue(jTable.getSelectedRow());
} }
} }
@ -795,7 +803,7 @@ public class FpdFlash extends IInternalFrame {
getOptionNameValue(m); getOptionNameValue(m);
} }
ffc.genFvImagesFvImage(imageName.split(" "), jComboBox.getSelectedItem()+"", m); ffc.genFvImagesFvImage(imageName.split(" "), jComboBox.getSelectedItem()+"", m);
docConsole.setSaved(false);
Object[] row = {imageName, jComboBox.getSelectedItem()}; Object[] row = {imageName, jComboBox.getSelectedItem()};
fvImageParaTableModel.addRow(row); fvImageParaTableModel.addRow(row);
} }
@ -898,8 +906,9 @@ public class FpdFlash extends IInternalFrame {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (jTable2.getSelectedRow() >= 0 ) { if (jTable2.getSelectedRow() >= 0 ) {
fvImageParaTableModel.removeRow(jTable2.getSelectedRow());
ffc.removeFvImagesFvImage(jTable2.getSelectedRow()); ffc.removeFvImagesFvImage(jTable2.getSelectedRow());
fvImageParaTableModel.removeRow(jTable2.getSelectedRow());
docConsole.setSaved(false);
} }
} }
@ -1235,7 +1244,7 @@ public class FpdFlash extends IInternalFrame {
LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>(); LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
getOptionNameValue(lhm); getOptionNameValue(lhm);
docConsole.setSaved(false);
ffc.updateFvImagesFvImage(row, name.split(" "), type, lhm); ffc.updateFvImagesFvImage(row, name.split(" "), type, lhm);
} }

View File

@ -14,6 +14,7 @@ import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.platform.ui.global.GlobalData; import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;
import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification; import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;
@ -54,7 +55,7 @@ public class FpdFrameworkModules extends IInternalFrame {
private FpdModuleSA settingDlg = null; private FpdModuleSA settingDlg = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
private Map<String, String> fpdMsa = null; private Map<String, String> fpdMsa = null;
private ArrayList<ModuleIdentification> miList = null; private ArrayList<ModuleIdentification> miList = null;
@ -198,6 +199,7 @@ public class FpdFrameworkModules extends IInternalFrame {
row[4] = mi.getPackage().getVersion(); row[4] = mi.getPackage().getVersion();
} }
model1.addRow(row); model1.addRow(row);
docConsole.setSaved(false);
ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null); ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);
} }
}); });
@ -277,7 +279,7 @@ public class FpdFrameworkModules extends IInternalFrame {
if (settingDlg == null) { if (settingDlg == null) {
settingDlg = new FpdModuleSA(ffc); settingDlg = new FpdModuleSA(ffc);
} }
docConsole.setSaved(false);
String mg = model1.getValueAt(selectedRow, 1)+""; String mg = model1.getValueAt(selectedRow, 1)+"";
String mv = model1.getValueAt(selectedRow, 2)+""; String mv = model1.getValueAt(selectedRow, 2)+"";
String pg = model1.getValueAt(selectedRow, 3)+""; String pg = model1.getValueAt(selectedRow, 3)+"";
@ -312,6 +314,7 @@ public class FpdFrameworkModules extends IInternalFrame {
String pv = model1.getValueAt(selectedRow, 4).toString(); String pv = model1.getValueAt(selectedRow, 4).toString();
model1.removeRow(selectedRow); model1.removeRow(selectedRow);
fpdMsa.remove(mg+mv+pg+pv); fpdMsa.remove(mg+mv+pg+pv);
docConsole.setSaved(false);
ffc.removeModuleSA(selectedRow); ffc.removeModuleSA(selectedRow);
} }
}); });
@ -341,6 +344,11 @@ public class FpdFrameworkModules extends IInternalFrame {
} }
public FpdFrameworkModules(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) { private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
try { try {
GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE")); GlobalData.initInfo("Tools" + File.separator + "Conf" + File.separator + "FrameworkDatabase.db", System.getenv("WORKSPACE"));

View File

@ -22,7 +22,9 @@ import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
@ -35,6 +37,7 @@ import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation; import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Log;
import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel; import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -52,6 +55,7 @@ public class FpdHeader extends IInternalFrame {
/// ///
private static final long serialVersionUID = -8152099582923006900L; private static final long serialVersionUID = -8152099582923006900L;
static JFrame frame;
// //
//Define class members //Define class members
// //
@ -123,6 +127,8 @@ public class FpdHeader extends IInternalFrame {
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
/** /**
This method initializes jTextFieldBaseName This method initializes jTextFieldBaseName
@ -136,6 +142,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320,20)); jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldBaseName.addFocusListener(new FocusAdapter(){ jTextFieldBaseName.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {
JOptionPane.showMessageDialog(frame, "Package Name is NOT UiNameType.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText()); ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText());
} }
}); });
@ -156,6 +167,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250,20)); jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250,20));
jTextFieldGuid.addFocusListener(new FocusAdapter(){ jTextFieldGuid.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (!DataValidation.isGuid(jTextFieldGuid.getText())) {
JOptionPane.showMessageDialog(frame, "Guid is NOT GuidType.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrGuidValue(jTextFieldGuid.getText()); ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
} }
}); });
@ -176,6 +192,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320,20)); jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldVersion.addFocusListener(new FocusAdapter(){ jTextFieldVersion.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (!DataValidation.isVersion(jTextFieldVersion.getText())) {
JOptionPane.showMessageDialog(frame, "Version is NOT version type.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrVer(jTextFieldVersion.getText()); ffc.setFpdHdrVer(jTextFieldVersion.getText());
} }
}); });
@ -209,10 +230,14 @@ public class FpdHeader extends IInternalFrame {
if (jTextAreaLicense == null) { if (jTextAreaLicense == null) {
jTextAreaLicense = new JTextArea(); jTextAreaLicense = new JTextArea();
jTextAreaLicense.setText(""); jTextAreaLicense.setText("");
jTextAreaLicense.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaLicense.setLineWrap(true); jTextAreaLicense.setLineWrap(true);
jTextAreaLicense.addFocusListener(new FocusAdapter(){ jTextAreaLicense.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (jTextAreaLicense.getText().length() == 0) {
JOptionPane.showMessageDialog(frame, "License contents could NOT be empty.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrLicense(jTextAreaLicense.getText()); ffc.setFpdHdrLicense(jTextAreaLicense.getText());
} }
}); });
@ -230,9 +255,13 @@ public class FpdHeader extends IInternalFrame {
if (jTextAreaDescription == null) { if (jTextAreaDescription == null) {
jTextAreaDescription = new JTextArea(); jTextAreaDescription = new JTextArea();
jTextAreaDescription.setLineWrap(true); jTextAreaDescription.setLineWrap(true);
jTextAreaDescription.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaDescription.addFocusListener(new FocusAdapter(){ jTextAreaDescription.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (jTextAreaDescription.getText().length() == 0) {
JOptionPane.showMessageDialog(frame, "Description contents could NOT be empty.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrDescription(jTextAreaDescription.getText()); ffc.setFpdHdrDescription(jTextAreaDescription.getText());
} }
}); });
@ -341,6 +370,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20)); jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldAbstract.addFocusListener(new FocusAdapter(){ jTextFieldAbstract.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {
JOptionPane.showMessageDialog(frame, "Abstract could NOT be empty.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrAbs(jTextFieldAbstract.getText()); ffc.setFpdHdrAbs(jTextFieldAbstract.getText());
} }
}); });
@ -361,6 +395,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20)); jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldCopyright.addFocusListener(new FocusAdapter(){ jTextFieldCopyright.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
if (!DataValidation.isCopyright(jTextFieldCopyright.getText())) {
JOptionPane.showMessageDialog(frame, "Copyright contents could not be empty.");
return;
}
docConsole.setSaved(false);
ffc.setFpdHdrCopyright(jTextFieldCopyright.getText()); ffc.setFpdHdrCopyright(jTextFieldCopyright.getText());
} }
}); });
@ -382,6 +421,7 @@ public class FpdHeader extends IInternalFrame {
public void focusLost(FocusEvent e){ public void focusLost(FocusEvent e){
ffc.setFpdHdrLicense(jTextAreaLicense.getText()); ffc.setFpdHdrLicense(jTextAreaLicense.getText());
ffc.setFpdHdrUrl(jTextField.getText()); ffc.setFpdHdrUrl(jTextField.getText());
docConsole.setSaved(false);
} }
}); });
} }
@ -415,6 +455,11 @@ public class FpdHeader extends IInternalFrame {
} }
public FpdHeader(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
/** /**
This method initializes this This method initializes this
@ -576,7 +621,7 @@ public class FpdHeader extends IInternalFrame {
this.setEdited(false); this.setEdited(false);
} }
if (arg0.getSource() == jButtonGenerateGuid) { if (arg0.getSource() == jButtonGenerateGuid) {
//ToDo: invoke GuidValueEditor docConsole.setSaved(false);
jTextFieldGuid.setText(Tools.generateUuidString()); jTextFieldGuid.setText(Tools.generateUuidString());
ffc.setFpdHdrGuidValue(jTextFieldGuid.getText()); ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
} }

View File

@ -21,6 +21,7 @@ import javax.swing.JButton;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import org.tianocore.PlatformSurfaceAreaDocument; import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame; import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
@ -60,7 +61,7 @@ public class FpdPlatformDefs extends IInternalFrame {
private TargetTableModel imageEntryPointTableModel = null; private TargetTableModel imageEntryPointTableModel = null;
private SkuInfoTableModel skuInfoTableModel = null; private SkuInfoTableModel skuInfoTableModel = null;
private OpeningPlatformType docConsole = null;
private FpdFileContents ffc = null; private FpdFileContents ffc = null;
private JPanel jPanel4 = null; private JPanel jPanel4 = null;
private JPanel jPanel5 = null; private JPanel jPanel5 = null;
@ -111,6 +112,11 @@ public class FpdPlatformDefs extends IInternalFrame {
init(ffc); init(ffc);
} }
public FpdPlatformDefs(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
/** /**
* This method initializes jPanel * This method initializes jPanel
* *
@ -304,6 +310,9 @@ public class FpdPlatformDefs extends IInternalFrame {
} }
private void getToolChain(Vector<Object> v) { private void getToolChain(Vector<Object> v) {
if (docConsole != null){
docConsole.setSaved(false);
}
v.removeAllElements(); v.removeAllElements();
if (jCheckBox1.isSelected()) { if (jCheckBox1.isSelected()) {
v.add("IA32"); v.add("IA32");
@ -469,6 +478,7 @@ public class FpdPlatformDefs extends IInternalFrame {
for (int i = 0; i < jTable.getRowCount(); ++i) { for (int i = 0; i < jTable.getRowCount(); ++i) {
v.add(m.getValueAt(i, 0)); v.add(m.getValueAt(i, 0));
} }
docConsole.setSaved(false);
ffc.setPlatformDefsBuildTargets(v); ffc.setPlatformDefsBuildTargets(v);
} }
} }
@ -522,6 +532,9 @@ public class FpdPlatformDefs extends IInternalFrame {
jComboBox.setSelectedIndex(0); jComboBox.setSelectedIndex(0);
jComboBox.addItemListener(new java.awt.event.ItemListener() { jComboBox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent e) { public void itemStateChanged(java.awt.event.ItemEvent e) {
if (docConsole != null){
docConsole.setSaved(false);
}
ffc.setPlatformDefsInterDir(jComboBox.getSelectedItem()+""); ffc.setPlatformDefsInterDir(jComboBox.getSelectedItem()+"");
} }
}); });
@ -588,6 +601,7 @@ public class FpdPlatformDefs extends IInternalFrame {
for (int i = 0; i < jTable.getRowCount(); ++i) { for (int i = 0; i < jTable.getRowCount(); ++i) {
v.add(imageEntryPointTableModel.getValueAt(i, 0)); v.add(imageEntryPointTableModel.getValueAt(i, 0));
} }
docConsole.setSaved(false);
ffc.setPlatformDefsBuildTargets(v); ffc.setPlatformDefsBuildTargets(v);
} }
} }
@ -662,6 +676,7 @@ public class FpdPlatformDefs extends IInternalFrame {
//ToDo Data Validition check. //ToDo Data Validition check.
String id = m.getValueAt(row, 0)+""; String id = m.getValueAt(row, 0)+"";
String name = m.getValueAt(row, 1)+""; String name = m.getValueAt(row, 1)+"";
docConsole.setSaved(false);
ffc.updatePlatformDefsSkuInfo(row, id, name); ffc.updatePlatformDefsSkuInfo(row, id, name);
} }
} }
@ -771,6 +786,7 @@ public class FpdPlatformDefs extends IInternalFrame {
jTextField.setPreferredSize(new java.awt.Dimension(300,20)); jTextField.setPreferredSize(new java.awt.Dimension(300,20));
jTextField.addFocusListener(new java.awt.event.FocusAdapter() { jTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) { public void focusLost(java.awt.event.FocusEvent e) {
docConsole.setSaved(false);
ffc.setPlatformDefsOutputDir(jTextField.getText()); ffc.setPlatformDefsOutputDir(jTextField.getText());
} }
}); });
@ -852,6 +868,7 @@ public class FpdPlatformDefs extends IInternalFrame {
if (jTextField2.getText().length() > 0) { if (jTextField2.getText().length() > 0) {
String[] row = {jTextField2.getText(), jTextField3.getText()}; String[] row = {jTextField2.getText(), jTextField3.getText()};
skuInfoTableModel.addRow(row); skuInfoTableModel.addRow(row);
docConsole.setSaved(false);
ffc.genPlatformDefsSkuInfo(row[0], row[1]); ffc.genPlatformDefsSkuInfo(row[0], row[1]);
} }
} }
@ -878,6 +895,7 @@ public class FpdPlatformDefs extends IInternalFrame {
if (jTable2.getSelectedRow() < 1) { if (jTable2.getSelectedRow() < 1) {
return; return;
} }
docConsole.setSaved(false);
ffc.removePlatformDefsSkuInfo(jTable2.getSelectedRow()); ffc.removePlatformDefsSkuInfo(jTable2.getSelectedRow());
skuInfoTableModel.removeRow(jTable2.getSelectedRow()); skuInfoTableModel.removeRow(jTable2.getSelectedRow());
} }