propertySheet.partClosed(part);
propertySheet.partActivated(part);
// lets check if we have created and initialised a different page instance in the activation...
IPage currentPage = propertySheet.getCurrentPage();
IPropertySheetPage selectionPage = page;
if (currentPage instanceof IPropertySheetPage) {
selectionPage = (IPropertySheetPage) currentPage;
// now lets dispose the old page we are not using
page.dispose();
}
if (selectionPage instanceof TabFolderSupport2) {
TabFolderSupport2 tfs = (TabFolderSupport2) selectionPage;
tfs.init(propertySheet);
} else {
boolean initSelectionPage = false;
if (selectionPage instanceof Page) {
Page p = (Page) selectionPage;
Activator.getLogger().debug("Current page: "+ p + " has Site: " + p.getSite());
if (initSelectionPage) {
IViewSite viewSite = propertySheet.getViewSite();
p.init(new PageSite(viewSite));
}
}
}
if (selection != null) {
selectionPage.selectionChanged(part, selection);
}
}
}