use of jack.rm.plugins.types.RomDownloaderPlugin in project rom-manager by Jakz.
the class InfoPanel method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if (src == downloadButton) {
try {
MyGameSetFeatures helper = set.helper();
Set<RomDownloaderPlugin> downloaders = helper.settings().plugins.getEnabledPlugins(PluginRealType.ROM_DOWNLOADER);
URL url = downloaders.stream().filter(p -> p.isPlatformSupported(set.platform())).findFirst().get().getDownloadURL(set.platform(), game);
Desktop.getDesktop().browse(url.toURI());
} catch (Exception ee) {
ee.printStackTrace();
}
} else if (src == openFolderButton) {
Main.openFolder(game.rom().handle().path().getParent().toFile());
// TODO: Main.openFolder(rom.getHandle().path().getParent().toFile());
} else if (src == openArchiveButton) {
// TODO: Main.openFolder(rom.getHandle().path().toFile());
} else if (src == assetsButton) {
if (game != null)
Main.downloader.downloadArt(game);
}
}
Aggregations