mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +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.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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue