use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class PsiPackageImplementationHelperImpl method navigate.
@Override
public void navigate(@NotNull final PsiPackage psiPackage, final boolean requestFocus) {
final Project project = psiPackage.getProject();
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
window.activate(null);
window.getActivation().doWhenDone(() -> {
final ProjectView projectView = ProjectView.getInstance(project);
PsiDirectory[] directories = suggestMostAppropriateDirectories(psiPackage);
if (directories.length == 0)
return;
projectView.select(directories[0], directories[0].getVirtualFile(), requestFocus);
});
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class TestErrorViewAction method openView.
protected void openView(Project project, JComponent component) {
final MessageView messageView = MessageView.SERVICE.getInstance(project);
final Content content = ContentFactory.SERVICE.getInstance().createContent(component, getContentName(), true);
messageView.getContentManager().addContent(content);
messageView.getContentManager().setSelectedContent(content);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
if (toolWindow != null) {
toolWindow.activate(null);
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ToggleDockModeAction method setSelected.
public void setSelected(AnActionEvent event, boolean flag) {
Project project = event.getProject();
if (project == null) {
return;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
String id = windowManager.getActiveToolWindowId();
if (id == null) {
return;
}
ToolWindow toolWindow = windowManager.getToolWindow(id);
ToolWindowType type = toolWindow.getType();
if (ToolWindowType.DOCKED == type) {
toolWindow.setType(ToolWindowType.SLIDING, null);
} else if (ToolWindowType.SLIDING == type) {
toolWindow.setType(ToolWindowType.DOCKED, null);
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class TogglePresentationModeAction method hideAllToolWindows.
private static boolean hideAllToolWindows(ToolWindowManagerEx manager) {
// to clear windows stack
manager.clearSideStack();
String[] ids = manager.getToolWindowIds();
boolean hasVisible = false;
for (String id : ids) {
final ToolWindow toolWindow = manager.getToolWindow(id);
if (toolWindow.isVisible()) {
toolWindow.hide(null);
hasVisible = true;
}
}
return hasVisible;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ToolWindowsPane method getStripeFor.
@Nullable
Stripe getStripeFor(String id) {
ToolWindow window = myManager.getToolWindow(id);
if (window == null) {
return null;
}
final ToolWindowAnchor anchor = myManager.getToolWindow(id).getAnchor();
if (ToolWindowAnchor.TOP == anchor) {
return myTopStripe;
}
if (ToolWindowAnchor.BOTTOM == anchor) {
return myBottomStripe;
}
if (ToolWindowAnchor.LEFT == anchor) {
return myLeftStripe;
}
if (ToolWindowAnchor.RIGHT == anchor) {
return myRightStripe;
}
throw new IllegalArgumentException("Anchor=" + anchor);
}
Aggregations