use of com.intellij.openapi.wm.impl.WindowManagerImpl in project intellij-community by JetBrains.
the class GuiTestBase method closeAllProjects.
@SuppressWarnings("UnusedDeclaration")
protected // Called by GuiTestRunner via reflection.
void closeAllProjects() {
pause(new Condition("Close all projects") {
@Override
public boolean test() {
final Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
execute(new GuiTask() {
@Override
protected void executeInEDT() throws Throwable {
TransactionGuard.submitTransaction(ApplicationManager.getApplication(), () -> {
for (Project project : openProjects) {
assertTrue("Failed to close project " + quote(project.getName()), closeAndDispose(project));
}
});
}
});
return ProjectManager.getInstance().getOpenProjects().length == 0;
}
}, SHORT_TIMEOUT);
//noinspection ConstantConditions
boolean welcomeFrameShown = execute(new GuiQuery<Boolean>() {
@Override
protected Boolean executeInEDT() throws Throwable {
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
if (openProjects.length == 0) {
WelcomeFrame.showNow();
WindowManagerImpl windowManager = (WindowManagerImpl) WindowManager.getInstance();
windowManager.disposeRootFrame();
return true;
}
return false;
}
});
if (welcomeFrameShown) {
pause(new Condition("'Welcome' frame to show up") {
@Override
public boolean test() {
for (Frame frame : Frame.getFrames()) {
if (frame == WelcomeFrame.getInstance() && frame.isShowing()) {
return true;
}
}
return false;
}
}, SHORT_TIMEOUT);
}
}
use of com.intellij.openapi.wm.impl.WindowManagerImpl in project intellij-community by JetBrains.
the class RequestFocusInToolWindowCmd method updateFocusedComponentForWatcher.
private static void updateFocusedComponentForWatcher(final Component c) {
final WindowWatcher watcher = ((WindowManagerImpl) WindowManager.getInstance()).getWindowWatcher();
final FocusWatcher focusWatcher = watcher.getFocusWatcherFor(c);
if (focusWatcher != null && c.isFocusOwner()) {
focusWatcher.setFocusedComponentImpl(c);
}
}
Aggregations