use of org.eclipse.linuxtools.internal.systemtap.ui.ide.structures.nodedata.ICompletable in project linuxtools by eclipse.
the class STPMetadataSingleton method getMatchingChildren.
private TreeNode[] getMatchingChildren(TreeNode node, String prefix) {
ArrayList<TreeNode> matches = new ArrayList<>();
for (int i = 0, n = node.getChildCount(); i < n; i++) {
TreeNode childNode = node.getChildAt(i);
String childName;
if (childNode.getData() instanceof ICompletable) {
childName = ((ICompletable) childNode.getData()).getCompletionText();
} else {
childName = childNode.toString();
}
if (childName.startsWith(prefix)) {
matches.add(childNode);
}
}
return matches.toArray(new TreeNode[0]);
}
Aggregations