code: public boolean isActive()
      {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          if (facesContext != null)
          {
              return facesContext.getViewRoot() != null;
          }
          else
          {
              // No FacesContext means no view scope active.
              return false;
          }
      }
docs: The WindowContext is active once a current windowId is set for the current Thread.
  @return