|
Last change
on this file was 14888, checked in by Don-vip, 7 years ago |
|
fix #17457 - Drop data depended tool tip from SelectedMembersForSelectionAction
|
|
File size:
1.6 KB
|
| Line | |
|---|
| 1 | // License: GPL. For details, see LICENSE file.
|
|---|
| 2 | package org.openstreetmap.josm.gui.dialogs.relation.actions;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 5 |
|
|---|
| 6 | import java.awt.event.ActionEvent;
|
|---|
| 7 |
|
|---|
| 8 | import org.openstreetmap.josm.tools.ImageProvider;
|
|---|
| 9 |
|
|---|
| 10 | /**
|
|---|
| 11 | * Selects members in the relation editor which refer to primitives in the current selection of the context layer.
|
|---|
| 12 | * @since 9496
|
|---|
| 13 | */
|
|---|
| 14 | public class SelectedMembersForSelectionAction extends AddFromSelectionAction {
|
|---|
| 15 | private static final long serialVersionUID = 1L;
|
|---|
| 16 |
|
|---|
| 17 | /**
|
|---|
| 18 | * Constructs a new {@code SelectedMembersForSelectionAction}.
|
|---|
| 19 | * @param editorAccess An interface to access the relation editor contents.
|
|---|
| 20 | */
|
|---|
| 21 | public SelectedMembersForSelectionAction(IRelationEditorActionAccess editorAccess) {
|
|---|
| 22 | super(editorAccess, IRelationEditorUpdateOn.SELECTION_TABLE_CHANGE, IRelationEditorUpdateOn.MEMBER_TABLE_CHANGE);
|
|---|
| 23 | putValue(SHORT_DESCRIPTION, tr("Select relation members which refer to objects in the current selection"));
|
|---|
| 24 | new ImageProvider("dialogs/relation", "selectmembers").getResource().attachImageIcon(this, true);
|
|---|
| 25 | updateEnabledState();
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | @Override
|
|---|
| 29 | protected void updateEnabledState() {
|
|---|
| 30 | boolean enabled = getSelectionTableModel().getRowCount() > 0
|
|---|
| 31 | && !editorAccess.getMemberTableModel().getChildPrimitives(getLayer().data.getSelected()).isEmpty();
|
|---|
| 32 | setEnabled(enabled);
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | @Override
|
|---|
| 36 | public void actionPerformed(ActionEvent e) {
|
|---|
| 37 | editorAccess.getMemberTableModel().selectMembersReferringTo(getLayer().data.getSelected());
|
|---|
| 38 | }
|
|---|
| 39 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.