use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class LafManagerImpl method updateToolWindows.
public static void updateToolWindows() {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
for (String id : toolWindowManager.getToolWindowIds()) {
final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
for (Content content : toolWindow.getContentManager().getContents()) {
final JComponent component = content.getComponent();
if (component != null) {
IJSwingUtilities.updateComponentTreeUI(component);
}
}
final JComponent c = toolWindow.getComponent();
if (c != null) {
IJSwingUtilities.updateComponentTreeUI(c);
}
}
}
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ServersToolWindowManager method updateWindowAvailable.
private void updateWindowAvailable(final boolean showIfAvailable) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
toolWindowManager.invokeLater(() -> {
boolean available = getFactory().getContribution().canContribute(myProject);
final ToolWindow toolWindow = toolWindowManager.getToolWindow(myWindowId);
if (toolWindow == null) {
if (available) {
createToolWindow(myProject, toolWindowManager).show(null);
}
return;
}
boolean doShow = !toolWindow.isAvailable() && available;
if (toolWindow.isAvailable() && !available) {
toolWindow.hide(null);
}
toolWindow.setAvailable(available, null);
if (showIfAvailable && doShow) {
toolWindow.show(null);
}
});
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class TodoCheckinHandler method showTodo.
private void showTodo(TodoCheckinHandlerWorker worker) {
String title = "For commit (" + DateFormatUtil.formatDateTime(System.currentTimeMillis()) + ")";
ServiceManager.getService(myProject, TodoView.class).addCustomTodoView(new TodoTreeBuilderFactory() {
@Override
public TodoTreeBuilder createTreeBuilder(JTree tree, DefaultTreeModel treeModel, Project project) {
return new CustomChangelistTodosTreeBuilder(tree, treeModel, myProject, title, worker.inOneList());
}
}, title, new TodoPanelSettings(myConfiguration.myTodoPanelSettings));
ApplicationManager.getApplication().invokeLater(() -> {
ToolWindowManager manager = ToolWindowManager.getInstance(myProject);
if (manager != null) {
ToolWindow window = manager.getToolWindow("TODO");
if (window != null) {
window.show(() -> {
ContentManager cm = window.getContentManager();
Content[] contents = cm.getContents();
if (contents.length > 0) {
cm.setSelectedContent(contents[contents.length - 1], true);
}
});
}
}
}, ModalityState.NON_MODAL, myProject.getDisposed());
}
use of com.intellij.openapi.wm.ToolWindowManager in project android by JetBrains.
the class SelectBuildVariantAction method doPerform.
@Override
protected void doPerform(@NotNull AnActionEvent e, @NotNull final Project project) {
final Module module = getSelectedAndroidModule(e);
if (module != null) {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = manager.getToolWindow(BuildVariantToolWindowFactory.ID);
if (toolWindow != null) {
toolWindow.activate(new Runnable() {
@Override
public void run() {
BuildVariantView view = BuildVariantView.getInstance(project);
view.findAndSelectVariantEditor(module);
}
});
}
}
}
use of com.intellij.openapi.wm.ToolWindowManager in project android by JetBrains.
the class AndroidMonitorToolWindow method updateToolWindow.
public void updateToolWindow() {
ToolWindowManager manager = ToolWindowManager.getInstance(myProject);
ToolWindow window = manager.getToolWindow(AndroidMonitorToolWindowFactory.ID);
boolean maximize = myProfilers.getMode() == ProfilerMode.EXPANDED;
if (maximize != manager.isMaximized(window)) {
manager.setMaximized(window, maximize);
}
}
Aggregations