use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class MavenConsoleImpl method ensureAttachedToToolWindow.
private void ensureAttachedToToolWindow() {
if (!isOpen.compareAndSet(false, true))
return;
MavenUtil.invokeLater(myProject, () -> {
MessageView messageView = MessageView.SERVICE.getInstance(myProject);
Content content = ContentFactory.SERVICE.getInstance().createContent(myConsoleView.getComponent(), myTitle, true);
content.putUserData(CONSOLE_KEY, this);
messageView.getContentManager().addContent(content);
messageView.getContentManager().setSelectedContent(content);
// remove unused tabs
for (Content each : messageView.getContentManager().getContents()) {
if (each.isPinned())
continue;
if (each == content)
continue;
MavenConsoleImpl console = each.getUserData(CONSOLE_KEY);
if (console == null)
continue;
if (!myTitle.equals(console.myTitle))
continue;
if (console.isFinished()) {
messageView.getContentManager().removeContent(each, true);
}
}
ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
if (!toolWindow.isActive()) {
toolWindow.activate(null, false);
}
});
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class DynamicManagerImpl method addProperty.
@Override
public void addProperty(DynamicElementSettings settings) {
assert settings != null;
assert !settings.isMethod();
final DPropertyElement propertyElement = (DPropertyElement) createDynamicElement(settings);
final DClassElement classElement = getOrCreateClassElement(myProject, settings.getContainingClassName());
//important to fetch myToolWindow before adding
ToolWindow window = DynamicToolWindowWrapper.getInstance(myProject).getToolWindow();
classElement.addProperty(propertyElement);
addItemInTree(classElement, propertyElement, window);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class DynamicManagerImpl method addMethod.
@Override
public void addMethod(DynamicElementSettings settings) {
if (settings == null)
return;
assert settings.isMethod();
final DMethodElement methodElement = (DMethodElement) createDynamicElement(settings);
final DClassElement classElement = getOrCreateClassElement(myProject, settings.getContainingClassName());
//important to fetch myToolWindow before adding
ToolWindow window = DynamicToolWindowWrapper.getInstance(myProject).getToolWindow();
classElement.addMethod(methodElement);
addItemInTree(classElement, methodElement, window);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class StudyUtils method registerStudyToolWindow.
public static void registerStudyToolWindow(@Nullable final Course course, Project project) {
if (course != null && "PyCharm".equals(course.getCourseType())) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
registerToolWindows(toolWindowManager, project);
final ToolWindow studyToolWindow = toolWindowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
if (studyToolWindow != null) {
studyToolWindow.show(null);
initToolWindows(project);
}
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class StudyProjectComponent method projectClosed.
@Override
public void projectClosed() {
final Course course = StudyTaskManager.getInstance(myProject).getCourse();
if (course != null) {
final ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
if (toolWindow != null) {
toolWindow.getContentManager().removeAllContents(false);
}
KeymapManagerEx keymapManager = KeymapManagerEx.getInstanceEx();
for (Keymap keymap : keymapManager.getAllKeymaps()) {
List<Pair<String, String>> pairs = myDeletedShortcuts.get(keymap);
if (pairs != null && !pairs.isEmpty()) {
for (Pair<String, String> actionShortcut : pairs) {
keymap.addShortcut(actionShortcut.first, new KeyboardShortcut(KeyStroke.getKeyStroke(actionShortcut.second), null));
}
}
}
}
myListener = null;
}
Aggregations