public PlatformDependentToolsInstaller() {
//installing a component programmatically
ComponentConfig config = new ComponentConfig();
IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(((PluginClassLoader)getClass().getClassLoader()).getPluginId());
config.setInterfaceClass(PlatformDependentTools.class.getName());
if (SystemInfo.isLinux) {
config.setImplementationClass(LinuxSpecificTools.class.getName());
} else if (SystemInfo.isWindows) {
config.setImplementationClass(WindowsSpecificTools.class.getName());
} else if (SystemInfo.isMac) {
config.setImplementationClass(LinuxSpecificTools.class.getName()); // looks like, it works
} else {
throw new RuntimeException("I really am sorry, but your operating system is not known to mankind."); // ;)
}
((ComponentManagerEx) ApplicationManager.getApplication()).registerComponent(config, ideaPluginDescriptor);