當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。