Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 |
|
---|
7 | import java.awt.event.KeyEvent;
|
---|
8 | import java.util.Collection;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * This action synchronizes a set of primitives with their state on the server.
|
---|
15 | *
|
---|
16 | */
|
---|
17 | public class UpdateModifiedAction extends UpdateSelectionAction {
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * constructor
|
---|
21 | */
|
---|
22 | public UpdateModifiedAction() {
|
---|
23 | super(tr("Update modified"),
|
---|
24 | "updatemodified",
|
---|
25 | tr("Updates the currently modified objects from the server (re-downloads data)"),
|
---|
26 | Shortcut.registerShortcut("file:updatemodified",
|
---|
27 | tr("Update modified"),
|
---|
28 | KeyEvent.VK_M,
|
---|
29 | Shortcut.GROUP_HOTKEY + Shortcut.GROUPS_ALT2),
|
---|
30 | true);
|
---|
31 | putValue("help", ht("/Action/UpdateModified"));
|
---|
32 | }
|
---|
33 |
|
---|
34 | @Override
|
---|
35 | protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
|
---|
36 | super.updateEnabledState(getData());
|
---|
37 | }
|
---|
38 |
|
---|
39 | @Override
|
---|
40 | protected Collection<OsmPrimitive> getData() {
|
---|
41 | return getCurrentDataSet().allModifiedPrimitives();
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.