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

View File

@ -38,6 +38,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
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.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
@ -57,6 +58,8 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
static JFrame frame;
private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private JTable jTable = null;
@ -249,6 +252,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
int row = arg0.getFirstRow();
TableModel m = (TableModel)arg0.getSource();
if (arg0.getType() == TableModelEvent.UPDATE){
docConsole.setSaved(false);
updateRow(row, m);
}
}
@ -372,6 +376,11 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa);
init(sfc);
}
public SpdGuidDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/**
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)
*/
public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();

View File

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

View File

@ -43,6 +43,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
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.StarLabel;
import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
@ -98,6 +99,8 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
private StarLabel jStarLabel2 = null;
private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private JLabel jLabel1 = null;
@ -317,6 +320,7 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
if (!dataValidation(rowData)) {
return;
}
docConsole.setSaved(false);
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);
init(sfc);
}
public SpdLibClassDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/**
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)
*/
public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();
@ -733,7 +744,6 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
headerDest = theFile.getPath();
int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length());
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.frameworkwizard.common.Tools;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.common.ui.StarLabel;
@ -84,6 +85,8 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
private StarLabel jStarLabel2 = null;
private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private int selectedRow = -1;
@ -238,6 +241,11 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa);
init(sfc);
}
public SpdMsaFiles(OpeningPackageType opt){
this(opt.getXmlSpd());
docConsole = opt;
}
/**
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)
*/
public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();
@ -377,6 +387,7 @@ public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type.");
return;
}
docConsole.setSaved(false);
sfc.updateSpdMsaFile(row, file, null, null, null);
}
}

View File

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

View File

@ -43,6 +43,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
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.StarLabel;
@ -60,6 +61,8 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
static JFrame frame;
private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private DefaultTableModel model = null;
@ -251,6 +254,11 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
sfc = new SpdFileContents(inPsa);
init(sfc);
}
public SpdPackageHeaders(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/**
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)
*/
public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();
@ -561,6 +571,7 @@ public class SpdPackageHeaders extends IInternalFrame implements TableModelListe
if (!dataValidation(rowData)) {
return;
}
docConsole.setSaved(false);
sfc.updateSpdPkgHdr(row, pkg, hdr);
}
}

View File

@ -39,6 +39,7 @@ import javax.swing.table.TableModel;
import org.tianocore.PackageSurfaceAreaDocument;
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.StarLabel;
import javax.swing.JScrollPane;
@ -85,6 +86,8 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
private JComboBox jComboBoxDataType = null;
private SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
private StarLabel jStarLabel2 = null;
@ -246,6 +249,11 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
sfc = new SpdFileContents(inPsa);
init(sfc);
}
public SpdPcdDefs(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
/**
This method initializes this
@ -435,6 +443,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
public void actionPerformed(ActionEvent arg0) {
docConsole.setSaved(false);
if (arg0.getSource() == jButtonOk) {
this.save();
this.dispose();
@ -732,6 +741,7 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
if (!dataValidation(o)){
return;
}
docConsole.setSaved(false);
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 org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
/**
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 SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
public SpdPpiDecls() {
super();
@ -41,6 +43,11 @@ public class SpdPpiDecls extends SpdGuidDecls {
init(sfc);
}
public SpdPpiDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
protected void initFrame() {
this.setTitle("PPI Declarations");
@ -86,6 +93,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (!dataValidation(rowData)){
return;
}
docConsole.setSaved(false);
sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList);
}
@ -94,6 +102,7 @@ public class SpdPpiDecls extends SpdGuidDecls {
if (!dataValidation(row)){
return;
}
docConsole.setSaved(false);
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 org.tianocore.PackageSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
/**
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 SpdFileContents sfc = null;
private OpeningPackageType docConsole = null;
public SpdProtocolDecls() {
super();
@ -41,6 +43,11 @@ public class SpdProtocolDecls extends SpdGuidDecls {
init(sfc);
}
public SpdProtocolDecls(OpeningPackageType opt) {
this(opt.getXmlSpd());
docConsole = opt;
}
protected void initFrame() {
this.setTitle("Protocol Declarations");
@ -87,7 +94,7 @@ public class SpdProtocolDecls extends SpdGuidDecls {
if (!dataValidation(rowData)){
return;
}
docConsole.setSaved(false);
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 javax.swing.DefaultCellEditor;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JScrollPane;
@ -43,6 +45,8 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
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 java.util.ArrayList;
import java.util.Iterator;
@ -53,6 +57,7 @@ import java.util.Vector;
public class FpdBuildOptions extends IInternalFrame {
private static final long serialVersionUID = 1L;
static JFrame frame;
private JPanel jContentPane = null;
private JPanel jPanel = null;
private JPanel jPanel1 = null;
@ -105,6 +110,7 @@ public class FpdBuildOptions extends IInternalFrame {
private JButton jButton17 = null;
private JButton jButton18 = null;
private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
private JButton jButton19 = null;
private JCheckBox jCheckBox9 = null;
private JCheckBox jCheckBox10 = null;
@ -319,12 +325,16 @@ public class FpdBuildOptions extends IInternalFrame {
jButton4.setText("Add");
jButton4.addActionListener(new ActionListener() {
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};
o[1] = jTextField2.getText();
o[2] = jTextField4.getText();
ffc.genBuildOptionsUserDefAntTask(o[0]+"", null, o[2]+"");
antTaskTableModel.addRow(o);
docConsole.setSaved(false);
}
});
}
@ -344,6 +354,7 @@ public class FpdBuildOptions extends IInternalFrame {
jButton5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (selectedRow >= 0) {
docConsole.setSaved(false);
antTaskTableModel.removeRow(selectedRow);
ffc.removeBuildOptionsUserDefAntTask(selectedRow);
}
@ -544,7 +555,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTextField6 == null) {
jTextField6 = new JTextField();
jTextField6.setPreferredSize(new java.awt.Dimension(100,20));
jTextField6.setEditable(false);
jTextField6.setEditable(true);
jTextField6.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusLost(java.awt.event.FocusEvent e) {
if (jTable.getSelectedRow() < 0) {
@ -577,6 +588,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTextField6.getText().length() > 0) {
String[] row = {jTextField6.getText()};
ffsTableModel.addRow(row);
docConsole.setSaved(false);
ffc.genBuildOptionsFfs(jTextField6.getText(), jTextField.getText());
}
}
@ -605,6 +617,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
ffc.removeBuildOptionsFfs(jTable.getSelectedRow());
}
});
@ -657,6 +670,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (value.length() == 0){
return;
}
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsAttribute(jTable.getSelectedRow(), row, name, value);
}
}
@ -826,7 +840,14 @@ public class FpdBuildOptions extends IInternalFrame {
cb.addItem("CYGWIN");
cb.addItem("INTEL");
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.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
@ -859,17 +880,19 @@ public class FpdBuildOptions extends IInternalFrame {
}
String toolChain = m.getValueAt(row, 1) + "";
String archs = m.getValueAt(row, 2) + "";
Vector<Object> supArch = new Vector<Object>();
String[] sArray1 = archs.split("( )+");
for (int i = 0; i < sArray1.length; ++i) {
supArch.add(sArray1[i]);
}
if (supArch.size() == 0) {
supArch.add("IA32");
Vector<Object> supArch = null;
if (archs.length() > 0) {
supArch = new Vector<Object>();
String[] sArray1 = archs.split("( )+");
for (int i = 0; i < sArray1.length; ++i) {
supArch.add(sArray1[i]);
}
}
String toolCmd = m.getValueAt(row, 3) + "";
String tagName = m.getValueAt(row, 4) + "";
String contents = m.getValueAt(row, 5) + "";
docConsole.setSaved(false);
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,
jTextField8.getText(), jTextField13.getText(), jTextField7.getText()};
optionsTableModel.addRow(o);
docConsole.setSaved(false);
ffc.genBuildOptionsOpt(stringToVector(jTextField12.getText()), jComboBox2.getSelectedItem()+"", jTextField13.getText(), jTextField8.getText(), stringToVector(s), jTextField7.getText());
}
});
@ -911,9 +934,12 @@ public class FpdBuildOptions extends IInternalFrame {
private Vector<Object> stringToVector(String s) {
String[] sArray = s.split(" ");
Vector<Object> v = new Vector<Object>();
for (int i = 0; i < sArray.length; ++i) {
v.add(sArray[i]);
Vector<Object> v = null;
if (s.length() > 0) {
v = new Vector<Object>();
for (int i = 0; i < sArray.length; ++i) {
v.add(sArray[i]);
}
}
return v;
}
@ -963,6 +989,7 @@ public class FpdBuildOptions extends IInternalFrame {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (selectedRow >= 0) {
optionsTableModel.removeRow(selectedRow);
docConsole.setSaved(false);
ffc.removeBuildOptionsOpt(selectedRow);
}
}
@ -993,6 +1020,7 @@ public class FpdBuildOptions extends IInternalFrame {
}
Object[] o = {"", ""};
ffsAttributesTableModel.addRow(o);
docConsole.setSaved(false);
ffc.genBuildOptionsFfsAttribute(jTable.getSelectedRow(), "", "");
}
});
@ -1021,6 +1049,7 @@ public class FpdBuildOptions extends IInternalFrame {
return;
}
if (jTable4.getSelectedRow() >= 0){
docConsole.setSaved(false);
ffsAttributesTableModel.removeRow(jTable4.getSelectedRow());
ffc.removeBuildOptionsFfsAttribute(jTable.getSelectedRow(), jTable4.getSelectedRow());
}
@ -1240,7 +1269,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (id.length() == 0) {
return;
}
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsKey(row, id);
}
}
@ -1304,7 +1333,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check.
String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row, type);
}
}
@ -1366,6 +1395,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check.
String type = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), row, type);
}
}
@ -1425,6 +1455,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
String[] row = {"EFI_SECTION_RAW"};
sectionTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), row[0]);
@ -1450,6 +1481,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable1.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
sectionTableModel.removeRow(jTable1.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSection(jTable.getSelectedRow(), jTable1.getSelectedRow());
}
@ -1473,6 +1505,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
String[] row = {"EFI_SECTION_RAW"};
subsectionsTableModel.addRow(row);
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) {
return;
}
docConsole.setSaved(false);
subsectionsTableModel.removeRow(jTable3.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSectionsSection(jTable.getSelectedRow(), jTable6.getSelectedRow(), jTable3.getSelectedRow());
}
@ -1521,6 +1555,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
String[] row = {""};
sectionsTableModel.addRow(row);
ffc.genBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), "");
@ -1545,6 +1580,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable.getSelectedRow() < 0 || jTable6.getSelectedRow() < 0) {
return;
}
docConsole.setSaved(false);
sectionsTableModel.removeRow(jTable6.getSelectedRow());
ffc.removeBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), jTable6.getSelectedRow());
}
@ -1612,6 +1648,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check.
String encapType = m.getValueAt(row, 0) + "";
docConsole.setSaved(false);
ffc.updateBuildOptionsFfsSectionsSections(jTable.getSelectedRow(), row, encapType);
}
}
@ -1642,6 +1679,11 @@ public class FpdBuildOptions extends IInternalFrame {
ffc = new FpdFileContents(fpd);
init(ffc);
}
public FpdBuildOptions(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
private void init(FpdFileContents ffc) {
initOptionTable();

View File

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

View File

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

View File

@ -14,6 +14,7 @@ import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableModel;
import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
import org.tianocore.frameworkwizard.platform.ui.global.GlobalData;
import org.tianocore.frameworkwizard.platform.ui.id.ModuleIdentification;
@ -54,7 +55,7 @@ public class FpdFrameworkModules extends IInternalFrame {
private FpdModuleSA settingDlg = null;
private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
private Map<String, String> fpdMsa = null;
private ArrayList<ModuleIdentification> miList = null;
@ -198,6 +199,7 @@ public class FpdFrameworkModules extends IInternalFrame {
row[4] = mi.getPackage().getVersion();
}
model1.addRow(row);
docConsole.setSaved(false);
ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);
}
});
@ -277,7 +279,7 @@ public class FpdFrameworkModules extends IInternalFrame {
if (settingDlg == null) {
settingDlg = new FpdModuleSA(ffc);
}
docConsole.setSaved(false);
String mg = model1.getValueAt(selectedRow, 1)+"";
String mv = model1.getValueAt(selectedRow, 2)+"";
String pg = model1.getValueAt(selectedRow, 3)+"";
@ -312,6 +314,7 @@ public class FpdFrameworkModules extends IInternalFrame {
String pv = model1.getValueAt(selectedRow, 4).toString();
model1.removeRow(selectedRow);
fpdMsa.remove(mg+mv+pg+pv);
docConsole.setSaved(false);
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) {
try {
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 javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
@ -35,6 +37,7 @@ import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.frameworkwizard.common.DataValidation;
import org.tianocore.frameworkwizard.common.Log;
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.StarLabel;
@ -52,6 +55,7 @@ public class FpdHeader extends IInternalFrame {
///
private static final long serialVersionUID = -8152099582923006900L;
static JFrame frame;
//
//Define class members
//
@ -122,6 +126,8 @@ public class FpdHeader extends IInternalFrame {
private JTextField jTextField = null;
private FpdFileContents ffc = null;
private OpeningPlatformType docConsole = null;
/**
This method initializes jTextFieldBaseName
@ -136,6 +142,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldBaseName.addFocusListener(new FocusAdapter(){
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());
}
});
@ -156,6 +167,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250,20));
jTextFieldGuid.addFocusListener(new FocusAdapter(){
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());
}
});
@ -176,6 +192,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldVersion.addFocusListener(new FocusAdapter(){
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());
}
});
@ -209,10 +230,14 @@ public class FpdHeader extends IInternalFrame {
if (jTextAreaLicense == null) {
jTextAreaLicense = new JTextArea();
jTextAreaLicense.setText("");
jTextAreaLicense.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaLicense.setLineWrap(true);
jTextAreaLicense.addFocusListener(new FocusAdapter(){
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());
}
});
@ -230,9 +255,13 @@ public class FpdHeader extends IInternalFrame {
if (jTextAreaDescription == null) {
jTextAreaDescription = new JTextArea();
jTextAreaDescription.setLineWrap(true);
jTextAreaDescription.setPreferredSize(new java.awt.Dimension(317,77));
jTextAreaDescription.addFocusListener(new FocusAdapter(){
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());
}
});
@ -341,6 +370,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldAbstract.addFocusListener(new FocusAdapter(){
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());
}
});
@ -361,6 +395,11 @@ public class FpdHeader extends IInternalFrame {
jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20));
jTextFieldCopyright.addFocusListener(new FocusAdapter(){
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());
}
});
@ -382,6 +421,7 @@ public class FpdHeader extends IInternalFrame {
public void focusLost(FocusEvent e){
ffc.setFpdHdrLicense(jTextAreaLicense.getText());
ffc.setFpdHdrUrl(jTextField.getText());
docConsole.setSaved(false);
}
});
}
@ -414,6 +454,11 @@ public class FpdHeader extends IInternalFrame {
init(ffc);
}
public FpdHeader(OpeningPlatformType opt) {
this(opt.getXmlFpd());
docConsole = opt;
}
/**
This method initializes this
@ -576,7 +621,7 @@ public class FpdHeader extends IInternalFrame {
this.setEdited(false);
}
if (arg0.getSource() == jButtonGenerateGuid) {
//ToDo: invoke GuidValueEditor
docConsole.setSaved(false);
jTextFieldGuid.setText(Tools.generateUuidString());
ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
}

View File

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