minor
[fedora-idea.git] / platform / lang-impl / src / com / intellij / codeInsight / navigation / GotoImplementationHandler.java
blobefb313e9b35d32fed7b868a746dafa0d57592a61
1 package com.intellij.codeInsight.navigation;
3 import com.intellij.codeInsight.TargetElementUtilBase;
4 import com.intellij.openapi.editor.Editor;
5 import com.intellij.openapi.util.Pair;
6 import com.intellij.psi.PsiElement;
7 import com.intellij.psi.PsiFile;
9 public class GotoImplementationHandler extends GotoTargetHandler {
10 protected String getFeatureUsedKey() {
11 return "navigation.goto.implementation";
14 public Pair<PsiElement, PsiElement[]> getSourceAndTargetElements(Editor editor, PsiFile file) {
15 int offset = editor.getCaretModel().getOffset();
16 PsiElement source = TargetElementUtilBase.getInstance().findTargetElement(editor, ImplementationSearcher.getFlags(), offset);
17 PsiElement[] target = new ImplementationSearcher().searchImplementations(editor, source, offset);
18 if (target.length == 0) {
19 return new Pair<PsiElement, PsiElement[]>(source, new PsiElement[] { source });
21 return new Pair<PsiElement, PsiElement[]>(source, target);
24 protected String getChooserInFileTitleKey(PsiElement sourceElement) {
25 return "goto.implementation.in.file.chooser.title";
28 protected String getChooserTitleKey(PsiElement sourceElement) {
29 return "goto.implementation.chooser.title";