Search in sources :

Example 16 with Presentation

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

the class GenerateMainAction method update.

@Override
public void update(AnActionEvent e) {
    boolean enabled = isActionEnabled(e);
    Presentation presentation = e.getPresentation();
    presentation.setEnabled(enabled);
    presentation.setVisible(enabled);
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 17 with Presentation

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

the class ShrinkSelectionAction method update.

public void update(final AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
    if (editor == null) {
        presentation.setEnabled(false);
        return;
    }
    final Stack<ComponentPtr[]> history = editor.getSelectionState().getSelectionHistory();
    presentation.setEnabled(history.size() > 1);
}
Also used : GuiEditor(com.intellij.uiDesigner.designSurface.GuiEditor) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 18 with Presentation

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

the class EduUtils method enableAction.

public static void enableAction(@NotNull final AnActionEvent event, boolean isEnable) {
    final Presentation presentation = event.getPresentation();
    presentation.setVisible(isEnable);
    presentation.setEnabled(isEnable);
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 19 with Presentation

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

the class ExcludeFromStubGenerationAction method update.

@Override
public void update(AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    boolean enabled = isEnabled(e);
    presentation.setEnabled(enabled);
    presentation.setVisible(enabled);
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 20 with Presentation

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

the class AddToIgnoreListAction method update.

@Override
public void update(@NotNull AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    presentation.setEnabledAndVisible(true);
    presentation.setText(myActionName, false);
    presentation.setDescription(message(myUseCommonExtension ? "action.Subversion.Ignore.MatchExtension.description" : "action.Subversion.Ignore.ExactMatch.description", myActionName));
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

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