/** * Returns all section descriptors for the provided selection. * * @param part * the workbench part containing the selection * @param selection * the current selection. * @return all section descriptors. */ public ITabDescriptor[] getTabDescriptors(IWorkbenchPart part, ISelection selection) { if (selection == null || selection.isEmpty()) { return EMPTY_DESCRIPTOR_ARRAY; } ITabDescriptor[] allDescriptors = null; if (tabDescriptorProvider == null) { allDescriptors = getAllTabDescriptors(); } else { allDescriptors = tabDescriptorProvider.getTabDescriptors(part, selection); } ITabDescriptor[] result = filterTabDescriptors(allDescriptors, part, selection); return result; }