コード例 #1
0
 @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();
 }
コード例 #2
0
 @Nullable
 public static Image loadFromResource(@NonNls @NotNull String s) {
   Class callerClass = ReflectionUtil.getGrandCallerClass();
   if (callerClass == null) return null;
   return loadFromResource(s, callerClass);
 }