Last change
on this file since 10605 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
|
Rev | Line | |
---|
[7937] | 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 |
|
---|
[9692] | 8 | import javax.swing.AbstractAction;
|
---|
| 9 |
|
---|
[7937] | 10 | import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
|
---|
| 11 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
[9692] | 12 | import org.openstreetmap.josm.tools.ImageProvider;
|
---|
[7937] | 13 |
|
---|
[9692] | 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 {
|
---|
[7937] | 19 |
|
---|
[9067] | 20 | private final transient OsmDataLayer layer;
|
---|
[8308] | 21 |
|
---|
[9692] | 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 | */
|
---|
[7937] | 26 | public ToggleUploadDiscouragedLayerAction(OsmDataLayer layer) {
|
---|
[9692] | 27 | super(tr("Encourage/discourage upload"), ImageProvider.get("no_upload"));
|
---|
[7937] | 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.