|
Lines 39-45
Link Here
|
| 39 |
import org.eclipse.jdt.core.IJavaElement; |
39 |
import org.eclipse.jdt.core.IJavaElement; |
| 40 |
import org.eclipse.jdt.core.IMethod; |
40 |
import org.eclipse.jdt.core.IMethod; |
| 41 |
import org.eclipse.jdt.core.IType; |
41 |
import org.eclipse.jdt.core.IType; |
|
|
42 |
import org.eclipse.jdt.core.ITypeHierarchy; |
| 42 |
import org.eclipse.jdt.core.ITypeRoot; |
43 |
import org.eclipse.jdt.core.ITypeRoot; |
|
|
44 |
import org.eclipse.jdt.core.JavaModelException; |
| 43 |
import org.eclipse.jdt.core.dom.ASTNode; |
45 |
import org.eclipse.jdt.core.dom.ASTNode; |
| 44 |
import org.eclipse.jdt.core.dom.CompilationUnit; |
46 |
import org.eclipse.jdt.core.dom.CompilationUnit; |
| 45 |
import org.eclipse.jdt.core.dom.Expression; |
47 |
import org.eclipse.jdt.core.dom.Expression; |
|
Lines 184-191
Link Here
|
| 184 |
parentTypeBinding= Bindings.getBindingOfParentType(node); |
186 |
parentTypeBinding= Bindings.getBindingOfParentType(node); |
| 185 |
} |
187 |
} |
| 186 |
} |
188 |
} |
| 187 |
final IType type= parentTypeBinding != null ? (IType) parentTypeBinding.getJavaElement() : null; |
189 |
IType type= parentTypeBinding != null ? (IType)parentTypeBinding.getJavaElement() : null; |
| 188 |
if (type == null) { |
190 |
final IType superInterface; |
|
|
191 |
|
| 192 |
try { |
| 193 |
ITypeHierarchy superTypeHierarchy= type.newSupertypeHierarchy(null); |
| 194 |
IType[] rootInterfaces= superTypeHierarchy.getRootInterfaces(); |
| 195 |
if (rootInterfaces.length == 1) { |
| 196 |
superInterface= rootInterfaces[0]; |
| 197 |
} else { |
| 198 |
superInterface= null; |
| 199 |
} |
| 200 |
|
| 201 |
} catch (JavaModelException e) { |
| 202 |
JavaPlugin.log(e); |
| 203 |
return; |
| 204 |
} |
| 205 |
|
| 206 |
if (superInterface == null) { |
| 189 |
openQuickHierarchy(editor); |
207 |
openQuickHierarchy(editor); |
| 190 |
return; |
208 |
return; |
| 191 |
} |
209 |
} |
|
Lines 219-225
Link Here
|
| 219 |
Assert.isNotNull(pattern); |
237 |
Assert.isNotNull(pattern); |
| 220 |
SearchParticipant[] participants= new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }; |
238 |
SearchParticipant[] participants= new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }; |
| 221 |
SearchEngine engine= new SearchEngine(); |
239 |
SearchEngine engine= new SearchEngine(); |
| 222 |
engine.search(pattern, participants, SearchEngine.createHierarchyScope(type), requestor, new SubProgressMonitor(monitor, 100)); |
240 |
engine.search(pattern, participants, SearchEngine.createHierarchyScope(superInterface), requestor, new SubProgressMonitor(monitor, 100)); |
| 223 |
|
241 |
|
| 224 |
if (monitor.isCanceled()) { |
242 |
if (monitor.isCanceled()) { |
| 225 |
throw new OperationCanceledException(); |
243 |
throw new OperationCanceledException(); |