question: public void expandToObjectAndSelect ( Object elementOrTreePath , int level ) { if ( checkBusy ( ) ) { return ; } Object parent = getParentElement ( elementOrTreePath ) ; if ( ( ( parent != null ) && getExpandedState ( parent ) ) || isRootElement ( elementOrTreePath ) ) { Widget w = internalGetWidgetToSelect ( elementOrTreePath ) ; if ( null != w ) { List < Object > selectionList = new ArrayList < > ( ) ; selectionList . add ( w ) ; setSelection ( selectionList ) ; objectToSelect . set ( null ) ; } else { objectToSelect . set ( elementOrTreePath ) ; } } else { objectToSelect . set ( elementOrTreePath ) ; List < Object > objectsToExpand = createObjectList ( parent , new ArrayList < > ( ) ) ; if ( ! objectsToExpand . isEmpty ( ) ) { objectsToBeExpanded . addAll ( objectsToExpand ) ; Widget w = internalExpand ( elementOrTreePath , true ) ; if ( w != null ) { internalExpandToLevel ( w , level ) ; } } else { Widget w = internalGetWidgetToSelect ( elementOrTreePath ) ; if ( null != w ) { List < Object > selectionList = new ArrayList < > ( ) ; selectionList . add ( w ) ; setSelection ( selectionList ) ; objectToSelect . set ( null ) ; } } } }
target:  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. The element will be then selected.