Bug 330864 Add ability to find context for a UI element
bundles/org.eclipse.e4.core.contexts.debug/src/org/eclipse/e4/core/internal/contexts/debug/ui/ContextsView.java
public ContextsView(Composite parent, IEclipseContext context) {
		SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
		sashForm.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
		Composite treeComposite = new Composite(sashForm, SWT.NONE);
		treeComposite.setLayout(new GridLayout());
		GridLayout compositeTreeLayout = new GridLayout();
		compositeTreeLayout.marginHeight = 0;
		compositeTreeLayout.marginWidth = 0;
		treeComposite.setLayout(compositeTreeLayout);
		treeComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
		Label treeLabel = new Label(treeComposite, SWT.NONE);
		treeLabel.setText(ContextMessages.contextTreeLabel);
		FilteredTree contextTree = new FilteredTree(treeComposite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true);
		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
		contextTree.setLayoutData(gridData);
		treeViewer = contextTree.getViewer();
		treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
			public void selectionChanged(SelectionChangedEvent event) {
				StructuredSelection selection = (StructuredSelection) event.getSelection();
				@SuppressWarnings("unchecked")
				WeakReference<EclipseContext> selected = (WeakReference<EclipseContext>) selection.getFirstElement();
				selectedContext((selected == null) ? null : selected.get());
			}
		});
		treeProvider = new ContextTreeProvider(this, parent.getDisplay());
		treeViewer.setContentProvider(treeProvider);
		treeViewer.setLabelProvider(new LabelProvider() {
			public String getText(Object element) {
				@SuppressWarnings("unchecked")
				WeakReference<EclipseContext> ref = (WeakReference<EclipseContext>) element;