use of com.intellij.openapi.wm.ToolWindow 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.ToolWindow in project intellij-community by JetBrains.
the class WindowSystemPlaybackCall method waitForToolWindow.
public static AsyncResult<String> waitForToolWindow(final PlaybackContext context, final String id) {
final AsyncResult<String> result = new AsyncResult<>();
findProject().doWhenDone(new Consumer<Project>() {
@Override
public void consume(Project project) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(id);
if (toolWindow == null) {
result.setRejected("Cannot find tool window with id: " + id);
return;
}
toolWindow.getReady(context).doWhenDone(result.createSetDoneRunnable()).doWhenRejected(() -> result.setRejected("Cannot activate tool window with id:" + id));
}
}).doWhenRejected(() -> result.setRejected("Cannot retrieve open project"));
return result;
}
use of com.intellij.openapi.wm.ToolWindow 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.ToolWindow in project intellij-community by JetBrains.
the class ServersToolWindowManager method createToolWindow.
private ToolWindow createToolWindow(Project project, ToolWindowManager toolWindowManager) {
ToolWindow toolWindow = toolWindowManager.registerToolWindow(myWindowId, false, ToolWindowAnchor.BOTTOM);
toolWindow.setIcon(myIcon);
getFactory().createToolWindowContent(project, toolWindow);
return toolWindow;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class UsageViewManagerImpl method showToolWindow.
void showToolWindow(boolean activateWindow) {
ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.FIND);
toolWindow.show(null);
if (activateWindow && !toolWindow.isActive()) {
toolWindow.activate(null);
}
}
Aggregations