use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class StoreDefaultLayoutAction method update.
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
presentation.setEnabled(event.getProject() != null);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ToggleFloatingModeAction method update.
public void update(AnActionEvent event) {
super.update(event);
Presentation presentation = event.getPresentation();
Project project = event.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
presentation.setEnabled(id != null && mgr.getToolWindow(id).isAvailable());
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ToggleFullScreenAction method update.
@Override
public void update(@NotNull final AnActionEvent e) {
Presentation p = e.getPresentation();
IdeFrameEx frame = null;
boolean isApplicable = WindowManager.getInstance().isFullScreenSupportedInCurrentOS() && (frame = getFrame()) != null;
if (e.getPlace() != ActionPlaces.MAIN_TOOLBAR) {
p.setVisible(isApplicable);
}
p.setEnabled(isApplicable);
if (isApplicable) {
p.setText(frame.isInFullScreen() ? TEXT_EXIT_FULL_SCREEN : TEXT_ENTER_FULL_SCREEN);
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ShowLogAction method update.
@Override
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
presentation.setVisible(ShowFilePathAction.isSupported());
presentation.setText(getActionName());
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ToggleWindowedModeAction method update.
public void update(AnActionEvent event) {
super.update(event);
Presentation presentation = event.getPresentation();
if (SystemInfo.isMac) {
presentation.setEnabledAndVisible(false);
return;
}
Project project = event.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
presentation.setEnabled(id != null && mgr.getToolWindow(id).isAvailable());
}
Aggregations