本文整理匯總了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;
}