Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.dialogs.relation.actions;
|
---|
3 |
|
---|
4 | import java.awt.event.ActionEvent;
|
---|
5 | import java.util.Collection;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.data.osm.RelationMember;
|
---|
8 | import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
|
---|
9 | import org.openstreetmap.josm.gui.datatransfer.RelationMemberTransferable;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * Copy members.
|
---|
13 | * @since 9496
|
---|
14 | */
|
---|
15 | public class CopyMembersAction extends AddFromSelectionAction {
|
---|
16 | private static final long serialVersionUID = 1L;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Constructs a new {@code CopyMembersAction}.
|
---|
20 | * @param editorAccess An interface to access the relation editor contents.
|
---|
21 | */
|
---|
22 | public CopyMembersAction(IRelationEditorActionAccess editorAccess) {
|
---|
23 | super(editorAccess);
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Override
|
---|
27 | public void actionPerformed(ActionEvent e) {
|
---|
28 | final Collection<RelationMember> members = getMemberTableModel().getSelectedMembers();
|
---|
29 |
|
---|
30 | if (!members.isEmpty()) {
|
---|
31 | ClipboardUtils.copy(new RelationMemberTransferable(members));
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | @Override
|
---|
36 | protected void updateEnabledState() {
|
---|
37 | // Do nothing
|
---|
38 | }
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.