public final void disposeRootFrame() {
   if (myProject2Frame.size() == 1) {
     final IdeFrameImpl rootFrame = myProject2Frame.remove(null);
     if (rootFrame != null) {
       // disposing last frame if quitting
       rootFrame.dispose();
     }
   }
 }
  public final void releaseFrame(final IdeFrameImpl frame) {

    myEventDispatcher.getMulticaster().beforeFrameReleased(frame);

    final Project project = frame.getProject();
    LOG.assertTrue(project != null);

    frame.removeWindowListener(myActivationListener);
    proceedDialogDisposalQueue(project);

    frame.setProject(null);
    frame.setTitle(null);
    frame.setFileTitle(null, null);

    myProject2Frame.remove(project);
    Disposer.dispose(frame.getStatusBar());
    frame.dispose();
  }
  public void setFullScreen(IdeFrameImpl frame, boolean fullScreen) {
    if (!isFullScreenSupportedInCurrentOS() || frame.isInFullScreen() == fullScreen) return;

    try {
      if (SystemInfo.isMacOSLion) {
        frame.getFrameDecorator().toggleFullScreen(fullScreen);
        return;
      }

      if (SystemInfo.isWindows) {
        GraphicsDevice device = ScreenUtil.getScreenDevice(frame.getBounds());
        if (device == null) return;
        try {
          frame.getRootPane().putClientProperty(ScreenUtil.DISPOSE_TEMPORARY, Boolean.TRUE);
          if (fullScreen) {
            frame.getRootPane().putClientProperty("oldBounds", frame.getBounds());
          }
          frame.dispose();
          frame.setUndecorated(fullScreen);
        } finally {
          if (fullScreen) {
            frame.setBounds(device.getDefaultConfiguration().getBounds());
          } else {
            Object o = frame.getRootPane().getClientProperty("oldBounds");
            if (o instanceof Rectangle) {
              frame.setBounds((Rectangle) o);
            }
          }
          frame.setVisible(true);
          frame.getRootPane().putClientProperty(ScreenUtil.DISPOSE_TEMPORARY, null);
        }
      }
    } finally {
      frame.storeFullScreenStateIfNeeded(fullScreen);
    }
  }