source: subversion/applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGuiPlugin.java

Last change on this file was 34382, checked in by donvip, 10 months ago

checkstyle: fix license header

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.plugins.DirectUpload;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.KeyEvent;
8
9import org.openstreetmap.josm.actions.JosmAction;
10import org.openstreetmap.josm.gui.MainApplication;
11import org.openstreetmap.josm.gui.MainMenu;
12import org.openstreetmap.josm.plugins.Plugin;
13import org.openstreetmap.josm.plugins.PluginInformation;
14import org.openstreetmap.josm.tools.Shortcut;
15
16/**
17 *
18 * @author subhodip, ax
19 */
20public class UploadDataGuiPlugin extends Plugin {
21   
22    UploadAction openaction;
23
24    public UploadDataGuiPlugin(PluginInformation info) {
25        super(info);
26        openaction = new UploadAction();
27        MainMenu.add(MainApplication.getMenu().gpsMenu, openaction);
28    }
29
30    static class UploadAction extends JosmAction {
31       
32        public UploadAction(){
33            super(tr("Upload Traces"), "UploadAction", tr("Uploads traces to openstreetmap.org"),
34                Shortcut.registerShortcut("tools:uploadtraces", tr("Tool: {0}", tr("Upload Traces")),
35                KeyEvent.VK_G, Shortcut.CTRL), false);
36        }
37       
38        @Override
39        public void actionPerformed(ActionEvent e) {
40            UploadDataGui go = new UploadDataGui();
41            go.setVisible(true);
42        }
43
44        // because LayerListDialog doesn't provide a way to hook into "layer selection changed"
45        // but the layer selection (*not* activation) is how we determine the layer to be uploaded
46        // we have to let the upload trace menu always be enabled
47//        @Override
48//        protected void updateEnabledState() {
49//            // enable button if ... @see autoSelectTrace()
50//            if (UploadOsmConnection.getInstance().autoSelectTrace() == null) {
51//                setEnabled(false);
52//            } else {
53//                setEnabled(true);
54//            }
55//        }
56    }
57}
Note: See TracBrowser for help on using the repository browser.