当前位置: 首页>>代码示例>>Java>>正文


Java StructuredViewer.setSelection方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.StructuredViewer.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java StructuredViewer.setSelection方法的具体用法?Java StructuredViewer.setSelection怎么用?Java StructuredViewer.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.StructuredViewer的用法示例。


在下文中一共展示了StructuredViewer.setSelection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectRootObject

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private void selectRootObject(Properties params) {

        IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
        if (view != null) {
            Object type = params.get("type");
            if (CamelRepositoryNodeType.repositoryBeansType.name().equals(type)) {
                IRepositoryNode processNode = ((ProjectRepositoryNode) view.getRoot())
                        .getRootRepositoryNode(ERepositoryObjectType.PROCESS);
                if (processNode != null) {
                    setWorkbenchPart(view);
                    final StructuredViewer viewer = view.getViewer();
                    if (viewer instanceof TreeViewer) {
                        ((TreeViewer) viewer).expandToLevel(processNode, 1);
                    }
                    viewer.setSelection(new StructuredSelection(processNode));
                }

            }
        }

    }
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:22,代码来源:CreateCamelBean.java

示例2: selectRootObject

import org.eclipse.jface.viewers.StructuredViewer; //导入方法依赖的package包/类
private void selectRootObject(Properties params) {

        IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (null == workbenchWindow) {
            return;
        }
        IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
        if (null == workbenchPage) {
            return;
        }

        IPerspectiveDescriptor currentPerspective = workbenchPage.getPerspective();
        if (!IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(currentPerspective.getId())) {
            // show Integration perspective
            try {
                workbenchWindow.getWorkbench().showPerspective(IBrandingConfiguration.PERSPECTIVE_DI_ID, workbenchWindow);
                workbenchPage = workbenchWindow.getActivePage();
            } catch (WorkbenchException e) {
                ExceptionHandler.process(e);
                return;
            }
        }

        IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
        if (view != null) {

            Object type = params.get("type");

            if (ESBRepositoryNodeType.SERVICES.name().equals(type)) {
                RepositoryNode servicesNode = ((ProjectRepositoryNode) view.getRoot())
                        .getRootRepositoryNode(ESBRepositoryNodeType.SERVICES);
                if (servicesNode != null) {
                    setWorkbenchPart(view);
                    final StructuredViewer viewer = view.getViewer();
                    if (viewer instanceof TreeViewer) {
                        ((TreeViewer) viewer).expandToLevel(servicesNode, 1);
                    }
                    viewer.setSelection(new StructuredSelection(servicesNode));
                }
            }
        }
    }
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:43,代码来源:CreateESBAction.java


注:本文中的org.eclipse.jface.viewers.StructuredViewer.setSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。