use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ToolWindowsGroup method getToolWindowActions.
public static List<ActivateToolWindowAction> getToolWindowActions(@NotNull Project project, boolean shouldSkipHidden) {
ActionManager actionManager = ActionManager.getInstance();
ToolWindowManager manager = ToolWindowManager.getInstance(project);
List<ActivateToolWindowAction> result = ContainerUtil.newArrayList();
for (String id : manager.getToolWindowIds()) {
if (shouldSkipHidden && !manager.getToolWindow(id).isShowStripeButton())
continue;
String actionId = ActivateToolWindowAction.getActionIdForToolWindow(id);
AnAction action = actionManager.getAction(actionId);
if (action instanceof ActivateToolWindowAction) {
result.add((ActivateToolWindowAction) action);
}
}
Collections.sort(result, COMPARATOR);
return result;
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ToggleDockModeAction method isSelected.
public boolean isSelected(AnActionEvent event) {
Project project = event.getProject();
if (project == null) {
return false;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
String id = windowManager.getActiveToolWindowId();
if (id == null) {
return false;
}
return ToolWindowType.DOCKED == windowManager.getToolWindow(id).getType();
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ToggleDockModeAction 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();
if (id == null) {
presentation.setEnabled(false);
return;
}
ToolWindow toolWindow = mgr.getToolWindow(id);
presentation.setEnabled(toolWindow.isAvailable() && toolWindow.getType() != ToolWindowType.FLOATING && toolWindow.getType() != ToolWindowType.WINDOWED);
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ToggleFloatingModeAction method isSelected.
public boolean isSelected(AnActionEvent event) {
Project project = event.getProject();
if (project == null) {
return false;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
String id = windowManager.getActiveToolWindowId();
if (id == null) {
return false;
}
return ToolWindowType.FLOATING == windowManager.getToolWindow(id).getType();
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class TabNavigationActionBase method actionPerformed.
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null || project.isDisposed()) {
return;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
if (windowManager.isEditorComponentActive()) {
doNavigate(dataContext, project);
return;
}
ContentManager contentManager = PlatformDataKeys.NONEMPTY_CONTENT_MANAGER.getData(dataContext);
if (contentManager == null)
return;
doNavigate(contentManager);
}
Aggregations