diff options
author | Alena Laskavaia | 2011-02-27 03:13:31 +0000 |
---|---|---|
committer | Alena Laskavaia | 2011-02-27 03:13:31 +0000 |
commit | cbb43fd93b3825ee3cd1c1010b04e60ea623b262 (patch) | |
tree | 708c41f3f2da27119be19dde8045accb1563da23 /codan/org.eclipse.cdt.codan.ui | |
parent | e01c3cc7c3442e576e343eeae9fe32556465af32 (diff) | |
download | org.eclipse.cdt-cbb43fd93b3825ee3cd1c1010b04e60ea623b262.tar.gz org.eclipse.cdt-cbb43fd93b3825ee3cd1c1010b04e60ea623b262.tar.xz org.eclipse.cdt-cbb43fd93b3825ee3cd1c1010b04e60ea623b262.zip |
added ui code to grey out checkboxes which are conditionally enabled based on launch mode
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui')
-rw-r--r-- | codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java | 20 |
1 files changed, 19 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 cdf6d8de2ad..91323264784 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,12 +13,16 @@ package org.eclipse.cdt.codan.internal.ui.preferences; import java.text.MessageFormat; import org.eclipse.cdt.codan.core.PreferenceConstants; +import org.eclipse.cdt.codan.core.model.CheckerLaunchMode; import org.eclipse.cdt.codan.core.model.CodanSeverity; import org.eclipse.cdt.codan.core.model.IProblem; import org.eclipse.cdt.codan.core.model.IProblemCategory; import org.eclipse.cdt.codan.core.model.IProblemElement; import org.eclipse.cdt.codan.core.model.IProblemProfile; import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy; +import org.eclipse.cdt.codan.core.param.IProblemPreference; +import org.eclipse.cdt.codan.core.param.LaunchTypeProblemPreference; +import org.eclipse.cdt.codan.core.param.MapProblemPreference; import org.eclipse.cdt.codan.internal.core.CodanPreferencesLoader; import org.eclipse.cdt.codan.internal.ui.CodanUIMessages; import org.eclipse.core.resources.IMarker; @@ -85,6 +89,20 @@ public class ProblemsTreeEditor extends CheckedTreeEditor { */ public boolean isGrayed(Object element) { if (element instanceof IProblem) { + IProblem p = (IProblem) element; + IProblemPreference preference = p.getPreference(); + if (preference instanceof MapProblemPreference) { + LaunchTypeProblemPreference pref = (LaunchTypeProblemPreference) ((MapProblemPreference) preference) + .getChildDescriptor(LaunchTypeProblemPreference.KEY); + if (pref == null || pref.isRunningInMode(CheckerLaunchMode.USE_PARENT)) { + return false; + } + boolean enabled = p.isEnabled(); + boolean match = pref.isAllEnabled(); + if (enabled && match) return false; + if (!enabled && pref.isAllDisabled()) return false; + return true; + } return false; } if (element instanceof IProblemCategory) { @@ -368,7 +386,7 @@ public class ProblemsTreeEditor extends CheckedTreeEditor { protected String modelToString(Object model) { return ""; //$NON-NLS-1$ } - + /** * @return */ |