use of com.intellij.pom.NavigatableWithText in project intellij-community by JetBrains.
the class BaseNavigateToSourceAction method update.
public void update(AnActionEvent e) {
boolean inPopup = ActionPlaces.isPopupPlace(e.getPlace());
Navigatable target = findTargetForUpdate(e.getDataContext());
boolean enabled = target != null;
if (inPopup && !(this instanceof OpenModuleSettingsAction) && OpenModuleSettingsAction.isModuleInProjectViewPopup(e)) {
e.getPresentation().setVisible(false);
return;
}
//as myFocusEditor is always ignored - Main Menu|View always contains 2 actions with the same name and actually same behaviour
e.getPresentation().setVisible((enabled || !inPopup) && (myFocusEditor || !(target instanceof NavigatableWithText)));
e.getPresentation().setEnabled(enabled);
String navigateActionText = myFocusEditor && target instanceof NavigatableWithText ? ((NavigatableWithText) target).getNavigateActionText(true) : null;
e.getPresentation().setText(navigateActionText == null ? getTemplatePresentation().getText() : navigateActionText);
}
Aggregations