Source:
<code>protected Control createContent(Composite parent, FormToolkit toolkit) { Composite composite = toolkit.createComposite(parent); composite.setLayout(new GridLayout(6, false)); IBuild build = getInput(IBuild.class); viewer = new TreeViewer(toolkit.createTree(composite, SWT.MULTI)); GridDataFactory.fillDefaults().hint(300, 100).span(6, 1).grab(true, true).applyTo(viewer.getControl()); viewer.setContentProvider(new ChildrenContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ChildrenLabelProvider(), null, null)); viewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { getPage().getSite().getSelectionProvider().setSelection(event.getSelection()); } }); viewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { <START> Object item = ((IStructuredSelection) event.getSelection()).getFirstElement(); <END> if (item instanceof IBuild) { IBuild build = (IBuild) item; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); BuildEditorInput buildInput = new BuildEditorInput(build); try { IDE.openEditor(page, buildInput, BuildsUiConstants.ID_EDITOR_BUILDS); } catch (PartInitException e) { } } } }); menuManager = new MenuManager(); WorkbenchUtil.addDefaultGroups(menuManager); getPage().getEditorSite().registerContextMenu(ID_POPUP_MENU, menuManager, viewer, true); Menu menu = menuManager.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); refresh(build); toolkit.paintBordersFor(composite); return composite; }</code><technical_language>do this a bit more simply relying org.eclipse.ui.ide (copied BuildView) Object element = ((IStructuredSelection) event.getSelection()).getFirstElement(); if (element instanceof IBuildElement) { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); OpenHandler.open(page, Collections.singletonList((IBuildElement) element)); }</technical_language>

Target:
protected Control createContent(Composite parent, FormToolkit toolkit) { Composite composite = toolkit.createComposite(parent); composite.setLayout(new GridLayout(6, false)); IBuild build = getInput(IBuild.class); viewer = new TreeViewer(toolkit.createTree(composite, SWT.MULTI)); GridDataFactory.fillDefaults().hint(300, 100).span(6, 1).grab(true, true).applyTo(viewer.getControl()); viewer.setContentProvider(new ChildrenContentProvider()); viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(new ChildrenLabelProvider(), null, null)); viewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { getPage().getSite().getSelectionProvider().setSelection(event.getSelection()); } }); viewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { Object item = ((IStructuredSelection) event.getSelection()).getFirstElement(); if (item instanceof IBuildElement) { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); OpenHandler.open(page, Collections.singletonList((IBuildElement) item)); } } }); refresh(build); toolkit.paintBordersFor(composite); return composite; }