\r
import javax.swing.AbstractAction;\r
import javax.swing.JFileChooser;\r
-import javax.swing.JFrame;\r
import javax.swing.JOptionPane;\r
import javax.swing.JTabbedPane;\r
import javax.swing.JButton;\r
import javax.swing.ListSelectionModel;\r
\r
import org.tianocore.PlatformSurfaceAreaDocument;\r
+import org.tianocore.frameworkwizard.FrameworkWizardUI;\r
import org.tianocore.frameworkwizard.common.DataValidation;\r
import org.tianocore.frameworkwizard.common.IDefaultTableModel;\r
import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
*/\r
private static final long serialVersionUID = 1L;\r
private final int startIndexOfDynamicTab = 2;\r
- static JFrame frame;\r
private JPanel jContentPane = null;\r
private JPanel jPanelContentEast = null;\r
private JPanel jPanelContentSouth = null;\r
docConsole = opt;\r
if (memModified) {\r
docConsole.setSaved(false);\r
- JOptionPane.showMessageDialog(frame, "Platform Synced with FDF file.");\r
+ JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Platform Synced with FDF file.");\r
memModified = false;\r
}\r
}\r
JFileChooser chooser = new JFileChooser(wsDir);\r
chooser.setMultiSelectionEnabled(false);\r
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\r
- int retval = chooser.showOpenDialog(frame);\r
+ int retval = chooser.showOpenDialog(FpdFlash.this);\r
if (retval == JFileChooser.APPROVE_OPTION) {\r
\r
File theFile = chooser.getSelectedFile();\r
String filePath = theFile.getPath();\r
if (!filePath.startsWith(wsDir)) {\r
- JOptionPane.showMessageDialog(frame, "You can only select files in current WORKSPACE.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, "You can only select files in current WORKSPACE.");\r
return;\r
}\r
jTextFieldFdf.setText(filePath.substring(wsDir.length() + 1).replace('\\', '/'));\r
getFvInfoFromFdf(fdfPath, vFvInfo);\r
getFlashInfoFromFdf (fdfPath);\r
if (!erasePolarity.equals("1") && !erasePolarity.equals("0")) {\r
- JOptionPane.showMessageDialog(frame, "FDF file does NOT contain valid Erase Polarity.");\r
+ JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "FDF file does NOT contain valid Erase Polarity.");\r
}\r
else {\r
ffc.setTypedFvImageNameValue("Attributes", "EFI_ERASE_POLARITY", erasePolarity);\r
if (vBlockSize.size() > 0) {\r
blkSize = vBlockSize.get(0);\r
if (!DataValidation.isInt(blkSize) && !DataValidation.isHexDoubleWordDataType(blkSize)) {\r
- JOptionPane.showMessageDialog(frame, "FDF file does NOT contain valid FV block size. Default size 0x10000 will be used.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, "FDF file does NOT contain valid FV block size. Default size 0x10000 will be used.");\r
blkSize = defaultBlkSize;\r
}\r
}\r
}\r
}\r
catch (NumberFormatException e){\r
- JOptionPane.showMessageDialog(frame, e.getMessage());\r
+ JOptionPane.showMessageDialog(FpdFlash.this, e.getMessage());\r
}\r
}\r
\r
return;\r
}\r
if (fvNameExists(newFvName)) {\r
- JOptionPane.showMessageDialog(frame, "This FV already exists. Please choose another FV name.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, "This FV already exists. Please choose another FV name.");\r
m.setValueAt(oldFvName, row, 0);\r
return;\r
}\r
if (col == 1 && !sizeFromOptionDlg) {\r
String fvSize = m.getValueAt(row, col) + "";\r
if (!DataValidation.isInt(fvSize) && !DataValidation.isHexDoubleWordDataType(fvSize)) {\r
- JOptionPane.showMessageDialog(frame, "FV size should be Integer or Hex format.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, "FV size should be Integer or Hex format.");\r
return;\r
}\r
HashMap<String, String> mFvOpts = new HashMap<String, String>();\r
}\r
else {\r
if (!DataValidation.isInt(blkSize) && !DataValidation.isHexDoubleWordDataType(blkSize)) {\r
- int retVal = JOptionPane.showConfirmDialog(frame, "Confirm", "FPD file contains error block size format. Would you like to replace it with a default value?", JOptionPane.YES_NO_OPTION);\r
+ int retVal = JOptionPane.showConfirmDialog(FpdFlash.this, "Confirm", "FPD file contains error block size format. Would you like to replace it with a default value?", JOptionPane.YES_NO_OPTION);\r
if (retVal == JOptionPane.YES_OPTION) {\r
ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_BLOCK_SIZE", defaultBlkSize, null);\r
int fs = Integer.decode(fvSize);\r
boolean numOfBlockWellFormat = true;\r
if (!DataValidation.isHexDoubleWordDataType(bSize) && !DataValidation.isInt(bSize)) {\r
blockSizeWellFormat = false;\r
- JOptionPane.showMessageDialog(frame, fvName + " block size bad format.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, fvName + " block size bad format.");\r
} \r
if (!DataValidation.isHexDoubleWordDataType(numBlks) && !DataValidation.isInt(numBlks)) {\r
numOfBlockWellFormat = false;\r
- JOptionPane.showMessageDialog(frame, fvName + " number of blocks bad format.");\r
+ JOptionPane.showMessageDialog(FpdFlash.this, fvName + " number of blocks bad format.");\r
}\r
if (blockSizeWellFormat && numOfBlockWellFormat) {\r
int size = Integer.decode(bSize);\r