Search in sources :

Example 1 with DeferredContentProvider

use of com.cubrid.common.ui.common.navigator.DeferredContentProvider 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);
    }
}
Also used : IContentProvider(org.eclipse.jface.viewers.IContentProvider) DeferredContentProvider(com.cubrid.common.ui.common.navigator.DeferredContentProvider) CubridDeferredTreeContentManager(com.cubrid.common.ui.common.navigator.CubridDeferredTreeContentManager)

Example 2 with DeferredContentProvider

use of com.cubrid.common.ui.common.navigator.DeferredContentProvider in project cubrid-manager by CUBRID.

the class CubridHostNavigatorView method createNavigator.

/**
	 * Create the navigator
	 */
protected void createNavigator() {
    tv.setSorter(new CMNavigatorViewSorter());
    tv.setContentProvider(new DeferredContentProvider());
    tv.setLabelProvider(new DecoratingLabelProvider(new NavigatorTreeLabelProvider()));
    tv.addDoubleClickListener(LayoutManager.getInstance());
    tv.addTreeListener(new ITreeViewerListener() {

        public void treeCollapsed(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }

        public void treeExpanded(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }
    });
    CubridActionBuilder.init();
    hookRetragetActions();
    addHostListener();
}
Also used : DeferredContentProvider(com.cubrid.common.ui.common.navigator.DeferredContentProvider) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) DecoratingLabelProvider(com.cubrid.common.ui.common.navigator.DecoratingLabelProvider) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Example 3 with DeferredContentProvider

use of com.cubrid.common.ui.common.navigator.DeferredContentProvider in project cubrid-manager by CUBRID.

the class CubridMonitorNavigatorView method createNavigator.

/**
	 * Create the navigator
	 *
	 */
protected void createNavigator() {
    tv.setContentProvider(new DeferredContentProvider());
    tv.setLabelProvider(new NavigatorTreeLabelProvider());
    tv.addDoubleClickListener(LayoutManager.getInstance());
    tv.addTreeListener(new ITreeViewerListener() {

        public void treeCollapsed(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }

        public void treeExpanded(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }
    });
    tv.setInput(getTreeViewerInput());
}
Also used : DeferredContentProvider(com.cubrid.common.ui.common.navigator.DeferredContentProvider) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Example 4 with DeferredContentProvider

use of com.cubrid.common.ui.common.navigator.DeferredContentProvider in project cubrid-manager by CUBRID.

the class CubridQueryNavigatorView method createNavigator.

/**
	 * Create the navigator
	 */
protected void createNavigator() {
    tv.setSorter(new CQBNavigatorViewSorter());
    tv.setContentProvider(new DeferredContentProvider());
    tv.setLabelProvider(new DecoratingLabelProvider(new NavigatorTreeLabelProvider()));
    tv.addDoubleClickListener(LayoutManager.getInstance());
    tv.addTreeListener(new ITreeViewerListener() {

        public void treeCollapsed(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }

        public void treeExpanded(TreeExpansionEvent event) {
            CommonUITool.clearExpandedElements(tv);
        }
    });
    CubridActionBuilder.init();
    hookRetragetActions();
    addConnectionListener();
}
Also used : DeferredContentProvider(com.cubrid.common.ui.common.navigator.DeferredContentProvider) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) DecoratingLabelProvider(com.cubrid.common.ui.common.navigator.DecoratingLabelProvider) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Aggregations

DeferredContentProvider (com.cubrid.common.ui.common.navigator.DeferredContentProvider)4 ITreeViewerListener (org.eclipse.jface.viewers.ITreeViewerListener)3 TreeExpansionEvent (org.eclipse.jface.viewers.TreeExpansionEvent)3 DecoratingLabelProvider (com.cubrid.common.ui.common.navigator.DecoratingLabelProvider)2 CubridDeferredTreeContentManager (com.cubrid.common.ui.common.navigator.CubridDeferredTreeContentManager)1 IContentProvider (org.eclipse.jface.viewers.IContentProvider)1