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


Java DecodeDefaultsUtil类代码示例

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


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

示例1: loadBundledScheme

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
@Override
public void loadBundledScheme(@Nonnull String resourceName, @Nonnull Object requestor, @Nonnull ThrowableConvertor<Element, T, Throwable> convertor) {
  try {
    URL url = requestor instanceof AbstractExtensionPointBean
              ? (((AbstractExtensionPointBean)requestor).getLoaderForClass().getResource(resourceName))
              : DecodeDefaultsUtil.getDefaults(requestor, resourceName);
    if (url == null) {
      // Error shouldn't occur during this operation thus we report error instead of info
      LOG.error("Cannot read scheme from " + resourceName);
      return;
    }
    addNewScheme(convertor.convert(JDOMUtil.load(URLUtil.openStream(url))), false);
  }
  catch (Throwable e) {
    LOG.error("Cannot read scheme from " + resourceName, e);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:SchemesManagerImpl.java

示例2: getDefaultState

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
@Nullable
protected <T> T getDefaultState(@Nonnull Object component, @Nonnull String componentName, @Nonnull final Class<T> stateClass) {
  URL url = DecodeDefaultsUtil.getDefaults(component, componentName);
  if (url == null) {
    return null;
  }

  try {
    Element documentElement = JDOMXIncluder.resolve(JDOMUtil.loadDocument(url), url.toExternalForm()).detachRootElement();

    PathMacroManager pathMacroManager = getPathMacroManagerForDefaults();
    if (pathMacroManager != null) {
      pathMacroManager.expandPaths(documentElement);
    }

    return DefaultStateSerializer.deserializeState(documentElement, stateClass, null);
  }
  catch (IOException | JDOMException e) {
    throw new StateStorageException("Error loading state from " + url, e);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:ComponentStoreImpl.java

示例3: readDefTemplate

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
@Deprecated
@SuppressWarnings("deprecation")
private void readDefTemplate(DefaultLiveTemplatesProvider provider, String defTemplate, boolean registerTemplate)
        throws JDOMException, InvalidDataException, IOException {
  InputStream inputStream = DecodeDefaultsUtil.getDefaultsInputStream(provider, defTemplate);
  if (inputStream != null) {
    TemplateGroup group =
            readTemplateFile(JDOMUtil.loadDocument(inputStream), defTemplate, true, registerTemplate, provider.getClass().getClassLoader());
    if (group != null && group.getReplace() != null) {
      Collection<TemplateImpl> templates = myTemplates.get(group.getReplace());
      for (TemplateImpl template : templates) {
        removeTemplate(template);
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:TemplateSettings.java

示例4: readDefTemplate

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
private void readDefTemplate(DefaultLiveTemplatesProvider provider, String defTemplate, boolean registerTemplate) throws JDOMException, InvalidDataException, IOException {
  InputStream inputStream = DecodeDefaultsUtil.getDefaultsInputStream(provider, defTemplate);
  if (inputStream != null) {
    TemplateGroup group = readTemplateFile(JDOMUtil.load(inputStream), getDefaultTemplateName(defTemplate), true, registerTemplate, provider.getClass().getClassLoader());
    if (group != null && group.getReplace() != null) {
      for (TemplateImpl template : myTemplates.get(group.getReplace())) {
        removeTemplate(template);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:TemplateSettings.java

示例5: readDefTemplate

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
private void readDefTemplate(DefaultLiveTemplatesProvider provider, String defTemplate, boolean registerTemplate)
  throws JDOMException, InvalidDataException, IOException {
  String templateName = getDefaultTemplateName(defTemplate);
  InputStream inputStream = DecodeDefaultsUtil.getDefaultsInputStream(provider, defTemplate);
  if (inputStream != null) {
    TemplateGroup group =
      readTemplateFile(JDOMUtil.loadDocument(inputStream), templateName, true, registerTemplate, provider.getClass().getClassLoader());
    if (group != null && group.getReplace() != null) {
      Collection<TemplateImpl> templates = myTemplates.get(group.getReplace());
      for (TemplateImpl template : templates) {
        removeTemplate(template);
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:TemplateSettings.java

示例6: hasState

import com.intellij.openapi.application.ex.DecodeDefaultsUtil; //导入依赖的package包/类
public boolean hasState(final Object component, final String componentName, final Class<?> aClass, final boolean reloadData) throws StateStorageException {
  final URL url = DecodeDefaultsUtil.getDefaults(component, componentName);
  return url != null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:DefaultsStateStorage.java


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