import javax.swing.JScrollPane;\r
import javax.swing.JSplitPane;\r
import javax.swing.JTabbedPane;\r
+import javax.swing.ToolTipManager;\r
import javax.swing.event.MenuEvent;\r
import javax.swing.event.MenuListener;\r
import javax.swing.event.TreeSelectionEvent;\r
import org.tianocore.frameworkwizard.far.updateui.UpdateStepOne;\r
import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
import org.tianocore.frameworkwizard.module.ui.ModuleBootModes;\r
+import org.tianocore.frameworkwizard.module.ui.ModuleBuildOptions;\r
import org.tianocore.frameworkwizard.module.ui.ModuleDataHubs;\r
import org.tianocore.frameworkwizard.module.ui.ModuleEvents;\r
import org.tianocore.frameworkwizard.module.ui.ModuleExterns;\r
/// Define class Serial Version UID\r
///\r
private static final long serialVersionUID = -7103240960573031772L;\r
+ \r
+ //\r
+ // Set ToolTipText Show Time\r
+ //\r
+ static { ToolTipManager.sharedInstance().setDismissDelay(18000);} \r
+\r
\r
///\r
/// Used to record current operation target\r
private JMenuItem getJMenuItemHelpAbout() {\r
if (jMenuItemHelpAbout == null) {\r
jMenuItemHelpAbout = new JMenuItem();\r
- jMenuItemHelpAbout.setText("About...");\r
+ jMenuItemHelpAbout.setText("About");\r
jMenuItemHelpAbout.setMnemonic('A');\r
jMenuItemHelpAbout.addActionListener(this);\r
}\r
private JMenuItem getJMenuItemToolsBuildPreferences() {\r
if (jMenuItemToolsBuildPreferences == null) {\r
jMenuItemToolsBuildPreferences = new JMenuItem();\r
- jMenuItemToolsBuildPreferences.setText("Build Preferences");\r
+ jMenuItemToolsBuildPreferences.setText("Build Preferences...");\r
jMenuItemToolsBuildPreferences.setMnemonic('P');\r
jMenuItemToolsBuildPreferences.setEnabled(true);\r
jMenuItemToolsBuildPreferences.addActionListener(this);\r
private JMenuItem getJMenuItemProjectInstallFar() {\r
if (jMenuItemProjectInstallFar == null) {\r
jMenuItemProjectInstallFar = new JMenuItem();\r
- jMenuItemProjectInstallFar.setText("Install FAR");\r
+ jMenuItemProjectInstallFar.setText("Install FAR...");\r
jMenuItemProjectInstallFar.setMnemonic('I');\r
jMenuItemProjectInstallFar.setEnabled(true);\r
jMenuItemProjectInstallFar.addActionListener(this);\r
private JMenuItem getJMenuItemProjectUpdateFar() {\r
if (jMenuItemProjectUpdateFar == null) {\r
jMenuItemProjectUpdateFar = new JMenuItem();\r
- jMenuItemProjectUpdateFar.setText("Update FAR");\r
+ jMenuItemProjectUpdateFar.setText("Update FAR...");\r
jMenuItemProjectUpdateFar.setMnemonic('U');\r
jMenuItemProjectUpdateFar.setEnabled(true);\r
jMenuItemProjectUpdateFar.addActionListener(this);\r
private JMenuItem getJMenuItemProjectRemoveFar() {\r
if (jMenuItemProjectRemoveFar == null) {\r
jMenuItemProjectRemoveFar = new JMenuItem();\r
- jMenuItemProjectRemoveFar.setText("Remove FAR");\r
+ jMenuItemProjectRemoveFar.setText("Remove FAR...");\r
jMenuItemProjectRemoveFar.setMnemonic('R');\r
jMenuItemProjectRemoveFar.setEnabled(true);\r
jMenuItemProjectRemoveFar.addActionListener(this);\r
private JMenuItem getJMenuItemProjectCreateFar() {\r
if (jMenuItemProjectCreateFar == null) {\r
jMenuItemProjectCreateFar = new JMenuItem();\r
- jMenuItemProjectCreateFar.setText("Create FAR");\r
+ jMenuItemProjectCreateFar.setText("Create FAR...");\r
jMenuItemProjectCreateFar.setMnemonic('C');\r
jMenuItemProjectCreateFar.addActionListener(this);\r
}\r
private JMenuItem getJMenuItemToolsGenerateGuidsXref() {\r
if (jMenuItemToolsGenerateGuidsXref == null) {\r
jMenuItemToolsGenerateGuidsXref = new JMenuItem();\r
- jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref");\r
+ jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref...");\r
jMenuItemToolsGenerateGuidsXref.setMnemonic('G');\r
jMenuItemToolsGenerateGuidsXref.addActionListener(this);\r
}\r
//\r
SplashScreen ss = new SplashScreen();\r
ss.setVisible(true);\r
- \r
+\r
//\r
// Init Global Data\r
//\r
// Close splash screen\r
//\r
ss.dispose();\r
-\r
+ \r
//\r
// Init the frame\r
//\r
\r
if (arg0.getSource() == this.jMenuItemFileCloseAll) {\r
this.closeAll();\r
+ this.refresh();\r
this.makeEmptyTree();\r
}\r
\r
}\r
\r
if (arg0.getSource() == this.jMenuItemFileRefresh) {\r
- this.closeAll();\r
- this.refresh();\r
- this.makeEmptyTree();\r
+ if (this.closeAll() == 0) {\r
+ this.refresh();\r
+ this.makeEmptyTree();\r
+ }\r
}\r
\r
if (arg0.getSource() == this.jMenuItemFileExit) {\r
iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id,\r
belongNode));\r
iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id, belongNode));\r
+ iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.MSA_BUILDOPTIONS, true, id, belongNode));\r
}\r
\r
private void insertPackageTreeNode(Identification id) {\r
ModulePCDs frmPcd = new ModulePCDs(msa);\r
getJDesktopPaneModule().add(frmPcd, 1);\r
break;\r
+ case IDefaultMutableTreeNode.MSA_BUILDOPTIONS:\r
+ ModuleBuildOptions frmMbo = new ModuleBuildOptions(msa);\r
+ getJDesktopPaneModule().add(frmMbo, 1);\r
+ break;\r
}\r
this.jTabbedPaneEditor.setSelectedIndex(0);\r
resizeDesktopPanel();\r
if (!GlobalData.openingModuleList.getModuleSaved(currentOpeningModuleIndex)) {\r
int result = showSaveDialog();\r
if (result == JOptionPane.YES_OPTION) {\r
- this.saveAll();\r
+ this.save();\r
}\r
if (result == JOptionPane.NO_OPTION) {\r
// Do nothing\r
iTree.removeNodeChildrenByPath(item);\r
}\r
\r
+ GlobalData.openingModuleList.reload(this.currentOpeningModuleIndex);\r
GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false);\r
+ GlobalData.openingModuleList.setModuleSaved(this.currentOpeningModuleIndex, true);\r
+ \r
this.cleanDesktopPaneModule();\r
this.currentOpeningModuleIndex = -1;\r
}\r
if (!GlobalData.openingPackageList.getPackageSaved(currentOpeningPackageIndex)) {\r
int result = showSaveDialog();\r
if (result == JOptionPane.YES_OPTION) {\r
- this.saveAll();\r
+ this.save();\r
}\r
if (result == JOptionPane.NO_OPTION) {\r
// Do nothing\r
iTree.removeNodeChildrenByPath(item);\r
}\r
\r
+ GlobalData.openingPackageList.reload(this.currentOpeningPackageIndex);\r
GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false);\r
+ GlobalData.openingPackageList.setPackageSaved(this.currentOpeningPackageIndex, true);\r
this.cleanDesktopPanePackage();\r
this.currentOpeningPackageIndex = -1;\r
}\r
if (!GlobalData.openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) {\r
int result = showSaveDialog();\r
if (result == JOptionPane.YES_OPTION) {\r
- this.saveAll();\r
+ this.save();\r
}\r
if (result == JOptionPane.NO_OPTION) {\r
// Do nothing\r
iTree.removeNodeChildrenByPath(item);\r
}\r
\r
+ GlobalData.openingPlatformList.reload(this.currentOpeningPlatformIndex);\r
GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false);\r
+ GlobalData.openingPlatformList.setPlatformSaved(this.currentOpeningPlatformIndex, true);\r
this.cleanDesktopPanePlatform();\r
this.currentOpeningPlatformIndex = -1;\r
}\r
Close all opening files and clean all showing internal frame\r
\r
**/\r
- private void closeAll() {\r
- int result = -1;\r
+ private int closeAll() {\r
+ int result = JOptionPane.NO_OPTION;\r
if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()\r
|| !GlobalData.openingPlatformList.isSaved()) {\r
result = showSaveDialog();\r
// Do nothing\r
//\r
}\r
- if (result == JOptionPane.CANCEL_OPTION) {\r
- return;\r
+ if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {\r
+ return -1;\r
}\r
this.cleanDesktopPane();\r
GlobalData.openingModuleList.closeAll();\r
GlobalData.openingPackageList.closeAll();\r
GlobalData.openingPlatformList.closeAll();\r
+\r
+ return 0;\r
}\r
\r
/**\r
\r
**/\r
private void exit() {\r
- int result = -1;\r
+ int result = JOptionPane.NO_OPTION;\r
if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()\r
|| !GlobalData.openingPlatformList.isSaved()) {\r
result = showSaveDialog();\r
}\r
if (result == JOptionPane.YES_OPTION) {\r
this.saveAll();\r
- }\r
- if (result == JOptionPane.NO_OPTION) {\r
+ } else if (result == JOptionPane.NO_OPTION) {\r
// Do nothing\r
- }\r
- if (result == JOptionPane.CANCEL_OPTION) {\r
+ } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {\r
return;\r
}\r
this.dispose();\r
// Refrash the tree\r
//\r
this.refresh();\r
+ this.makeEmptyTree();\r
}\r
sw.dispose();\r
}\r
//\r
// Enable close/close all if some files are opened\r
//\r
- jMenuItemFileClose.setEnabled(GlobalData.openingModuleList.isOpen()\r
- || GlobalData.openingPackageList.isOpen()\r
- || GlobalData.openingPlatformList.isOpen());\r
+ switch (this.jTabbedPaneEditor.getSelectedIndex()) {\r
+ case 0:\r
+ jMenuItemFileClose\r
+ .setEnabled(GlobalData.openingModuleList\r
+ .getModuleOpen(this.currentOpeningModuleIndex));\r
+ jMenuItemFileSave\r
+ .setEnabled(!GlobalData.openingModuleList\r
+ .getModuleSaved(this.currentOpeningModuleIndex));\r
+ break;\r
+ case 1:\r
+ jMenuItemFileClose\r
+ .setEnabled(GlobalData.openingPackageList\r
+ .getPackageOpen(this.currentOpeningPackageIndex));\r
+ jMenuItemFileSave\r
+ .setEnabled(!GlobalData.openingPackageList\r
+ .getPackageSaved(this.currentOpeningPackageIndex));\r
+ break;\r
+ case 2:\r
+ jMenuItemFileClose\r
+ .setEnabled(GlobalData.openingPlatformList\r
+ .getPlatformOpen(this.currentOpeningPlatformIndex));\r
+ jMenuItemFileSave\r
+ .setEnabled(!GlobalData.openingPlatformList\r
+ .getPlatformSaved(this.currentOpeningPlatformIndex));\r
+ break;\r
+ }\r
jMenuItemFileCloseAll.setEnabled(GlobalData.openingModuleList.isOpen()\r
|| GlobalData.openingPackageList.isOpen()\r
|| GlobalData.openingPlatformList.isOpen());\r
//\r
// Enable save/save all if some files are changed\r
//\r
- jMenuItemFileSave.setEnabled(!GlobalData.openingModuleList.isSaved()\r
- || !GlobalData.openingPackageList.isSaved()\r
- || !GlobalData.openingPlatformList.isSaved());\r
jMenuItemFileSaveAll.setEnabled(!GlobalData.openingModuleList.isSaved()\r
|| !GlobalData.openingPackageList.isSaved()\r
|| !GlobalData.openingPlatformList.isSaved());\r
JOptionPane\r
.showConfirmDialog(\r
null,\r
- "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. " +\r
- DataType.LINE_SEPARATOR + DataType.LINE_SEPARATOR + "NOTICE:" +\r
- DataType.LINE_SEPARATOR + "This does not change the System Environment Variable." +\r
- DataType.LINE_SEPARATOR + "It only applies to where the Wizard will manage modification and file creations.",\r
+ "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. "\r
+ + DataType.LINE_SEPARATOR\r
+ + DataType.LINE_SEPARATOR\r
+ + "NOTICE:"\r
+ + DataType.LINE_SEPARATOR\r
+ + "This does not change the System Environment Variable."\r
+ + DataType.LINE_SEPARATOR\r
+ + "It only applies to where the Wizard will manage modification and file creations.",\r
"Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);\r
SwitchWorkspace sw = new SwitchWorkspace(this, true);\r
int result = sw.showDialog();\r
JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);\r
this.dispose();\r
System.exit(0);\r
+ case Workspace.WORKSPACE_NO_TARGET_FILE:\r
+ JOptionPane.showConfirmDialog(null, "Target.txt File Is Not Existed", "Error", JOptionPane.DEFAULT_OPTION,\r
+ JOptionPane.ERROR_MESSAGE);\r
+ this.dispose();\r
+ System.exit(0);\r
}\r
}\r
}\r