//private JToolBar jToolBarEdit = null;\r
\r
//private JToolBar jToolBarWindow = null;\r
+ \r
+ private static FrameworkWizardUI fwui = null;\r
+ \r
+ public static FrameworkWizardUI getInstance() {\r
+ if (fwui == null) {\r
+ fwui = new FrameworkWizardUI();\r
+ }\r
+ return fwui;\r
+ }\r
\r
/**\r
This method initializes jMenuBar \r
* \r
*/\r
public static void main(String[] args) {\r
- FrameworkWizardUI module = new FrameworkWizardUI();\r
+ FrameworkWizardUI module = FrameworkWizardUI.getInstance();\r
module.setVisible(true);\r
}\r
\r
\r
**/\r
private void setupToolChainConfiguration() {\r
- ToolChainConfig tcc = new ToolChainConfig(this, true);\r
- int result = tcc.showDialog();\r
- \r
- if (result == DataType.RETURN_TYPE_CANCEL) {\r
- tcc.dispose();\r
- }\r
+ ToolChainConfig tcc = ToolChainConfig.getInstance();\r
+ tcc.showDialog();\r
}\r
\r
/**\r
private JRadioButton getJRadioButtonPlatform() {\r
if (jRadioButtonPlatform == null) {\r
jRadioButtonPlatform = new JRadioButton();\r
- jRadioButtonPlatform.setText(DataType.PACKAGE_SURFACE_AREA);\r
+ jRadioButtonPlatform.setText(DataType.PLATFORM_SURFACE_AREA);\r
jRadioButtonPlatform.setBounds(new java.awt.Rectangle(20, 80, 240, 20));\r
}\r
return jRadioButtonPlatform;\r
private void init() {\r
this.setSize(310, 220);\r
this.setContentPane(getJContentPane());\r
- this.setTitle("New Framework File");\r
+ this.setTitle("Select New File Type");\r
this.centerWindow();\r
}\r
\r
private void init() {\r
this.setSize(500, 200);\r
this.setContentPane(getJContentPane());\r
- this.setTitle("New Module");\r
+ this.setTitle("New");\r
this.centerWindow();\r
}\r
\r
package org.tianocore.frameworkwizard;\r
\r
import java.awt.event.ActionEvent;\r
+import java.awt.event.WindowEvent;\r
import java.io.File;\r
import java.io.IOException;\r
\r
import org.tianocore.frameworkwizard.common.Tools;\r
import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;\r
import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigVector;\r
-import org.tianocore.frameworkwizard.common.ui.IDialog;\r
import org.tianocore.frameworkwizard.common.ui.IFrame;\r
import org.tianocore.frameworkwizard.workspace.Workspace;\r
\r
-public class ToolChainConfig extends IDialog implements ListSelectionListener, TableModelListener{\r
+public class ToolChainConfig extends IFrame implements ListSelectionListener, TableModelListener{\r
\r
///\r
/// Define Class Members\r
\r
private JButton jButtonHelp = null;\r
\r
+ private static ToolChainConfig tcc = null;\r
+ \r
+ private ToolChainConfigHelp tcch = null;\r
+ \r
/**\r
This method initializes jScrollPane \r
\r
// TODO Auto-generated method stub\r
\r
}\r
+ \r
+ public static ToolChainConfig getInstance() {\r
+ if (tcc == null) {\r
+ tcc = new ToolChainConfig();\r
+ }\r
+ return tcc;\r
+ }\r
\r
/**\r
* This is the default constructor\r
*/\r
- public ToolChainConfig(IFrame parentFrame, boolean modal) {\r
- super(parentFrame, modal);\r
+ public ToolChainConfig() {\r
+ super();\r
init();\r
}\r
\r
*/\r
public void actionPerformed(ActionEvent arg0) {\r
if (arg0.getSource() == jButtonClose) {\r
- this.setVisible(false);\r
- this.returnType = DataType.RETURN_TYPE_CANCEL;\r
+ this.exit();\r
}\r
\r
if (arg0.getSource() == jButtonOpen) {\r
}\r
\r
if (arg0.getSource() == jButtonHelp) {\r
- ToolChainConfigHelp tcch = new ToolChainConfigHelp();\r
+ tcch = ToolChainConfigHelp.getInstance();\r
tcch.setVisible(true);\r
}\r
}\r
this.vtcc.getToolChainConfigs(row).setValue(m.getValueAt(row, 1).toString());\r
}\r
}\r
+ \r
+ /* (non-Javadoc)\r
+ * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)\r
+ *\r
+ * Override windowClosing to popup warning message to confirm quit\r
+ * \r
+ */\r
+ public void windowClosing(WindowEvent arg0) {\r
+ this.exit();\r
+ }\r
+ \r
+ private void exit() {\r
+ this.setVisible(false);\r
+ if (tcch != null) {\r
+ tcch.dispose();\r
+ }\r
+ }\r
}\r
private JTextPane jTextPane = null;\r
\r
private JButton jButtonClose = null;\r
+ \r
+ private static ToolChainConfigHelp tcch = null;\r
\r
/**\r
* This method initializes jTextPane \r
jTextPane.setBackground(new java.awt.Color(238,238,238));\r
jTextPane.setEditable(false);\r
helpContent = helpContent\r
- + "The coding forthe Property is: TARGET_TAGNAME_ARCH_COMMAND_ATTR" + DataType.UNIX_LINE_SEPARATOR\r
+ + "The coding for the Property is: TARGET_TAGNAME_ARCH_COMMAND_ATTR" + DataType.UNIX_LINE_SEPARATOR\r
+ "The Value, is either afull path, full path and filename or a reserved word." + DataType.UNIX_LINE_SEPARATOR\r
+ DataType.UNIX_LINE_SEPARATOR\r
+ DataType.UNIX_LINE_SEPARATOR\r
+ "NOTE: The \"*\" symbol may be used as a wildcard character in most of these fields, refer to the tools_def.txt and the \"EDK II Build and Packaging Architecture Specification\" for more details." + DataType.UNIX_LINE_SEPARATOR\r
+ DataType.UNIX_LINE_SEPARATOR;\r
\r
- \r
jTextPane.setText(helpContent);\r
}\r
return jTextPane;\r
return jButtonClose;\r
}\r
\r
+ public static ToolChainConfigHelp getInstance() {\r
+ if (tcch == null) {\r
+ tcch = new ToolChainConfigHelp();\r
+ }\r
+ return tcch;\r
+ }\r
+ \r
/**\r
\r
@param args\r
*/\r
private void initialize() {\r
this.setSize(625, 520);\r
+ this.setResizable(false);\r
this.setTitle("How to Setup Tool Chain Configuration");\r
this.setContentPane(getJContentPane());\r
}\r
if (arg0.getSource() == jButtonClose) {\r
this.dispose();\r
}\r
- \r
}\r
-\r
}\r
// 1 - Whne editing module\r
//\r
private int intExitType = 0;\r
-\r
+ \r
/**\r
Main class, used for test\r
\r
public int showSaveDialog() {\r
return JOptionPane.showConfirmDialog(null, "Save all changed files?", "Save", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);\r
}\r
+ \r
+ /**\r
+ Check the input data is empty or not\r
+ \r
+ @param strValue The input data which need be checked\r
+ \r
+ @retval true - The input data is empty\r
+ @retval fals - The input data is not empty\r
+ \r
+ **/\r
+ public boolean isEmpty(String strValue) {\r
+ if (strValue.length() > 0) {\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+ \r
+ /**\r
+ Display the dialog\r
+ \r
+ **/\r
+ public void showDialog() {\r
+ this.setVisible(true);\r
+ }\r
}\r