// initial clear of the columns field filled when creating the action
this.columns = null;
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
if (part instanceof PropertySheet) {
PropertySheet ps = (PropertySheet)part;
if (ps.getCurrentPage() instanceof PropertySourceTableSheetPage) {
PropertySourceTableSheetPage sp = (PropertySourceTableSheetPage)ps.getCurrentPage();
this.columns = (IConfigurableColumns)sp.getTableView();
} else {
ISection[] secs = null;
if (ps.getCurrentPage() instanceof TabFolderSupport2) {
TabFolderSupport2 tfs = (TabFolderSupport2)ps.getCurrentPage();
secs = ((TabContents)tfs.getCurrentTab()).getSections();
} else if (ps.getCurrentPage() instanceof TabbedPropertySheetPage) {
TabbedPropertySheetPage tabbedPage = (TabbedPropertySheetPage) ps.getCurrentPage();
secs = tabbedPage.getCurrentTab() == null ? null : tabbedPage.getCurrentTab().getSections();
}
if (secs != null) {
for (ISection sec : secs) {
if (sec instanceof IConfigurableColumns) {
this.columns = (IConfigurableColumns) sec;
break;
} else {
Activator.getLogger().warning("Unsupported type: " + sec.getClass().getName());
}
}
} else {
Activator.getLogger().warning("Unsupported type: " + ps.getCurrentPage().getClass().getName());
}
}
} else if (part instanceof TableViewSupport) {
this.columns = (IConfigurableColumns) ((TableViewSupport)part);
} else {