code: private CmsFavInfo createFavInfo(CmsFavoriteEntry entry) throws CmsException {
  
          String title = "";
          String subtitle = "";
          CmsFavInfo result = new CmsFavInfo(entry);
          CmsObject cms = A_CmsUI.getCmsObject();
          String project = getProject(cms, entry);
          String site = getSite(cms, entry);
          try {
              CmsUUID idToLoad = entry.getDetailId() != null ? entry.getDetailId() : entry.getStructureId();
              CmsResource resource = cms.readResource(idToLoad, CmsResourceFilter.IGNORE_EXPIRATION.addRequireVisible());
              CmsResourceUtil resutil = new CmsResourceUtil(cms, resource);
              switch (entry.getType()) {
                  case explorerFolder:
                      title = CmsStringUtil.isEmpty(resutil.getTitle())
                      ? CmsResource.getName(resource.getRootPath())
                      : resutil.getTitle();
                      break;
                  case page:
                      title = resutil.getTitle();
                      break;
              }
              subtitle = resource.getRootPath();
              CmsResourceIcon icon = result.getResourceIcon();
              icon.initContent(resutil, CmsResource.STATE_UNCHANGED, false, false);
          } catch (CmsException e) {
              LOG.warn(e.getLocalizedMessage(), e);
          }
          result.getTopLine().setValue(title);
          result.getBottomLine().setValue(subtitle);
          result.getProjectLabel().setValue(project);
          result.getSiteLabel().setValue(site);
  
          return result;
  
      }
docs: Creates a favorite widget for a favorite entry.
  
  @param entry the favorite entry
  @return the favorite widget
  
  @throws CmsException if something goes wrong