本文整理匯總了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));
}
}
}
}
示例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));
}
}
}
}