Search in sources :

Example 66 with Presentation

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

the class DockableEditorTabbedContainer method processDropOver.

@Override
public Image processDropOver(@NotNull DockableContent content, RelativePoint point) {
    JBTabs current = getTabsAt(content, point);
    if (myCurrentOver != null && myCurrentOver != current) {
        resetDropOver(content);
    }
    if (myCurrentOver == null && current != null) {
        myCurrentOver = current;
        Presentation presentation = content.getPresentation();
        myCurrentOverInfo = new TabInfo(new JLabel("")).setText(presentation.getText()).setIcon(presentation.getIcon());
        myCurrentOverImg = myCurrentOver.startDropOver(myCurrentOverInfo, point);
    }
    if (myCurrentOver != null) {
        myCurrentOver.processDropOver(myCurrentOverInfo, point);
    }
    return myCurrentOverImg;
}
Also used : JBTabs(com.intellij.ui.tabs.JBTabs) TabInfo(com.intellij.ui.tabs.TabInfo) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 67 with Presentation

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

the class GotoHomeAction method update.

protected void update(final FileSystemTree fileSystemTree, final AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    if (!presentation.isEnabled())
        return;
    final VirtualFile userHomeDir = VfsUtil.getUserHomeDir();
    presentation.setEnabled(userHomeDir != null && fileSystemTree.isUnderRoots(userHomeDir));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 68 with Presentation

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

the class GotoProjectDirectory method update.

protected void update(final FileSystemTree fileSystemTree, final AnActionEvent e) {
    final Presentation presentation = e.getPresentation();
    presentation.setIcon(ourIcon);
    final VirtualFile projectPath = getProjectDir(e);
    presentation.setEnabled(projectPath != null && fileSystemTree.isUnderRoots(projectPath));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 69 with Presentation

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

the class AndroidInlineLayoutTest method doTestCommonInlineAction.

private void doTestCommonInlineAction(boolean inlineThisOnly) {
    final String testName = getTestName(true);
    myFixture.copyFileToProject(BASE_PATH + testName + "_included.xml", "res/layout/included.xml");
    final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test.xml");
    myFixture.configureFromExistingVirtualFile(f);
    AndroidInlineLayoutHandler.setTestConfig(new AndroidInlineTestConfig(inlineThisOnly));
    try {
        final Presentation p = myFixture.testAction(new InlineAction());
        assertTrue(p.isEnabled());
        assertTrue(p.isVisible());
    } finally {
        AndroidInlineLayoutHandler.setTestConfig(null);
    }
    myFixture.checkResultByFile(BASE_PATH + testName + "_after.xml", true);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) InlineAction(com.intellij.refactoring.actions.InlineAction) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 70 with Presentation

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

the class AndroidInlineLayoutTest method test9.

public void test9() throws Exception {
    final String testName = getTestName(true);
    myFixture.copyFileToProject(BASE_PATH + testName + ".xml", "res/layout/test.xml");
    final VirtualFile f = myFixture.copyFileToProject(BASE_PATH + testName + "_included.xml", "res/layout/included.xml");
    myFixture.configureFromExistingVirtualFile(f);
    AndroidInlineLayoutHandler.setTestConfig(new AndroidInlineTestConfig(true));
    try {
        final Presentation p = myFixture.testAction(new InlineAction());
        assertTrue(p.isEnabled());
        assertTrue(p.isVisible());
    } finally {
        AndroidInlineLayoutHandler.setTestConfig(null);
    }
    myFixture.checkResultByFile("res/layout/test.xml", BASE_PATH + testName + "_after.xml", true);
    assertNull(myFixture.getTempDirFixture().getFile("res/layout/included.xml"));
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) InlineAction(com.intellij.refactoring.actions.InlineAction) 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