/** * Expands all nodes of the viewer's tree, starting with the root. This method * is equivalent to <code>expandToLevel(ALL_LEVELS)</code>. * * @param disableRedraw * <code>true</code> when drawing operations should be disabled * during expansion. * @since 3.14 */ public void expandAll(boolean disableRedraw) { expandToLevel(ALL_LEVELS, disableRedraw); }
/** * Expands the root of the viewer's tree to the given level. * * @param level * non-negative level, or <code>ALL_LEVELS</code> to expand all * levels of the tree */ public void expandToLevel(int level) { expandToLevel(level, false); }
/** * Expands all nodes of the viewer's tree, starting with the root. This * method is equivalent to <code>expandToLevel(ALL_LEVELS)</code>. */ public void expandAll() { expandToLevel(ALL_LEVELS, false); }
/** * Expands all nodes of the viewer's tree, starting with the root. This * method is equivalent to <code>expandToLevel(ALL_LEVELS)</code>. */ public void expandAll() { expandToLevel(ALL_LEVELS); }
/** * Expands all nodes of the viewer's tree, starting with the root. This * method is equivalent to <code>expandToLevel(ALL_LEVELS)</code>. */ public void expandAll() { expandToLevel(ALL_LEVELS); }
/** * This is called when the cursor has hovered over the given target for longer than {@link #hoverThreshold}. */ protected void hover(Object target) { if (viewer instanceof AbstractTreeViewer) { ((AbstractTreeViewer)viewer).expandToLevel(target, 1); } }
/** * Expands all ancestors of the given element or tree path so that the given * element becomes visible in this viewer's tree control, and then expands * the subtree rooted at the given element to the given level. * * @param elementOrTreePath * the element * @param level * non-negative level, or <code>ALL_LEVELS</code> to expand all * levels of the tree */ public void expandToLevel(Object elementOrTreePath, int level) { expandToLevel(elementOrTreePath, level, false); }
/** * Expands the root of the viewer's tree to the given level. * * @param level * non-negative level, or <code>ALL_LEVELS</code> to expand all * levels of the tree */ public void expandToLevel(int level) { expandToLevel(getRoot(), level); }
/** * Expands the root of the viewer's tree to the given level. * * @param level * non-negative level, or <code>ALL_LEVELS</code> to expand all * levels of the tree */ public void expandToLevel(int level) { expandToLevel(getRoot(), level); }
/** * Expands the root of the viewer's tree to the given level. * * @param level * non-negative level, or <code>ALL_LEVELS</code> to expand all * levels of the tree * @param disableRedraw * <code>true</code> when drawing operations should be disabled * during expansion. * @since 3.14 */ public void expandToLevel(int level, boolean disableRedraw) { BusyIndicator.showWhile(getControl().getDisplay(), () -> { expandToLevel(getRoot(), level, disableRedraw); }); }
protected void expandAllFromSelection() { AbstractTreeViewer tree = viewer; if (tree == null) return; IStructuredSelection selection = tree.getStructuredSelection(); if(! selection.isEmpty()) { Iterator elements = selection.iterator(); try { tree.getControl().setRedraw(false); while (elements.hasNext()) { Object next = elements.next(); tree.expandToLevel(next, AbstractTreeViewer.ALL_LEVELS); } } finally { tree.getControl().setRedraw(true); } } }
protected void expandAllFromSelection() { AbstractTreeViewer tree = viewer; if (tree == null) return; ISelection selection = tree.getSelection(); if(! selection.isEmpty()) { Iterator elements = ((IStructuredSelection)selection).iterator(); try { tree.getControl().setRedraw(false); while (elements.hasNext()) { Object next = elements.next(); tree.expandToLevel(next, AbstractTreeViewer.ALL_LEVELS); } } finally { tree.getControl().setRedraw(true); } } } /* (non-Javadoc)
@Override public void run() { if (fTreeViewer == null) { return; } else if ((fTreeObject != null) && (fExpandToLevel > 0)) { // Redraw modification needed to avoid flicker // Collapsing to a specific level does not work fTreeViewer.getControl().setRedraw(false); fTreeViewer.collapseAll(); fTreeViewer.expandToLevel(fTreeObject, 1); fTreeViewer.getControl().setRedraw(true); } else { fTreeViewer.collapseAll(); } }