當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。