use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class RemoveFromIgnoreListAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
presentation.setEnabledAndVisible(true);
presentation.setText(myActionName);
presentation.setDescription(SvnBundle.message("action.Subversion.UndoIgnore.description"));
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class IpnbRunCellBaseAction method update.
@Override
public void update(AnActionEvent e) {
final DataContext context = e.getDataContext();
final IpnbFileEditor editor = IpnbFileEditor.DATA_KEY.getData(context);
final Presentation presentation = e.getPresentation();
presentation.setEnabledAndVisible(editor != null);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class MvcActionGroup method update.
@Override
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
Pair<MvcFramework, Module> pair = MvcActionBase.guessFramework(e);
if (pair != null && pair.first.showActionGroup()) {
presentation.setVisible(true);
presentation.setText(pair.getFirst().getDisplayName());
presentation.setIcon(pair.getFirst().getIcon());
} else {
presentation.setVisible(false);
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class AbstractCreateFormAction method update.
public void update(final AnActionEvent e) {
super.update(e);
final Project project = e.getData(CommonDataKeys.PROJECT);
final Presentation presentation = e.getPresentation();
if (presentation.isEnabled()) {
final IdeView view = e.getData(LangDataKeys.IDE_VIEW);
if (view != null) {
final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
final PsiDirectory[] dirs = view.getDirectories();
for (final PsiDirectory dir : dirs) {
if (projectFileIndex.isUnderSourceRootOfType(dir.getVirtualFile(), JavaModuleSourceRootTypes.SOURCES) && JavaDirectoryService.getInstance().getPackage(dir) != null) {
return;
}
}
}
presentation.setEnabled(false);
presentation.setVisible(false);
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class CCDeleteAllAnswerPlaceholdersAction method update.
@Override
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
presentation.setEnabledAndVisible(false);
Project project = e.getProject();
if (project == null) {
return;
}
if (!CCUtils.isCourseCreator(project)) {
return;
}
DataContext context = e.getDataContext();
VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(context);
if (file == null) {
return;
}
TaskFile taskFile = StudyUtils.getTaskFile(project, file);
if (taskFile == null || taskFile.getAnswerPlaceholders().isEmpty()) {
return;
}
presentation.setEnabledAndVisible(true);
}
Aggregations