summaryrefslogtreecommitdiff
path: root/Tools/Java/Source
diff options
context:
space:
mode:
authorhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-31 03:25:05 +0000
committerhche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-31 03:25:05 +0000
commite421fb258cc4c908b2804554a758e14cba784ee7 (patch)
tree0186a5912c0973a9b30c26cfe6928c5cf514d97d /Tools/Java/Source
parent8b44bd1d51d17c20f2fcfc70409d406d414f62dd (diff)
downloadedk2-platforms-e421fb258cc4c908b2804554a758e14cba784ee7.tar.xz
1. Fix EDKT437 Save is to save current modified file, Save All is to save all modified files
2. Fix EDKT438 Close should save current modified file only, Close All should save all modified file git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1871 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Java/Source')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java60
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java2
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java2
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java2
4 files changed, 45 insertions, 21 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
index 70c154f394..b8bb5581c5 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
@@ -1819,7 +1819,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
SplashScreen ss = new SplashScreen();
ss.setVisible(true);
-
+
//
// Init Global Data
//
@@ -1905,7 +1905,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (arg0.getSource() == this.jMenuItemFileRefresh) {
if (this.closeAll() == 0) {
this.refresh();
- this.makeEmptyTree();
+ this.makeEmptyTree();
}
}
@@ -3086,7 +3086,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (!GlobalData.openingModuleList.getModuleSaved(currentOpeningModuleIndex)) {
int result = showSaveDialog();
if (result == JOptionPane.YES_OPTION) {
- this.saveAll();
+ this.save();
}
if (result == JOptionPane.NO_OPTION) {
// Do nothing
@@ -3121,7 +3121,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (!GlobalData.openingPackageList.getPackageSaved(currentOpeningPackageIndex)) {
int result = showSaveDialog();
if (result == JOptionPane.YES_OPTION) {
- this.saveAll();
+ this.save();
}
if (result == JOptionPane.NO_OPTION) {
// Do nothing
@@ -3156,7 +3156,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
if (!GlobalData.openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) {
int result = showSaveDialog();
if (result == JOptionPane.YES_OPTION) {
- this.saveAll();
+ this.save();
}
if (result == JOptionPane.NO_OPTION) {
// Do nothing
@@ -3211,7 +3211,7 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
GlobalData.openingModuleList.closeAll();
GlobalData.openingPackageList.closeAll();
GlobalData.openingPlatformList.closeAll();
-
+
return 0;
}
@@ -3557,9 +3557,32 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
// Enable close/close all if some files are opened
//
- jMenuItemFileClose.setEnabled(GlobalData.openingModuleList.isOpen()
- || GlobalData.openingPackageList.isOpen()
- || GlobalData.openingPlatformList.isOpen());
+ switch (this.jTabbedPaneEditor.getSelectedIndex()) {
+ case 0:
+ jMenuItemFileClose
+ .setEnabled(GlobalData.openingModuleList
+ .getModuleOpen(this.currentOpeningModuleIndex));
+ jMenuItemFileSave
+ .setEnabled(!GlobalData.openingModuleList
+ .getModuleSaved(this.currentOpeningModuleIndex));
+ break;
+ case 1:
+ jMenuItemFileClose
+ .setEnabled(GlobalData.openingPackageList
+ .getPackageOpen(this.currentOpeningPackageIndex));
+ jMenuItemFileSave
+ .setEnabled(!GlobalData.openingPackageList
+ .getPackageSaved(this.currentOpeningPackageIndex));
+ break;
+ case 2:
+ jMenuItemFileClose
+ .setEnabled(GlobalData.openingPlatformList
+ .getPlatformOpen(this.currentOpeningPlatformIndex));
+ jMenuItemFileSave
+ .setEnabled(!GlobalData.openingPlatformList
+ .getPlatformSaved(this.currentOpeningPlatformIndex));
+ break;
+ }
jMenuItemFileCloseAll.setEnabled(GlobalData.openingModuleList.isOpen()
|| GlobalData.openingPackageList.isOpen()
|| GlobalData.openingPlatformList.isOpen());
@@ -3567,9 +3590,6 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
//
// Enable save/save all if some files are changed
//
- jMenuItemFileSave.setEnabled(!GlobalData.openingModuleList.isSaved()
- || !GlobalData.openingPackageList.isSaved()
- || !GlobalData.openingPlatformList.isSaved());
jMenuItemFileSaveAll.setEnabled(!GlobalData.openingModuleList.isSaved()
|| !GlobalData.openingPackageList.isSaved()
|| !GlobalData.openingPlatformList.isSaved());
@@ -3684,10 +3704,14 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
JOptionPane
.showConfirmDialog(
null,
- "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. " +
- DataType.LINE_SEPARATOR + DataType.LINE_SEPARATOR + "NOTICE:" +
- DataType.LINE_SEPARATOR + "This does not change the System Environment Variable." +
- DataType.LINE_SEPARATOR + "It only applies to where the Wizard will manage modification and file creations.",
+ "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. "
+ + DataType.LINE_SEPARATOR
+ + DataType.LINE_SEPARATOR
+ + "NOTICE:"
+ + DataType.LINE_SEPARATOR
+ + "This does not change the System Environment Variable."
+ + DataType.LINE_SEPARATOR
+ + "It only applies to where the Wizard will manage modification and file creations.",
"Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
SwitchWorkspace sw = new SwitchWorkspace(this, true);
int result = sw.showDialog();
@@ -3714,8 +3738,8 @@ public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListe
this.dispose();
System.exit(0);
case Workspace.WORKSPACE_NO_TARGET_FILE:
- JOptionPane.showConfirmDialog(null, "Target.txt File Is Not Existed", "Error",
- JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showConfirmDialog(null, "Target.txt File Is Not Existed", "Error", JOptionPane.DEFAULT_OPTION,
+ JOptionPane.ERROR_MESSAGE);
this.dispose();
System.exit(0);
}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
index df52b8a34d..174b72fef0 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
@@ -137,7 +137,7 @@ public class OpeningModuleList {
if (index > -1) {
return vOpeningModuleList.elementAt(index).isOpen();
}
- return true;
+ return false;
}
public void setTreePathById(ModuleIdentification id, Set<TreePath> treePath) {
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
index 44ccfa1fb1..3f008f12eb 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
@@ -137,7 +137,7 @@ public class OpeningPackageList {
if (index > -1) {
return vOpeningPackageList.elementAt(index).isOpen();
}
- return true;
+ return false;
}
public void setTreePathById(PackageIdentification id, Set<TreePath> treePath) {
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
index 40275e9eb3..cee2f8caad 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
@@ -139,7 +139,7 @@ public class OpeningPlatformList {
if (index > -1) {
return vOpeningPlatformList.elementAt(index).isOpen();
}
- return true;
+ return false;
}
public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {