code: public void onSiteOrProjectChange(CmsProject project, String siteRoot) {
  
          if ((siteRoot != null) && !siteRoot.equals(getSiteRootFromState())) {
              changeSite(siteRoot, null, true);
          } else if ((project != null) && !project.getUuid().equals(getProjectIdFromState())) {
              openPath(getPathFromState(), true);
          }
          m_appContext.updateOnChange();
          setToolbarButtonsEnabled(!CmsAppWorkplaceUi.isOnlineProject());
      }
docs: Call if site and or project have been changed.<p>
  
  @param project the project
  @param siteRoot the site root