diff options
author | Brian Vosburgh | 2013-02-21 16:57:51 +0000 |
---|---|---|
committer | Brian Vosburgh | 2013-02-21 16:57:51 +0000 |
commit | 7bbcca27d692ddd1ec6624f7a0cff96ce0fb839b (patch) | |
tree | 213cdd6f232c7428e2c1aea845067012fc066af2 | |
parent | 54c8aa4ef42cf62c0568ff3da6ae4808992711de (diff) | |
download | webtools.dali-7bbcca27d692ddd1ec6624f7a0cff96ce0fb839b.tar.gz webtools.dali-7bbcca27d692ddd1ec6624f7a0cff96ce0fb839b.tar.xz webtools.dali-7bbcca27d692ddd1ec6624f7a0cff96ce0fb839b.zip |
whoops - fix CCE in Problem Severities Page
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java index fedc24e344..3908651c62 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java @@ -123,8 +123,8 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { private static final String JPT_PROPERTY_PAGES_PROBLEM_SEVERITIES_ID = "org.eclipse.jpt.jpa.ui.jpaProblemSeveritiesProperties"; //$NON-NLS-1$ /** - * A constant used to store and retrieve the preference key (message ID) from - * the combo. + * A constant used to store and retrieve the corresponding validation + * message from the combo. */ private static final String PREFERENCE_KEY = "preferenceKey"; //$NON-NLS-1$ @@ -661,7 +661,8 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { @Override public void widgetSelected(SelectionEvent e) { Combo combo = (Combo) e.widget; - String preferenceKey = (String) combo.getData(PREFERENCE_KEY); + ValidationMessage vm = (ValidationMessage) combo.getData(PREFERENCE_KEY); + String preferenceKey = vm.getID(); String value = convertToPreferenceValue(combo.getSelectionIndex()); JpaProblemSeveritiesPage.this.severityLevels.put(preferenceKey, value); } @@ -799,7 +800,8 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { protected void revertToDefault() { for (Combo combo : this.combos) { - String preferenceKey = (String) combo.getData(PREFERENCE_KEY); + ValidationMessage vm = (ValidationMessage) combo.getData(PREFERENCE_KEY); + String preferenceKey = vm.getID(); combo.select(convertPreferenceValueToComboIndex(getDefaultPreferenceValue(preferenceKey))); //UI will show the defaults from the workspace, but set all preferences //to null so they will be deleted from project preferences @@ -809,7 +811,8 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { protected void overrideWorkspacePreferences() { for (Combo combo : this.combos) { - String preferenceKey = (String) combo.getData(PREFERENCE_KEY); + ValidationMessage vm = (ValidationMessage) combo.getData(PREFERENCE_KEY); + String preferenceKey = vm.getID(); String workspacePreference = JpaPreferences.getProblemSeverity(preferenceKey); String defaultPreference = getDefaultPreferenceValue(preferenceKey); if (workspacePreference != null && !workspacePreference.equals(defaultPreference)) { |