use of com.cubrid.common.ui.common.navigator.CubridDeferredTreeContentManager in project cubrid-manager by CUBRID.
the class CommonUITool method refreshNavigatorTree.
/**
*
* Reload the children of this node and restore the expanded status
*
* @param viewer the TableViewer object
* @param node the ICubridNode object
*/
public static void refreshNavigatorTree(AbstractTreeViewer viewer, ICubridNode node) {
if (node != null && node.getLoader() != null) {
node.getLoader().setLoaded(false);
}
if (node != null && !viewer.getExpandedState(node)) {
node.removeAllChild();
}
Object[] expandedElements = viewer.getExpandedElements();
IContentProvider contentProvider = viewer.getContentProvider();
if (contentProvider instanceof DeferredContentProvider) {
CubridDeferredTreeContentManager manager = ((DeferredContentProvider) contentProvider).getDeferredTreeContentManager();
if (manager != null) {
manager.setExpandedElements(expandedElements);
}
}
if (node == null) {
viewer.refresh(true);
} else {
viewer.refresh(node, true);
}
}
Aggregations