Search in sources :

Example 61 with Presentation

use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.

the class RunAction method update.

public void update(AnActionEvent event) {
    Presentation presentation = event.getPresentation();
    presentation.setEnabled(myAntBuildMessageView.isStopped());
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 62 with Presentation

use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.

the class BrowseCvsRepositoryAction method update.

@Override
public void update(AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    final boolean projectExists = e.getData(CommonDataKeys.PROJECT) != null;
    presentation.setVisible(projectExists);
    presentation.setEnabled(projectExists);
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 63 with Presentation

use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.

the class CvsGlobalAction method update.

public void update(AnActionEvent e) {
    final CvsContext cvsContext = CvsContextWrapper.createInstance(e);
    final Presentation presentation = e.getPresentation();
    if (cvsContext.cvsIsActive()) {
        presentation.setVisible(true);
        presentation.setEnabled(true);
    } else {
        presentation.setVisible(false);
        presentation.setEnabled(false);
    }
}
Also used : CvsContext(com.intellij.cvsSupport2.actions.cvsContext.CvsContext) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 64 with Presentation

use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.

the class AbstractAction method adjustName.

protected static void adjustName(boolean showDialogOptions, AnActionEvent e) {
    boolean actualShow = showDialogOptions || shiftPressed(e);
    Presentation presentation = e.getPresentation();
    String itemText = e.getPresentation().getTextWithMnemonic();
    if (itemText == null)
        return;
    if (itemText.endsWith("...")) {
        if (actualShow)
            return;
        presentation.setText(itemText.substring(0, itemText.length() - 3));
    } else {
        if (!actualShow)
            return;
        presentation.setText(itemText + "...");
    }
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 65 with Presentation

use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.

the class DiffWalkerAction method update.

public void update(AnActionEvent event) {
    FocusDiffSide side = DiffUtil.getFocusDiffSide(event.getDataContext());
    Presentation presentation = event.getPresentation();
    if (side == null) {
        presentation.setEnabled(false);
    } else {
        presentation.setEnabled(getLineNumberToGo(side) >= 0 || event.getInputEvent() instanceof KeyEvent);
    }
}
Also used : KeyEvent(java.awt.event.KeyEvent) Presentation(com.intellij.openapi.actionSystem.Presentation) FocusDiffSide(com.intellij.openapi.diff.impl.util.FocusDiffSide)

Aggregations

Presentation (com.intellij.openapi.actionSystem.Presentation)236 Project (com.intellij.openapi.project.Project)76 VirtualFile (com.intellij.openapi.vfs.VirtualFile)34 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)11 DataContext (com.intellij.openapi.actionSystem.DataContext)10 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)8 AnAction (com.intellij.openapi.actionSystem.AnAction)7 PsiFile (com.intellij.psi.PsiFile)6 IdeView (com.intellij.ide.IdeView)5 ActionManager (com.intellij.openapi.actionSystem.ActionManager)5 Editor (com.intellij.openapi.editor.Editor)5 File (java.io.File)5 Module (com.intellij.openapi.module.Module)4 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)4 PsiDirectory (com.intellij.psi.PsiDirectory)4 Course (com.jetbrains.edu.learning.courseFormat.Course)4 StudyEditor (com.jetbrains.edu.learning.editor.StudyEditor)4 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)3 NotNull (org.jetbrains.annotations.NotNull)3 Before (org.junit.Before)3