Do not show "Jump to source" action, if we can't to do so

restore old behavior
This commit is contained in:
Aleksey Pivovarov
2014-10-21 15:58:49 +04:00
parent accd26bd75
commit c33da06d1e
@@ -52,7 +52,7 @@ public abstract class BaseNavigateToSourceAction extends AnAction implements Dum
event.getPresentation().setEnabled(enabled); event.getPresentation().setEnabled(enabled);
} }
//as myFocusEditor is always ignored - Main Menu|View always contains 2 actions with the same name and actually same behaviour //as myFocusEditor is always ignored - Main Menu|View always contains 2 actions with the same name and actually same behaviour
event.getPresentation().setVisible(target == null || myFocusEditor); if(!myFocusEditor) event.getPresentation().setVisible(false);
String navigateActionText = myFocusEditor && target instanceof NavigatableWithText? String navigateActionText = myFocusEditor && target instanceof NavigatableWithText?
((NavigatableWithText)target).getNavigateActionText(true) : null; ((NavigatableWithText)target).getNavigateActionText(true) : null;
event.getPresentation().setText(navigateActionText == null ? getTemplatePresentation().getText() : navigateActionText); event.getPresentation().setText(navigateActionText == null ? getTemplatePresentation().getText() : navigateActionText);