|Modifier and Type||Method and Description|
Returns the parent for the given element, or
Called when a previously-blank item becomes visible in the TreeViewer.
void updateElement(Object parent, int index)
TreeViewer.replace(Object, int, Object). The content provider should also update the child count for any replaced element by calling
TreeViewer.setChildCount(Object, int). If the given current child count is already correct, setChildCount does not have to be called since a call to replace will not change the child count. If the content provider doesn't know the child count at this point, and can more efficiently determine if the element has any children, then it can instead call
NOTE #updateElement(int index) can be used to determine selection values. If TableViewer#replace(Object, int) is not called before returning from this method, selections may have missing or stale elements. In this situation it is suggested that the selection is asked for again after replace() has been called.
parent- The parent of the element, or the viewer's input if the element to update is a root element
index- The index of the element to update in the tree
void updateChildCount(Object element, int currentChildCount)
StructuredViewer.setInput(Object). If the content provider knows the given element, it should respond by calling
TreeViewer.setChildCount(Object, int). If the given current child count is already correct, no action has to be taken by this content provider.
element- The element for which an up-to-date child count is needed, or the viewer's input if the number of root elements is requested
currentChildCount- The current child count for the element that needs updating
nullindicating that the parent can't be computed. In this case the tree-structured viewer can't expand a given node correctly if requested.
element- the element
nullif it has none or if the parent cannot be computed
Copyright (c) 2000, 2013 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.