use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class PydevConsoleRunnerImpl method clearContent.
protected void clearContent(RunContentDescriptor descriptor) {
PythonConsoleToolWindow toolWindow = PythonConsoleToolWindow.getInstance(myProject);
if (toolWindow != null && toolWindow.getToolWindow() != null) {
Content content = toolWindow.getToolWindow().getContentManager().findContent(descriptor.getDisplayName());
assert content != null;
toolWindow.getToolWindow().getContentManager().removeContent(content, true);
}
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class WorkingCopiesContent method show.
public static void show(@NotNull Project project) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (manager != null) {
final ToolWindow window = manager.getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
if (window != null) {
window.show(null);
final ContentManager cm = window.getContentManager();
final Content content = cm.findContent(TAB_NAME);
if (content != null) {
cm.setSelectedContent(content, true);
}
}
}
}
use of com.intellij.ui.content.Content 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.ui.content.Content 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.ui.content.Content in project intellij-community by JetBrains.
the class DesignerToolWindowManager method initToolWindow.
@Override
protected void initToolWindow() {
myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"), false, getAnchor(), myProject, true);
myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);
if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
}
initGearActions();
ContentManager contentManager = myToolWindow.getContentManager();
Content content = contentManager.getFactory().createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
content.setCloseable(false);
content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
contentManager.addContent(content);
contentManager.setSelectedContent(content, true);
myToolWindow.setAvailable(false, null);
}
Aggregations