use of com.intellij.openapi.wm.ToolWindowManager in project intellij-code-outline by sitano.
the class CodeOutlinePlugin method regForProject.
/**
* Creates a code outline tool window for the given project.
*
* @param project the project to register
*/
private synchronized void regForProject(final Project project) {
final CodeOutlineToolWindow window = new CodeOutlineToolWindow(this, project);
ToolWindowManager twm = ToolWindowManager.getInstance(project);
ToolWindowManagerEx twmEx = (ToolWindowManagerEx) twm;
ToolWindow tw = twm.registerToolWindow(TOOLWINDOW_ID, false, ToolWindowAnchor.RIGHT);
ContentFactory contentFactory = ServiceManager.getService(ContentFactory.class);
Content content = contentFactory.createContent(window, "", false);
tw.getContentManager().addContent(content);
tw.getContentManager().setSelectedContent(content, false);
twmEx.addToolWindowManagerListener(window.getToolWindowManagerListener());
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-plugins by StepicOrg.
the class StudyUtils method initToolWindows.
static void initToolWindows(@NotNull final Project project) {
final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW).getContentManager().removeAllContents(false);
StudyToolWindowFactory factory = new StudyToolWindowFactory();
factory.createToolWindowContent(project, windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW));
}
use of com.intellij.openapi.wm.ToolWindowManager 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.openapi.wm.ToolWindowManager 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.ToolWindowManager in project intellij-community by JetBrains.
the class StudyUtils method initToolWindows.
public static void initToolWindows(@NotNull final Project project) {
final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW).getContentManager().removeAllContents(false);
StudyToolWindowFactory factory = new StudyToolWindowFactory();
factory.createToolWindowContent(project, windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW));
}
Aggregations