code: private List<CmsResourceTypeBean> getResourceTypeBeans(
          GalleryMode galleryMode,
          String referenceSitePath,
          List<String> resourceTypesList,
          final List<String> typesForTypeTab) {
  
          List<I_CmsResourceType> resourceTypes = null;
          Set<String> creatableTypes = null;
          switch (galleryMode) {
              case editor:
              case view:
              case adeView:
              case widget:
                  resourceTypes = convertTypeNamesToTypes(resourceTypesList);
                  if (resourceTypes.size() == 0) {
                      resourceTypes = Lists.newArrayList(getDefaultTypesForGallery());
                  }
                  creatableTypes = Collections.<String> emptySet();
                  break;
              case ade:
                  throw new IllegalStateException("This code should never be called");
                  // ADE case is handled by container page service
              default:
                  resourceTypes = Collections.<I_CmsResourceType> emptyList();
                  creatableTypes = Collections.<String> emptySet();
          }
          return buildTypesList(resourceTypes, creatableTypes, Collections.<String> emptySet(), typesForTypeTab);
      }
docs: Returns the resource types configured to be used within the given gallery mode.<p>
  
  @param galleryMode the gallery mode
  @param referenceSitePath the reference site-path to check permissions for
  @param resourceTypesList the resource types parameter
  @param typesForTypeTab the types which should be shown in the types tab according to the gallery configuration
  
  @return the resource types