public static IContextProvider getHelpContextProvider(IViewPart part, String contextId) { ISelection selection= part.getViewSite().getSelectionProvider().getSelection(); if (!(selection instanceof StructuredSelection)) return null; Object[] elements= ((StructuredSelection)selection).toArray(); if (elements.length == 0) return null; return new JavaViewerContextProvider(contextId, elements);
public static IContextProvider getHelpContextProvider(IWorkbenchPart part, String contextId) { IStructuredSelection selection; try { selection= SelectionConverter.getStructuredSelection(part); } catch (JavaModelException ex) { JavaPlugin.log(ex); selection= StructuredSelection.EMPTY; } Object[] elements= selection.toArray(); return new JavaUIHelpContextProvider(contextId, elements);
	public static IContextProvider getHelpContextProvider(IViewPart part, String contextId) {		ISelection selection= part.getViewSite().getSelectionProvider().getSelection();		if (!(selection instanceof StructuredSelection)) 			return null;		Object[] elements= ((StructuredSelection)selection).toArray();		if (elements.length == 0)			return null;		return new JavaViewerContextProvider(contextId, elements);	}