Class DuplicateRelationAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.relation.AbstractRelationAction
-
- org.openstreetmap.josm.actions.relation.DuplicateRelationAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,IPrimitiveAction,Destroyable
public class DuplicateRelationAction extends AbstractRelationAction
Creates a new relation with a copy of the current editor state- Since:
- 5799
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.actions.relation.AbstractRelationAction
relations
-
-
Constructor Summary
Constructors Constructor Description DuplicateRelationAction()Constructs a newDuplicateRelationAction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)private static booleanconfirmRelationDuplicate(Relation relation)static voidduplicateRelationAndLaunchEditor(Relation original)Duplicates the given relation and launches the relation editor for the created copy.private static booleanisEditableRelation(IRelation<?> r)protected voidupdateEnabledState()Override in subclasses to update the enabled state of the action when something changes.-
Methods inherited from class org.openstreetmap.josm.actions.relation.AbstractRelationAction
canDownload, canModify, destroy, getRelations, setHelpId, setPrimitives
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
DuplicateRelationAction
public DuplicateRelationAction()
Constructs a newDuplicateRelationAction.
-
-
Method Detail
-
duplicateRelationAndLaunchEditor
public static void duplicateRelationAndLaunchEditor(Relation original)
Duplicates the given relation and launches the relation editor for the created copy.- Parameters:
original- The relation to duplicate
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
isEditableRelation
private static boolean isEditableRelation(IRelation<?> r)
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:AbstractRelationActionOverride in subclasses to update the enabled state of the action when something changes.- Overrides:
updateEnabledStatein classAbstractRelationAction
-
confirmRelationDuplicate
private static boolean confirmRelationDuplicate(Relation relation)
-
-