本文整理汇总了Java中com.intellij.openapi.application.ex.DecodeDefaultsUtil.getDefaults方法的典型用法代码示例。如果您正苦于以下问题:Java DecodeDefaultsUtil.getDefaults方法的具体用法?Java DecodeDefaultsUtil.getDefaults怎么用?Java DecodeDefaultsUtil.getDefaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.application.ex.DecodeDefaultsUtil
的用法示例。
在下文中一共展示了DecodeDefaultsUtil.getDefaults方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}