Class AbstractCopyAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.properties.AbstractCopyAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
CopyAllKeyValueAction
,CopyKeyValueAction
,CopyValueAction
public abstract class AbstractCopyAction extends AbstractAction
Super class of all copy actions from tag table.- Since:
- 13521
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private IntFunction<String>
keySupplier
private Supplier<Collection<? extends Tagged>>
objectSupplier
private JTable
tagTable
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCopyAction(JTable tagTable, IntFunction<String> keySupplier, Supplier<Collection<? extends Tagged>> objectSupplier)
Constructs a newAbstractCopyAction
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent ae)
protected abstract Collection<String>
getString(Tagged p, String key)
protected Stream<String>
valueStream()
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
keySupplier
private final IntFunction<String> keySupplier
-
objectSupplier
private final Supplier<Collection<? extends Tagged>> objectSupplier
-
-
Constructor Detail
-
AbstractCopyAction
protected AbstractCopyAction(JTable tagTable, IntFunction<String> keySupplier, Supplier<Collection<? extends Tagged>> objectSupplier)
Constructs a newAbstractCopyAction
.- Parameters:
tagTable
- the tag tablekeySupplier
- a supplier which returns the selected key for a given row indexobjectSupplier
- a supplier which returns the selected tagged object(s)
-
-
Method Detail
-
getString
protected abstract Collection<String> getString(Tagged p, String key)
-
valueStream
protected Stream<String> valueStream()
-
actionPerformed
public void actionPerformed(ActionEvent ae)
-
-