use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class DesignerToolWindowManager method initToolWindow.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Impl
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
protected void initToolWindow() {
if (myToolWindowContent == null) {
myToolWindowContent = new DesignerToolWindow(myProject, true);
}
myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(DesignerBundle.message("designer.toolwindow.name"), false, getAnchor(), myProject, true);
myToolWindow.setIcon(UIDesignerNewIcons.ToolWindow);
if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
}
((ToolWindowEx) myToolWindow).setTitleActions(myToolWindowContent.createActions());
initGearActions();
ContentManager contentManager = myToolWindow.getContentManager();
Content content = contentManager.getFactory().createContent(myToolWindowContent.getToolWindowPanel(), DesignerBundle.message("designer.toolwindow.title"), false);
content.setCloseable(false);
content.setPreferredFocusableComponent(myToolWindowContent.getComponentTree());
contentManager.addContent(content);
contentManager.setSelectedContent(content, true);
myToolWindow.setAvailable(false, null);
}
use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class SvnMergeSourceDetails method showMe.
public static void showMe(final Project project, final SvnFileRevision revision, final VirtualFile file) {
if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
final ContentManager contentManager = toolWindow.getContentManager();
final MyDialog dialog = new MyDialog(project, revision, file);
// TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
Disposer.register(project, dialog.getDisposable());
Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(), SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
ContentsUtil.addOrReplaceContent(contentManager, content, true);
toolWindow.activate(null);
} else {
new MyDialog(project, revision, file).show();
}
}
use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class PyEduDebugRunner method initSession.
@Override
protected void initSession(XDebugSession session, RunProfileState state, Executor executor) {
XDebugSessionTab tab = ((XDebugSessionImpl) session).getSessionTab();
if (tab != null) {
RunnerLayoutUi ui = tab.getUi();
ContentManager contentManager = ui.getContentManager();
Content content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.console.content.name"));
if (content != null) {
ExecutionConsole console = session.getDebugProcess().createConsole();
PythonDebugLanguageConsoleView view = (PythonDebugLanguageConsoleView) console;
Presentation presentation = view.getSwitchConsoleActionPresentation();
ToggleAction action = new ToggleAction(presentation.getText(), presentation.getDescription(), presentation.getIcon()) {
@Override
public boolean isSelected(AnActionEvent e) {
return !view.isPrimaryConsoleEnabled();
}
@Override
public void setSelected(AnActionEvent e, boolean state) {
view.enableConsole(!state);
}
};
content.setActions(new DefaultActionGroup(action), ActionPlaces.DEBUGGER_TOOLBAR, view.getPreferredFocusableComponent());
}
patchLeftToolbar(session, ui);
}
}
use of com.intellij.ui.content.ContentManager 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.ContentManager 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