当前位置: 首页>>代码示例>>Java>>正文


Java XmlSchemaProvider类代码示例

本文整理汇总了Java中com.intellij.xml.XmlSchemaProvider的典型用法代码示例。如果您正苦于以下问题:Java XmlSchemaProvider类的具体用法?Java XmlSchemaProvider怎么用?Java XmlSchemaProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XmlSchemaProvider类属于com.intellij.xml包,在下文中一共展示了XmlSchemaProvider类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isDevKitConfig

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
private boolean isDevKitConfig(XmlTag tag, XmlFile baseFile) {
    Module module = ModuleUtilCore.findModuleForPsiElement(baseFile);

    String namespace = tag.getNamespace();
    List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(baseFile);

    for (XmlSchemaProvider provider : providers) {
        Set<String> locations = provider.getLocations(namespace, baseFile);
        for (String location : locations) {
            XmlFile schema = provider.getSchema(location, module, baseFile);
            if (schema != null) {
                String schemaFile = schema.getText();
                if (schemaFile.contains("http://www.mulesoft.org/schema/mule/devkit")) {
                    return true;
                }
            }
        }
    }

    return false;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:22,代码来源:GlobalConfigsToolWindowPanel.java

示例2: suggestPrefix

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace)
{
	if(namespace == null)
	{
		return null;
	}
	for(XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file))
	{
		String prefix = provider.getDefaultPrefix(namespace, file);
		if(prefix != null)
		{
			return prefix;
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:18,代码来源:ExtendedTagInsertHandler.java

示例3: suggestPrefix

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace) {
    if (namespace == null) {
        return null;
    }
    for (XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file)) {
        String prefix = provider.getDefaultPrefix(namespace, file);
        if (prefix != null) {
            return prefix;
        }
    }
    return null;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:14,代码来源:MuleElementInsertHandler.java

示例4: setUp

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();

  final LocalInspectionTool[] tools = configureLocalInspectionTools();

  CodeInsightTestFixtureImpl.configureInspections(tools, getProject(), Collections.<String>emptyList(),
                                                  getTestRootDisposable());

  DaemonCodeAnalyzerImpl daemonCodeAnalyzer = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(getProject());
  daemonCodeAnalyzer.prepareForTest();
  final StartupManagerImpl startupManager = (StartupManagerImpl)StartupManagerEx.getInstanceEx(getProject());
  startupManager.runStartupActivities();
  startupManager.startCacheUpdate();
  startupManager.runPostStartupActivities();
  DaemonCodeAnalyzerSettings.getInstance().setImportHintEnabled(false);

  if (isPerformanceTest()) {
    IntentionManager.getInstance().getAvailableIntentionActions();  // hack to avoid slowdowns in PyExtensionFactory
    PathManagerEx.getTestDataPath(); // to cache stuff
    ReferenceProvidersRegistry.getInstance(); // pre-load tons of classes
    InjectedLanguageManager.getInstance(getProject()); // zillion of Dom Sem classes
    LanguageAnnotators.INSTANCE.allForLanguage(JavaLanguage.INSTANCE); // pile of annotator classes loads
    LanguageAnnotators.INSTANCE.allForLanguage(StdLanguages.XML);
    ProblemHighlightFilter.EP_NAME.getExtensions();
    Extensions.getExtensions(ImplicitUsageProvider.EP_NAME);
    Extensions.getExtensions(XmlSchemaProvider.EP_NAME);
    Extensions.getExtensions(XmlFileNSInfoProvider.EP_NAME);
    Extensions.getExtensions(ExternalAnnotatorsFilter.EXTENSION_POINT_NAME);
    Extensions.getExtensions(IndexPatternBuilder.EP_NAME);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:DaemonAnalyzerTestCase.java

示例5: getResourceLocation

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version) {
  final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
  if (schema != null) {
    return schema;
  }
  final String location = getResourceLocation(url, version, baseFile.getProject());
  return XmlUtil.findXmlFile(baseFile, location);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalResourceManagerExImpl.java

示例6: suggestPrefix

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static String suggestPrefix(XmlFile file, @Nullable String namespace) {
  if (namespace == null) {
    return null;
  }
  for (XmlSchemaProvider provider : XmlSchemaProvider.getAvailableProviders(file)) {
    String prefix = provider.getDefaultPrefix(namespace, file);
    if (prefix != null) {
      return prefix;
    }
  }
  return null; 
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ExtendedTagInsertHandler.java

示例7: getUnboundNamespaceForPrefix

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
/** Given a prefix in a file and a set of candidate namespaces, returns the namespace that matches the prefix (if any)
 * as determined by the {@link XmlSchemaProvider#getDefaultPrefix(String, XmlFile)}
 * implementations */
@Nullable
public static String getUnboundNamespaceForPrefix(String prefix, XmlFile xmlFile, Set<String> namespaces) {
  final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(xmlFile);
  for (XmlSchemaProvider provider : providers) {
    for (String namespace : namespaces) {
      if (prefix.equals(provider.getDefaultPrefix(namespace, xmlFile))) {
        return namespace;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:CreateNSDeclarationIntentionFix.java

示例8: getResourceLocation

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version) {
  final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
  if (schema != null) {
    return schema;
  }
  final String location = getResourceLocation(url, version, baseFile.getProject());
  return XmlUtil.findXmlFile(baseFile, location);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:ExternalResourceManagerExImpl.java

示例9: findNamespace

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Nullable
public static XmlFile findNamespace(@NotNull PsiFile base, @NotNull String nsLocation)
{
	final String location = ExternalResourceManager.getInstance().getResourceLocation(nsLocation, base.getProject());
	if(!location.equals(nsLocation))
	{ // is mapped
		return findXmlFile(base, location);
	}
	final XmlFile xmlFile = XmlSchemaProvider.findSchema(location, base);
	return xmlFile == null ? findXmlFile(base, location) : xmlFile;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:12,代码来源:XmlUtil.java

示例10: getResourceLocation

import com.intellij.xml.XmlSchemaProvider; //导入依赖的package包/类
@Override
@Nullable
public PsiFile getResourceLocation(@NotNull @NonNls final String url, @NotNull final PsiFile baseFile, final String version)
{
	final XmlFile schema = XmlSchemaProvider.findSchema(url, baseFile);
	if(schema != null)
	{
		return schema;
	}
	final String location = getResourceLocation(url, version, baseFile.getProject());
	return XmlUtil.findXmlFile(baseFile, location);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:13,代码来源:ExternalResourceManagerExImpl.java


注:本文中的com.intellij.xml.XmlSchemaProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。