public static boolean tryFocusExistingDialog(@Nullable BackgroundableActionLock lock) {
    if (lock == null || !lock.isLocked()) {
      return false;
    }

    for (Window window : Window.getWindows()) {
      Object windowLock = ClientProperty.get(window, CHANGES_DETAILS_WINDOW_KEY);
      if (lock.equals(windowLock)) {
        UIUtil.toFront(window);
        return true;
      }
    }
    return true; // lock is being held, do not show another dialog anyway
  }
public static boolean tryFocusExistingDialog(@Nullable BackgroundableActionLock lock)