It is very difficult to get this material from Breadcrumb, you will need to use reflection to get it.
Here is the code to get the current method from the editor.
ITextEditor editor = (ITextEditor) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage().getActiveEditor(); ITextSelection selection = (ITextSelection) editor .getSelectionProvider().getSelection(); IEditorInput editorInput = editor.getEditorInput(); IJavaElement elem = JavaUI.getEditorInputJavaElement(editorInput); if (elem instanceof ICompilationUnit) { ICompilationUnit unit = (ICompilationUnit) elem; IJavaElement selected = unit.getElementAt(selection.getOffset()); System.out.println("selected=" + selected); System.out.println("selected.class=" + selected.getClass()); }
source share