Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorkmoore2010-04-28 21:41:15 +0000
committerkmoore2010-04-28 21:41:15 +0000
commitb11e775a1a528b27b19d3d6f4c391601f89faded (patch)
tree78e3eb24784f1d71d21b0bd444c41ff017b25d25 /jpa
parentb0ca27bb20c820c6fc2337625107726b35b069b4 (diff)
downloadwebtools.dali-b11e775a1a528b27b19d3d6f4c391601f89faded.tar.gz
webtools.dali-b11e775a1a528b27b19d3d6f4c391601f89faded.tar.xz
webtools.dali-b11e775a1a528b27b19d3d6f4c391601f89faded.zip
295023 - fixed a regression in this bug, the project level setting for overriding the workspace preferences was getting set in the preferences even if you canceled the dialog
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java20
2 files changed, 14 insertions, 8 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java
index a12d31a685..30579306fc 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java
@@ -130,7 +130,7 @@ public class JpaValidationPreferences {
return PROBLEM_PREFIX + messageId;
}
- private static void flush(IEclipsePreferences prefs) {
+ public static void flush(IEclipsePreferences prefs) {
try {
prefs.flush();
} catch(BackingStoreException ex) {
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
index 1a0c6fcdb2..ac3bff430b 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
@@ -151,6 +151,8 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
*/
public static final String SETTINGS_SECTION_NAME = "JpaProblemSeveritiesPage"; //$NON-NLS-1$
+ private Boolean hasProjectSpecificPreferences = null;
+
/**
* Creates a new <code>JpaProblemSeveritiesPage</code>.
*/
@@ -744,13 +746,7 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
return;
}
- IEclipsePreferences projectPreferences = getProjectPreferences(getProject());
- if (useProjectSpecificSettings) {
- projectPreferences.putBoolean(JpaValidationPreferences.WORKSPACE_PREFERENCES_OVERRIDEN, true);
- }
- else {
- projectPreferences.remove(JpaValidationPreferences.WORKSPACE_PREFERENCES_OVERRIDEN);
- }
+ this.hasProjectSpecificPreferences = Boolean.valueOf(useProjectSpecificSettings);
//set all specified workspace preferences in the project preferences
if (useProjectSpecificSettings){
@@ -801,6 +797,16 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
@Override
public boolean performOk() {
super.performOk();
+ if (this.hasProjectSpecificPreferences != null) {
+ IEclipsePreferences projectPreferences = getProjectPreferences(getProject());
+ if (this.hasProjectSpecificPreferences.booleanValue()) {
+ projectPreferences.putBoolean(JpaValidationPreferences.WORKSPACE_PREFERENCES_OVERRIDEN, true);
+ }
+ else {
+ projectPreferences.remove(JpaValidationPreferences.WORKSPACE_PREFERENCES_OVERRIDEN);
+ }
+ JpaValidationPreferences.flush(projectPreferences);
+ }
for (String validationPreferenceKey : this.severityLevels.keySet()) {
updatePreference(validationPreferenceKey, this.severityLevels.get(validationPreferenceKey));
}

Back to the top