Returns the small icon resource for the given resource.<p>

@param explorerType the resource explorer type settings
@param resourceName the resource name

@return the icon resource
169830
public static Resource getSmallIconResource(CmsExplorerTypeSettings explorerType, String resourceName) {

        if (explorerType == null) {
            explorerType = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                (resourceName == null) && !CmsResource.isFolder(resourceName)
                ? CmsResourceTypeUnknownFile.RESOURCE_TYPE_NAME
                : "unknown_folder");
        }

        if (!explorerType.getIconRules().isEmpty() && (resourceName != null)) {
            String extension = CmsResource.getExtension(resourceName);
            if (extension != null) {
                CmsIconRule rule = explorerType.getIconRules().get(extension);
                if ((rule != null) && (rule.getSmallIconStyle() != null)) {
                    return new CmsCssIcon(rule.getSmallIconStyle());
                }
            }
        }
        if (explorerType.getSmallIconStyle() != null) {
            return new CmsCssIcon(explorerType.getSmallIconStyle());
        } else {
            return new ExternalResource(
                CmsWorkplace.getResourceUri(CmsWorkplace.RES_PATH_FILETYPES + explorerType.getOriginalIcon()));
        }
    }
1280129
public static Resource getSitemapResourceIcon(CmsObject cms, CmsResource resource, IconMode iconMode) {

        CmsResource defaultFile = null;
        List<CmsResource> resourcesForType = Lists.newArrayList();
        resourcesForType.add(resource);
        boolean skipDefaultFile = (iconMode == IconMode.sitemapSelect)
            && OpenCms.getResourceManager().matchResourceType(
                CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP,
                resource.getTypeId());
        if (resource.isFolder() && !skipDefaultFile) {

            try {
                defaultFile = cms.readDefaultFile(resource, CmsResourceFilter.IGNORE_EXPIRATION);
                if (defaultFile != null) {
                    resourcesForType.add(0, defaultFile);
                }
            } catch (Exception e) {
                // Shouldn't normally happen - readDefaultFile returns null instead of throwing an exception when it doesn't find a default file
            }
        }
        if (CmsJspNavBuilder.isNavLevelFolder(cms, resource)) {
            return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
        }
        CmsResource maybePage = resourcesForType.get(0);
        if (CmsResourceTypeXmlContainerPage.isContainerPage(maybePage)) {
            CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, maybePage.getRootPath());
            for (CmsDetailPageInfo realInfo : config.getAllDetailPages(true)) {
                if (realInfo.getUri().equals(maybePage.getRootPath())
                    || realInfo.getUri().equals(CmsResource.getParentFolder(maybePage.getRootPath()))) {
                    CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                        realInfo.getIconType());
                    if (settings != null) {
                        return CmsResourceUtil.getBigIconResource(settings, resource.getName());
                    }
                }
            }
        }

        Resource result = null;
        for (CmsResource res : resourcesForType) {
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(res);
            CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type.getTypeName());
            if (settings != null) {
                result = CmsResourceUtil.getBigIconResource(settings, res.getName());
                break;
            }
        }
        return result;
    }
81621
public Object getIcon(int iIconType)
    {
        if (m_iIconField == -1)
            return null;
        Object data = this.getFieldData(m_iIconField);
        if (data instanceof PortableImage)
            return ((PortableImage)data).getImage();     // Make sure you cache this
        else //if (data instanceof ImageIcon)
            return this.getFieldData(m_iIconField);
        //else
        //    return null;
    }
600008
@Override
	public CssStyle getIconStyle(String iconName) {
		if (this.icons == null) {
			return SimpleStyle.EMPTY_STYLE;
		}
		return this.icons.getStyle(iconName);
	}
99439
private void obtainIconTintList(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogIconTint});
        setIconTintList(typedArray.getColorStateList(0));
    }
1036209
protected static <AdapterType> AdapterType getAdapter(Resource resource, Class<AdapterType> type) {
        if (type == ResourceHandle.class) {
            return type.cast(new ResourceHandle(resource));
        }
        log.info("Unable to adapt resource on {} to type {}", resource.getPath(), type.getName());
        return null;
    }
1176451
public static IndexedContainer getResourceTypesContainer() {

        IndexedContainer types = new IndexedContainer();
        types.addContainerProperty(PropertyId.caption, String.class, null);
        types.addContainerProperty(PropertyId.icon, Resource.class, null);
        types.addContainerProperty(PropertyId.isFolder, Boolean.class, null);
        types.addContainerProperty(PropertyId.isXmlContent, Boolean.class, null);
        for (I_CmsResourceType type : getResourceTypes()) {
            CmsExplorerTypeSettings typeSetting = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                type.getTypeName());
            Item typeItem = types.addItem(type);
            typeItem.getItemProperty(PropertyId.caption).setValue(CmsVaadinUtils.getMessageText(typeSetting.getKey()));
            typeItem.getItemProperty(PropertyId.icon).setValue(CmsResourceUtil.getSmallIconResource(typeSetting, null));
            typeItem.getItemProperty(PropertyId.isXmlContent).setValue(
                Boolean.valueOf(type instanceof CmsResourceTypeXmlContent));
            typeItem.getItemProperty(PropertyId.isFolder).setValue(
                Boolean.valueOf(type instanceof A_CmsResourceTypeFolderBase));
        }

        return types;
    }
996977
public CmsContainerElementData getCachedNewElement(String resourceTypeName) {

        if (m_newElements.containsKey(resourceTypeName)) {
            return m_newElements.get(resourceTypeName);
        }
        return null;
    }
525482
@Override
    public ICodeBaseEntry lookupResource(String resourceName) {
        ICodeBaseEntry delegateCodeBaseEntry = delegateCodeBase.lookupResource(resourceName);
        if (delegateCodeBaseEntry == null) {
            return null;
        }
        return new DelegatingCodeBaseEntry(this, delegateCodeBaseEntry);
    }
133766
public static String getResourceUri(String resourceName) {

        StringBuffer result = new StringBuffer(256);
        result.append(getSkinUri());
        result.append(resourceName);
        return result.toString();
    }
4868
public IconType<WebFragmentDescriptor> getOrCreateIcon()
   {
      List<Node> nodeList = model.get("icon");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new IconTypeImpl<WebFragmentDescriptor>(this, "icon", model, nodeList.get(0));
      }
      return createIcon();
   }
757845
public CmsResourceTypeConfig getResourceType(String typeName) {

        for (CmsResourceTypeConfig type : getResourceTypes()) {
            if (typeName.equals(type.getTypeName())) {
                return type;
            }
        }
        return null;
    }
159666
public Resource getSmallIconResource() {

        if ((m_cms != null) && CmsJspNavBuilder.isNavLevelFolder(m_cms, m_resource)) {
            return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
        }
        if ((m_cms != null) && CmsResourceTypeXmlContainerPage.isModelCopyGroup(m_cms, m_resource)) {
            return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_MODEL_GROUP_COPY_BIG);
        }
        I_CmsResourceType type = getResourceType();
        CmsExplorerTypeSettings explorerType = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type.getTypeName());
        return getSmallIconResource(explorerType, m_resource != null ? m_resource.getName() : null);
    }
338056
public static String getExtension(String resourceName) {

        String result = null;
        if (!resourceName.endsWith("/")) {
            // folders don't have any extension
            resourceName = CmsResource.getName(resourceName);
            int index = resourceName.lastIndexOf(".") + 1;
            if ((index > 0) && (index < resourceName.length())) {
                result = resourceName.substring(index).toLowerCase();
            }
        }

        return result;
    }
69318
public void setType(String typeName) {

        try {
            try {
                m_type = OpenCms.getResourceManager().getResourceType(typeName);
            } catch (CmsLoaderException e) {
                // TODO: what happens if the resource type is a specialized folder and is not configured??
                int plainId;
                try {
                    plainId = OpenCms.getResourceManager().getResourceType(
                        CmsResourceTypePlain.getStaticTypeName()).getTypeId();
                } catch (CmsLoaderException e1) {
                    // this should really never happen
                    plainId = CmsResourceTypePlain.getStaticTypeId();
                }
                m_type = OpenCms.getResourceManager().getResourceType(plainId);
            }
            if (m_type.isFolder()) {
                // ensure folders end with a "/"
                if (!CmsResource.isFolder(m_destination)) {
                    m_destination += "/";
                }
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
1296828
public static Resource getResourceByType(int resourceType) {
    for (Resource resource : Resources.values()) {
      if (resource.resourceType() == resourceType) {
        return resource;
      }
    }
    return null;
  }
203537
public static String getResourceSpecific(String name)
	{
		ORule.ResourceGeneric generic = getResourceGeneric(name);
		String specific = generic!=null?Strings.afterFirst(name, '.'):name;
		return Strings.isEmpty(specific)?null:specific;
	}