mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 12:55:40 +02:00
Improved name filter for quick outline view, bug 271115.
This commit is contained in:
parent
f309b2992e
commit
86ef3fc08c
1 changed files with 10 additions and 2 deletions
|
@ -54,6 +54,7 @@ import org.eclipse.ui.IEditorPart;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.IParent;
|
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.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.actions.CustomFiltersActionGroup;
|
import org.eclipse.cdt.ui.actions.CustomFiltersActionGroup;
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ public abstract class AbstractInformationControl extends PopupDialog implements
|
||||||
* match the given string patterns.
|
* match the given string patterns.
|
||||||
*/
|
*/
|
||||||
protected class NamePatternFilter extends ViewerFilter {
|
protected class NamePatternFilter extends ViewerFilter {
|
||||||
|
private final String COLON_COLON = String.valueOf(Keywords.cpCOLONCOLON);
|
||||||
|
|
||||||
public NamePatternFilter() {
|
public NamePatternFilter() {
|
||||||
}
|
}
|
||||||
|
@ -87,8 +89,14 @@ public abstract class AbstractInformationControl extends PopupDialog implements
|
||||||
TreeViewer treeViewer= (TreeViewer) viewer;
|
TreeViewer treeViewer= (TreeViewer) viewer;
|
||||||
|
|
||||||
String matchName= ((ILabelProvider) treeViewer.getLabelProvider()).getText(element);
|
String matchName= ((ILabelProvider) treeViewer.getLabelProvider()).getText(element);
|
||||||
if (matchName != null && matcher.match(matchName))
|
if (matchName != null) {
|
||||||
return true;
|
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);
|
return hasUnfilteredChild(treeViewer, element);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue