summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Pontes 2011-10-25 20:46:30 (EDT)
committer Alena Laskavaia2011-10-25 20:46:30 (EDT)
commit2b1951b4cdeb9fbaca616fbc8145434655439016 (patch)
tree23ba33a5beeec6030843f139ac4a770cae58553c
parentce2c7320902a573f64449e7382021a63095d9bcb (diff)
downloadorg.eclipse.cdt-2b1951b4cdeb9fbaca616fbc8145434655439016.zip
org.eclipse.cdt-2b1951b4cdeb9fbaca616fbc8145434655439016.tar.gz
org.eclipse.cdt-2b1951b4cdeb9fbaca616fbc8145434655439016.tar.bz2
Bug 345614 - restore default button in codan preferences
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
index a695635..fb2396a 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
@@ -13,6 +13,7 @@ package org.eclipse.cdt.codan.internal.ui.preferences;
import java.text.MessageFormat;
+import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.core.model.CodanSeverity;
import org.eclipse.cdt.codan.core.model.IProblem;
@@ -332,16 +333,18 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
@Override
protected void doLoadDefault() {
if (getTreeControl() != null) {
+ CodanPreferencesLoader defaultPreferences = new CodanPreferencesLoader(CodanRuntime.getInstance().getCheckersRegistry().getDefaultProfile());
IProblem[] probs = codanPreferencesLoader.getProblems();
for (int i = 0; i < probs.length; i++) {
String id = probs[i].getId();
String s = getPreferenceStore().getDefaultString(id);
if (s == null || s.length() == 0) {
- s = codanPreferencesLoader.getProperty(id);
+ s = defaultPreferences.getProperty(id);
}
codanPreferencesLoader.setProperty(id, s);
}
getViewer().setInput(codanPreferencesLoader.getInput());
+ setPresentsDefaultValue(true);
}
}