/** * Returns the widget to be selected for the given element or tree path. * * @param elementOrTreePath * the element or tree path to select * @return the widget to be selected, or <code>null</code> if not found * * @since 3.1 */ protected Widget internalGetWidgetToSelect(Object elementOrTreePath) { if (elementOrTreePath instanceof TreePath) { TreePath treePath = (TreePath) elementOrTreePath; if (treePath.getSegmentCount() == 0) { return getControl(); } Widget[] candidates = findItems(treePath.getLastSegment()); for (Widget candidate : candidates) { if (!(candidate instanceof Item)) { continue; } if (treePath.equals(getTreePathFromItem((Item) candidate), getComparer())) { return candidate; } } return null; } return findItem(elementOrTreePath); }
if (path == null) { Widget w = findItem(element); if (w instanceof Item) { Item item = (Item) w;
/** * Returns the widget to be selected for the given element or tree path. * * @param elementOrTreePath * the element or tree path to select * @return the widget to be selected, or <code>null</code> if not found * * @since 1.0 */ protected Widget internalGetWidgetToSelect(Object elementOrTreePath) { if (elementOrTreePath instanceof TreePath) { TreePath treePath = (TreePath) elementOrTreePath; if (treePath.getSegmentCount() == 0) { return getControl(); } Widget[] candidates = findItems(treePath.getLastSegment()); for (int i = 0; i < candidates.length; i++) { Widget candidate = candidates[i]; if (!(candidate instanceof Item)) { continue; } if (treePath.equals(getTreePathFromItem((Item) candidate), getComparer())) { return candidate; } } return null; } return findItem(elementOrTreePath); }
if (path == null) { Widget w = findItem(element); if (w instanceof Item) { Item item = (Item) w;
/** * Returns the widget to be selected for the given element or tree path. * * @param elementOrTreePath * the element or tree path to select * @return the widget to be selected, or <code>null</code> if not found * * @since 3.1 */ protected Widget internalGetWidgetToSelect(Object elementOrTreePath) { if (elementOrTreePath instanceof TreePath) { TreePath treePath = (TreePath) elementOrTreePath; if (treePath.getSegmentCount() == 0) { return getControl(); } Widget[] candidates = findItems(treePath.getLastSegment()); for (int i = 0; i < candidates.length; i++) { Widget candidate = candidates[i]; if (!(candidate instanceof Item)) { continue; } if (treePath.equals(getTreePathFromItem((Item) candidate), getComparer())) { return candidate; } } return null; } return findItem(elementOrTreePath); }
if (path == null) { Widget w = findItem(element); if (w instanceof Item) { Item item = (Item) w;
if (path == null) { Widget w = findItem(parent); if (w instanceof Item) { Item item = (Item) w;
if (path == null) { Widget w = findItem(parent); if (w instanceof Item) { Item item = (Item) w;
if (path == null) { Widget w = findItem(parent); if (w instanceof Item) { Item item = (Item) w;