1 11 12 package org.eclipse.jdt.internal.ui.callhierarchy; 13 14 import org.eclipse.core.runtime.Assert; 15 16 import org.eclipse.jface.resource.ImageDescriptor; 17 18 import org.eclipse.ui.model.IWorkbenchAdapter; 19 20 import org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper; 21 22 public class MethodWrapperWorkbenchAdapter implements IWorkbenchAdapter { 23 24 private final MethodWrapper fMethodWrapper; 25 26 public MethodWrapperWorkbenchAdapter(MethodWrapper methodWrapper) { 27 Assert.isNotNull(methodWrapper); 28 fMethodWrapper= methodWrapper; 29 } 30 31 public MethodWrapper getMethodWrapper() { 32 return fMethodWrapper; 33 } 34 35 public Object [] getChildren(Object o) { return new Object [0]; 37 } 38 39 42 public ImageDescriptor getImageDescriptor(Object object) { 43 return null; 44 } 45 46 49 public String getLabel(Object o) { 50 return fMethodWrapper.getMember().getElementName(); 51 } 52 53 56 public Object getParent(Object o) { 57 return fMethodWrapper.getParent(); 58 } 59 60 64 public boolean equals(Object obj) { 65 return fMethodWrapper.equals(obj); 67 } 68 69 73 public int hashCode() { 74 return fMethodWrapper.hashCode(); 76 } 77 78 } 79 | Popular Tags |