()
| 88 | |
| 89 | |
| 90 | static public void init() { |
| 91 | try { |
| 92 | // Start with DefaultPlatform, but try to upgrade to a known platform |
| 93 | final String packageName = DefaultPlatform.class.getPackageName(); |
| 94 | Class<?> platformClass = |
| 95 | Class.forName(packageName + ".DefaultPlatform"); |
| 96 | |
| 97 | if (Platform.isMacOS()) { |
| 98 | platformClass = Class.forName(packageName + ".MacPlatform"); |
| 99 | } else if (Platform.isWindows()) { |
| 100 | platformClass = Class.forName(packageName + ".WindowsPlatform"); |
| 101 | } else if (Platform.isLinux()) { |
| 102 | platformClass = Class.forName(packageName + ".LinuxPlatform"); |
| 103 | } |
| 104 | inst = (DefaultPlatform) platformClass.getDeclaredConstructor().newInstance(); |
| 105 | |
| 106 | } catch (Exception e) { |
| 107 | Messages.showError("Problem Setting the Platform", |
| 108 | "An unknown error occurred while trying to load\n" + |
| 109 | "platform-specific code for your machine.", e); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | |
| 114 | static public void initBase(Base base) throws Exception { |
no test coverage detected