Search in sources :

Example 1 with NavigatableWithText

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);
}
Also used : NavigatableWithText(com.intellij.pom.NavigatableWithText) Navigatable(com.intellij.pom.Navigatable)

Aggregations

Navigatable (com.intellij.pom.Navigatable)1 NavigatableWithText (com.intellij.pom.NavigatableWithText)1