use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class NextSplitAction method update.
public void update(final AnActionEvent event) {
final Project project = event.getProject();
final Presentation presentation = event.getPresentation();
if (project == null) {
presentation.setEnabled(false);
return;
}
final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
presentation.setEnabled(toolWindowManager.isEditorComponentActive() && manager.isInSplitter() && manager.getCurrentWindow() != null);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class NonEmptyActionGroup method update.
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
presentation.setVisible(getChildrenCount() > 0);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class RevealFileAction method update.
@Override
public void update(AnActionEvent e) {
VirtualFile file = ShowFilePathAction.findLocalFile(CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext()));
Presentation presentation = e.getPresentation();
presentation.setText(getActionName());
presentation.setEnabled(file != null);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class BaseToolWindowToggleAction method update.
@Override
public final void update(AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
Project project = e.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
if (id == null) {
presentation.setEnabled(false);
return;
}
ToolWindow window = mgr.getToolWindow(id);
if (window == null) {
presentation.setEnabled(false);
return;
}
update(window, presentation);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class HideAllToolWindowsAction method update.
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
Project project = event.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
String[] ids = toolWindowManager.getToolWindowIds();
for (String id : ids) {
if (HideToolWindowAction.shouldBeHiddenByShortCut(toolWindowManager, id)) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.hide.all.windows"), true);
return;
}
}
final DesktopLayout layout = toolWindowManager.getLayoutToRestoreLater();
if (layout != null) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.restore.windows"));
return;
}
presentation.setEnabled(false);
}
Aggregations