Search in sources :

Example 71 with Presentation

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

the class AndroidInlineStyleTest method doInlineStyleReferenceAction.

private void doInlineStyleReferenceAction(boolean inlineThisOnly, boolean enabled) {
    final Presentation p = myFixture.testAction(new AndroidInlineStyleReferenceAction(new AndroidInlineTestConfig(inlineThisOnly)));
    assertEquals(enabled, p.isEnabled());
    assertTrue(p.isVisible());
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 72 with Presentation

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

the class AndroidInlineStyleTest method doTestDisabled.

private void doTestDisabled() {
    final Presentation presentation = performAction(true, "res/layout").getFirst();
    assertFalse(presentation.isEnabled());
    assertTrue(presentation.isVisible());
}
Also used : Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 73 with Presentation

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

the class AndroidExtractAsIncludeTest method doTestDisabled.

private void doTestDisabled() {
    final String testName = getTestName(true);
    final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test.xml");
    myFixture.configureFromExistingVirtualFile(f);
    final Presentation p = myFixture.testAction(new AndroidExtractAsIncludeAction(new AndroidExtractAsIncludeAction.MyTestConfig("extracted.xml")));
    assertTrue(p.isVisible());
    assertFalse(p.isEnabled());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 74 with Presentation

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

the class AndroidExtractStyleTest method doTestDisabled.

private void doTestDisabled() {
    final String testName = getTestName(true);
    final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test" + testName + ".xml");
    myFixture.configureFromExistingVirtualFile(f);
    final Presentation presentation = myFixture.testAction(new AndroidExtractStyleAction());
    assertFalse(presentation.isEnabled());
    assertTrue(presentation.isVisible());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 75 with Presentation

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

the class AndroidExtractStyleTest method doTestHidden.

private void doTestHidden() {
    final String testName = getTestName(true);
    final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/values/test" + testName + ".xml");
    myFixture.configureFromExistingVirtualFile(f);
    final Presentation presentation = myFixture.testAction(new AndroidExtractStyleAction());
    assertFalse(presentation.isVisible());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) 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