本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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;
}