@Override
  public void propertyChange(@NotNull PropertyChangeEvent e) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("enter: propertyChange(" + e + ")");
    }
    if (!FOCUSED_WINDOW_PROPERTY.equals(e.getPropertyName())) {
      throw new IllegalArgumentException("unknown property name: " + e.getPropertyName());
    }

    synchronized (myLock) {
      final Window window = (Window)e.getNewValue();
      if (window == null || ApplicationManager.getApplication().isDisposed()) {
        return;
      }
      if (!windowToInfo.containsKey(window)) {
        windowToInfo.put(window, new WindowInfo(window, true));
      }
      myFocusedWindow = window;
      final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myFocusedWindow));
      for (Iterator<Window> i = myFocusedWindows.iterator(); i.hasNext(); ) {
        final Window w = i.next();
        final DataContext dataContext = DataManager.getInstance().getDataContext(w);
        if (project == CommonDataKeys.PROJECT.getData(dataContext)) {
          i.remove();
        }
      }
      myFocusedWindows.add(myFocusedWindow);
      // Set new root frame
      JFrame frame;
      if (window instanceof JFrame) {
        frame = (JFrame)window;
      }
      else {
        frame = (JFrame)SwingUtilities.getAncestorOfClass(IdeFrameImpl.class, window);
      }
      if (frame != null) {
        JOptionPane.setRootFrame(frame);
      }
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("exit: propertyChange()");
    }
  }
@Override
  public void propertyChange(@NotNull PropertyChangeEvent e)