void (@NotNull AnActionEvent e) { FileChooserPanel panel; FileSystemTree tree; if ((panel = e.getData(FileChooserPanel.DATA_KEY)) != null) { e.getPresentation().setEnabled(true); update(panel, e); } else if ((tree = e.getData(FileSystemTree.DATA_KEY)) != null) { e.getPresentation().setEnabled(true); update(tree, e); } else { e.getPresentation().setEnabledAndVisible(false); } }