Last change
on this file since 9827 was 9692, checked in by simon04, 8 years ago |
fix #12453 - Add icon for "discourage upload" (icon by Klumbumbus)
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import java.awt.event.ActionEvent;
|
---|
7 |
|
---|
8 | import javax.swing.AbstractAction;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
|
---|
11 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
12 | import org.openstreetmap.josm.tools.ImageProvider;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * An action enabling/disabling the {@linkplain OsmDataLayer#setUploadDiscouraged(boolean) discouraged upload flag}
|
---|
16 | * of the layer specified in the constructor.
|
---|
17 | */
|
---|
18 | public class ToggleUploadDiscouragedLayerAction extends AbstractAction {
|
---|
19 |
|
---|
20 | private final transient OsmDataLayer layer;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Constructs a new {@code ToggleUploadDiscouragedLayerAction}.
|
---|
24 | * @param layer the layer for which to toggle the {@linkplain OsmDataLayer#setUploadDiscouraged(boolean) discouraged upload flag}
|
---|
25 | */
|
---|
26 | public ToggleUploadDiscouragedLayerAction(OsmDataLayer layer) {
|
---|
27 | super(tr("Encourage/discourage upload"), ImageProvider.get("no_upload"));
|
---|
28 | this.layer = layer;
|
---|
29 | }
|
---|
30 |
|
---|
31 | @Override
|
---|
32 | public void actionPerformed(ActionEvent e) {
|
---|
33 | layer.setUploadDiscouraged(!layer.isUploadDiscouraged());
|
---|
34 | LayerListDialog.getInstance().repaint();
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.