Java 类com.intellij.lang.LanguageHtmlScriptContentProvider 实例源码

项目:RtplPlugin    文件:BaseHtmlLexer.java   
@Nullable
protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) {
  if (StringUtil.isEmpty(mimeType)) {
    return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null;
  }
  Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType.trim());
  if (instancesByMimeType.isEmpty() && mimeType.contains("template")) {
    instancesByMimeType = Collections.<Language>singletonList(HTMLLanguage.INSTANCE);
  }
  for (Language language : instancesByMimeType) {
    HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language);
    if (scriptContentProvider != null) {
      return scriptContentProvider;
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:BaseHtmlLexer.java   
@Nullable
protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) {
  if (StringUtil.isEmpty(mimeType)) {
    return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null;
  }
  Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType.trim());
  if (instancesByMimeType.isEmpty() && mimeType.contains("template")) {
    instancesByMimeType = Collections.<Language>singletonList(HTMLLanguage.INSTANCE);
  }
  for (Language language : instancesByMimeType) {
    HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language);
    if (scriptContentProvider != null) {
      return scriptContentProvider;
    }
  }
  return null;
}
项目:consulo-xml    文件:BaseHtmlLexer.java   
@Nullable
protected HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType)
{
    if(StringUtil.isEmpty(mimeType))
    {
        return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null;
    }
    Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType.trim());
    if(instancesByMimeType.isEmpty() && mimeType.contains("template"))
    {
        instancesByMimeType = Collections.singletonList(HTMLLanguage.INSTANCE);
    }
    for(Language language : instancesByMimeType)
    {
        HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language);
        if(scriptContentProvider != null)
        {
            return scriptContentProvider;
        }
    }
    return null;
}
项目:tools-idea    文件:BaseHtmlLexer.java   
@Nullable
protected static HtmlScriptContentProvider findScriptContentProvider(@Nullable String mimeType) {
  if (StringUtil.isEmpty(mimeType)) {
    return ourDefaultLanguage != null ? LanguageHtmlScriptContentProvider.getScriptContentProvider(ourDefaultLanguage) : null;
  }
  Collection<Language> instancesByMimeType = Language.findInstancesByMimeType(mimeType != null ? mimeType.trim() : null);
  for (Language language : instancesByMimeType) {
    HtmlScriptContentProvider scriptContentProvider = LanguageHtmlScriptContentProvider.getScriptContentProvider(language);
    if (scriptContentProvider != null) {
      return scriptContentProvider;
    }
  }
  return null;
}