source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/ApplyAction.java@ 14029

Last change on this file since 14029 was 14029, checked in by michael2402, 6 years ago

See #16388: Checkstyle: Convert tabs to spaces.

File size: 1.3 KB
RevLine 
[9665]1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs.relation.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7
8import org.openstreetmap.josm.tools.ImageProvider;
9
10/**
11 * Apply the current updates.
12 * @since 9496
13 */
[14027]14public class ApplyAction extends SavingAction {
[14029]15 private static final long serialVersionUID = 1L;
[9665]16
17 /**
18 * Constructs a new {@code ApplyAction}.
19 * @param memberTable member table
20 * @param memberTableModel member table model
21 * @param layer OSM data layer
22 * @param editor relation editor
23 * @param tagModel tag editor model
24 */
[14027]25 public ApplyAction(IRelationEditorActionAccess editorAccess) {
26 super(editorAccess, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE, IRelationEditorUpdateOn.TAG_CHANGE);
[9665]27 putValue(SHORT_DESCRIPTION, tr("Apply the current updates"));
[13130]28 new ImageProvider("save").getResource().attachImageIcon(this, true);
[9665]29 putValue(NAME, tr("Apply"));
[14027]30 updateEnabledState();
[9665]31 }
32
33 @Override
34 public void actionPerformed(ActionEvent e) {
35 if (applyChanges()) {
[14029]36 editorAccess.getEditor().reloadDataFromRelation();
[9665]37 }
38 }
39
40 @Override
41 protected void updateEnabledState() {
42 setEnabled(isEditorDirty());
43 }
44}
Note: See TracBrowser for help on using the repository browser.