private void buildFilteredTree(String filterKey, GumTreeNode fileNode) {
fileNode.removeAllChildren();
if ("".equals(filterKey)) {
IGroup fileGroup = (IGroup) fileNode.getUserObject();
// Get all groups directly belonging to the current node
for (IGroup childGroup : fileGroup.getGroupList()) {
addGroupNode(fileNode, childGroup);
}
// Get all data nodes (means NeXus dataset) sons of currently opened node
GumTreeNode itemNode;
for (IDataItem item : fileGroup.getDataItemList()) {
itemNode = new GumTreeNode(item);
fileNode.add(itemNode);
}
}
else {
IGroup fileGroup = (IGroup) fileNode.getUserObject();
IDictionary dictionary = fileGroup.findDictionary();
// TODO pas sûr, c'est pas encore implémenté
String path;
Object objectByPath;
for (String key : dictionary.getAllKeys()) {
if (key.contains(filterKey)) {
path = dictionary.getPath(key);
objectByPath = fileGroup.findObjectByPath(path);
if (objectByPath instanceof IDataItem) {
fileNode.add(new GumTreeNode(objectByPath));
}
}
}