Search in sources :

Example 6 with FileSystemTree

use of com.intellij.openapi.fileChooser.FileSystemTree in project intellij-community by JetBrains.

the class FileChooserAction method update.

public final void update(AnActionEvent e) {
    FileSystemTree tree = e.getData(FileSystemTree.DATA_KEY);
    if (tree != null) {
        e.getPresentation().setEnabled(true);
        update(tree, e);
    } else {
        e.getPresentation().setEnabled(false);
    }
}
Also used : FileSystemTree(com.intellij.openapi.fileChooser.FileSystemTree)

Example 7 with FileSystemTree

use of com.intellij.openapi.fileChooser.FileSystemTree in project intellij-community by JetBrains.

the class FileDeleteAction method update.

@Override
public void update(AnActionEvent event) {
    Presentation presentation = event.getPresentation();
    FileSystemTree tree = event.getData(FileSystemTree.DATA_KEY);
    if (tree == null) {
        presentation.setEnabledAndVisible(false);
        return;
    }
    final Boolean available = event.getData(FileChooserKeys.DELETE_ACTION_AVAILABLE);
    if (available != null && !available) {
        presentation.setEnabledAndVisible(false);
        return;
    }
    presentation.setEnabledAndVisible(true);
    super.update(event);
}
Also used : FileSystemTree(com.intellij.openapi.fileChooser.FileSystemTree) Presentation(com.intellij.openapi.actionSystem.Presentation)

Aggregations

FileSystemTree (com.intellij.openapi.fileChooser.FileSystemTree)7 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 Presentation (com.intellij.openapi.actionSystem.Presentation)1 FileChooserAction (com.intellij.openapi.fileChooser.actions.FileChooserAction)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 Pair (com.intellij.openapi.util.Pair)1 PsiElement (com.intellij.psi.PsiElement)1 PsiFile (com.intellij.psi.PsiFile)1 Usage (com.intellij.usages.Usage)1 UsageTarget (com.intellij.usages.UsageTarget)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1