use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class BrowseRepositoryAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
RepositoryBrowserDialog dialog = new RepositoryBrowserDialog(ProjectManager.getInstance().getDefaultProject());
dialog.show();
} else {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow w = manager.getToolWindow(REPOSITORY_BROWSER_TOOLWINDOW);
if (w == null) {
RepositoryToolWindowPanel component = new RepositoryToolWindowPanel(project);
w = manager.registerToolWindow(REPOSITORY_BROWSER_TOOLWINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
final Content content = ContentFactory.SERVICE.getInstance().createContent(component, "", false);
Disposer.register(content, component);
w.getContentManager().addContent(content);
}
w.show(null);
w.activate(null);
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class AbstractTerminalRunner method showConsole.
protected void showConsole(Executor defaultExecutor, @NotNull RunContentDescriptor myDescriptor, final Component toFocus) {
// Show in run toolwindow
ExecutionManager.getInstance(myProject).getContentManager().showRunContent(defaultExecutor, myDescriptor);
// Request focus
final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(defaultExecutor.getId());
window.activate(() -> IdeFocusManager.getInstance(myProject).requestFocus(toFocus, true));
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class TerminalToolWindowPanel method initTerminal.
public void initTerminal(final ToolWindow toolWindow) {
LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
toolWindow.setToHideOnEmptyContent(true);
Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
toolWindow.getContentManager().addContent(content);
((ToolWindowManagerEx) ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TerminalToolWindowFactory.TOOL_WINDOW_ID);
if (window != null) {
boolean visible = window.isVisible();
if (visible && toolWindow.getContentManager().getContentCount() == 0) {
initTerminal(window);
}
}
}
});
Disposer.register(myProject, new Disposable() {
@Override
public void dispose() {
if (myTerminalWidget != null) {
myTerminalWidget.dispose();
myTerminalWidget = null;
}
}
});
if (myDockContainer == null) {
myDockContainer = new TerminalDockContainer(toolWindow);
Disposer.register(myProject, myDockContainer);
DockManager.getInstance(myProject).register(myDockContainer);
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class EvalExpressionDialog method init.
protected void init() {
final ToolWindow findWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.FIND);
final boolean available = findWindow != null && findWindow.isAvailable();
myForm.getNewTabCheckbox().setEnabled(available);
myForm.getNewTabCheckbox().setSelected(FindSettings.getInstance().isShowResultsInSeparateView());
myForm.getHighlightCheckbox().setSelected(mySettings.HIGHLIGHT_RESULTS);
myForm.getHighlightCheckbox().addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
updateOkAction();
}
});
myForm.getUsageViewCheckbox().setSelected(mySettings.SHOW_USAGE_VIEW);
myForm.getUsageViewCheckbox().addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
myForm.getNewTabCheckbox().setEnabled(available && myForm.getUsageViewCheckbox().isSelected());
updateOkAction();
}
});
super.init();
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class IntersectingLocalChangesPanel method showInVersionControlToolWindow.
@SuppressWarnings("SameParameterValue")
public static void showInVersionControlToolWindow(@NotNull Project project, @NotNull String title, @NotNull List<FilePath> files, @NotNull String prompt) {
IntersectingLocalChangesPanel intersectingPanel = new IntersectingLocalChangesPanel(project, files, prompt);
Content content = ContentFactory.SERVICE.getInstance().createContent(intersectingPanel.myPanel, title, true);
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
addContent(toolWindow.getContentManager(), content, true);
toolWindow.activate(null);
}
Aggregations