1 11 package org.eclipse.jdt.internal.ui.commands; 12 13 import org.eclipse.core.commands.AbstractHandler; 14 import org.eclipse.core.commands.ExecutionEvent; 15 import org.eclipse.core.commands.ExecutionException; 16 17 import org.eclipse.ui.IWorkbenchWindow; 18 19 import org.eclipse.jdt.core.IJavaElement; 20 21 import org.eclipse.jdt.internal.ui.JavaPlugin; 22 import org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil; 23 24 29 public class ShowElementInTypeHierarchyViewHandler extends AbstractHandler { 30 31 private static final String PARAM_ID_ELEMENT_REF= "elementRef"; 33 public Object execute(ExecutionEvent event) throws ExecutionException { 34 35 IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow(); 36 if (window == null) 37 return null; 38 39 IJavaElement javaElement= (IJavaElement) event.getObjectParameterForExecution(PARAM_ID_ELEMENT_REF); 40 41 OpenTypeHierarchyUtil.open(javaElement, window); 42 43 return null; 44 } 45 } 46 | Popular Tags |