treeViewer.setContentProvider(contentProvider);
new DiagnosticsToolTipper(new TableItemContainer(table),
new DiagnosticsToolTipper.ItemMapper() {
public Proxy dataFromItem(Item item) {
Proxy proxy = null;
if (item instanceof TableItem) {
Object tableTreeItem = item.getData("TableTreeItemID");
if (tableTreeItem instanceof Item) {
Object proxyObject = ((Item) tableTreeItem).getData();
if (proxyObject instanceof Proxy && ((Proxy) proxyObject).getModelObject() instanceof PropertyValue) {
proxy = (Proxy) proxyObject;
}
}
}
return proxy;
}
});
table.setLayout(tableLayout);
property.addControlListener(columnResizeListener);
tree.addTreeListener(treeExpansionListener);
tableLayout.layout(table, true);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
Proxy proxy = (Proxy) selection.getFirstElement();
if (proxy != null && proxy.getModelObject() instanceof PropertyValue) {
editorContext.getThemeEditor().setFocus(proxy.getPathFromRoot());
// Another slightly nasty hack - we can't set the focus to
// the appropriate point in the other tab without losing
// focus in this view, so we pull it back after setting the
// focus on the relevant control
getControl().setFocus();