private TreeItem findElement(TreeItem[] items) { return findElement(items, null, true); }
private TreeItem findElement(TreeItem[] items) { return findElement(items, null, true); }
/** * Selects the first element in the tree which * matches the current filter pattern. */ protected void selectFirstMatch() { Object selectedElement= fTreeViewer.testFindItem(fInitiallySelectedType); TreeItem element; final Tree tree= fTreeViewer.getTree(); if (selectedElement instanceof TreeItem) element= findElement(new TreeItem[] { (TreeItem)selectedElement }); else element= findElement(tree.getItems()); if (element != null) { tree.setSelection(element); tree.showItem(element); } else fTreeViewer.setSelection(StructuredSelection.EMPTY); }
/** * Selects the first element in the tree which * matches the current filter pattern. */ protected void selectFirstMatch() { Object selectedElement= fTreeViewer.testFindItem(fInitiallySelectedType); TreeItem element; final Tree tree= fTreeViewer.getTree(); if (selectedElement instanceof TreeItem) element= findElement(new TreeItem[] { (TreeItem)selectedElement }); else element= findElement(tree.getItems()); if (element != null) { tree.setSelection(element); tree.showItem(element); } else fTreeViewer.setSelection(StructuredSelection.EMPTY); }
/** * Selects the first element in the tree which * matches the current filter pattern. */ protected void selectFirstMatch() { Tree tree= fTreeViewer.getTree(); Object element= findElement(tree.getItems()); if (element != null) fTreeViewer.setSelection(new StructuredSelection(element), true); else fTreeViewer.setSelection(StructuredSelection.EMPTY); }
TreeItem foundItem= findElement(selectItems(item.getItems(), toBeSkipped), null, false); if (foundItem != null) return foundItem; return findElement(new TreeItem[] { parentItem }, items, true); return findElement(selectItems(items[0].getParent().getItems(), items), null, false);
TreeItem foundItem= findElement(selectItems(item.getItems(), toBeSkipped), null, false); if (foundItem != null) return foundItem; return findElement(new TreeItem[] { parentItem }, items, true); return findElement(selectItems(items[0].getParent().getItems(), items), null, false);
private IJavaElement findElement(TreeItem[] items) { ILabelProvider labelProvider= (ILabelProvider)fTreeViewer.getLabelProvider(); for (int i= 0; i < items.length; i++) { IJavaElement element= (IJavaElement)items[i].getData(); if (fStringMatcher == null) return element; if (element != null) { String label= labelProvider.getText(element); if (fStringMatcher.match(label)) return element; } element= findElement(items[i].getItems()); if (element != null) return element; } return null; }