source: osm/applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/actions/DownloadDataAction.java

Last change on this file was 36173, checked in by taylor.smock, 7 months ago

See #23218: Use newer error_prone versions when compiling on java 11+

This should allow us to compile all plugins with Java 21 (specifically OpenData).

OpenData has some additional changes, since some of the new error_prone checks
blocked compilation.

File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins.opendata.core.actions;
3
4import java.awt.event.ActionEvent;
5import java.net.URL;
6import java.util.Locale;
7
8import javax.swing.Action;
9
10import org.openstreetmap.josm.actions.JosmAction;
11import org.openstreetmap.josm.gui.MainApplication;
12import org.openstreetmap.josm.plugins.opendata.core.modules.Module;
13import org.openstreetmap.josm.tools.CheckParameterUtil;
14
15public class DownloadDataAction extends JosmAction {
16
17 private final URL url;
18
19 public DownloadDataAction(Module module, String name, URL url) {
20 super(false);
21 CheckParameterUtil.ensureParameterNotNull(name, "name");
22 CheckParameterUtil.ensureParameterNotNull(url, "url");
23 putValue(Action.NAME, name);
24 putValue("toolbar", ("opendata_download_"+module.getDisplayedName()+"_"+name).toLowerCase(Locale.ROOT).replace(" ", "_"));
25 this.url = url;
26 }
27
28 @Override
29 public void actionPerformed(ActionEvent e) {
30 MainApplication.getMenu().openLocation.openUrl(true, url.toString());
31 }
32}
Note: See TracBrowser for help on using the repository browser.