From 86ef3fc08c482417be98822b0493f1e87e11ed6d Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 13 May 2009 11:50:19 +0000 Subject: [PATCH] Improved name filter for quick outline view, bug 271115. --- .../internal/ui/text/AbstractInformationControl.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java index b4fdc6e7e9c..020eb8e6729 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/AbstractInformationControl.java @@ -54,6 +54,7 @@ import org.eclipse.ui.IEditorPart; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.IParent; +import org.eclipse.cdt.core.parser.Keywords; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.actions.CustomFiltersActionGroup; @@ -72,6 +73,7 @@ public abstract class AbstractInformationControl extends PopupDialog implements * match the given string patterns. */ protected class NamePatternFilter extends ViewerFilter { + private final String COLON_COLON = String.valueOf(Keywords.cpCOLONCOLON); public NamePatternFilter() { } @@ -87,8 +89,14 @@ public abstract class AbstractInformationControl extends PopupDialog implements TreeViewer treeViewer= (TreeViewer) viewer; String matchName= ((ILabelProvider) treeViewer.getLabelProvider()).getText(element); - if (matchName != null && matcher.match(matchName)) - return true; + if (matchName != null) { + if (matcher.match(matchName)) + return true; + // check for qualified name + int idx= matchName.lastIndexOf(COLON_COLON); + if (idx >= 0 && matcher.match(matchName.substring(idx+COLON_COLON.length()))) + return true; + } return hasUnfilteredChild(treeViewer, element); }