@NotNull private static ConfigImportSettings getConfigImportSettings() { try { @SuppressWarnings("unchecked") Class<ConfigImportSettings> customProviderClass = (Class<ConfigImportSettings>) Class.forName( "com.intellij.openapi.application." + PlatformUtils.getPlatformPrefix() + "ConfigImportSettings"); if (ConfigImportSettings.class.isAssignableFrom(customProviderClass)) { return ReflectionUtil.newInstance(customProviderClass); } } catch (ClassNotFoundException ignored) { } catch (RuntimeException ignored) { } return new ConfigImportSettings(); }
@Nullable public static Image loadFromResource(@NonNls @NotNull String s) { Class callerClass = ReflectionUtil.getGrandCallerClass(); if (callerClass == null) return null; return loadFromResource(s, callerClass); }