Class AbstractRelationAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.relation.AbstractRelationAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,IPrimitiveAction
,Destroyable
- Direct Known Subclasses:
AddSelectionToRelations
,DeleteRelationsAction
,DownloadMembersAction
,DownloadRelationAction
,DownloadSelectedIncompleteMembersAction
,DuplicateRelationAction
,EditRelationAction
,SelectInRelationListAction
,SelectMembersAction
,SelectRelationAction
public abstract class AbstractRelationAction extends javax.swing.AbstractAction implements IPrimitiveAction, Destroyable
Ancestor for all actions that want to work with relation collection and to be disabled if the collection is empty- Since:
- 5793, 13957 (signature)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractRelationAction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canDownload()
protected boolean
canModify()
void
destroy()
Called when the object has been destroyed.protected static java.util.Collection<IRelation<?>>
getRelations(java.util.Collection<? extends IPrimitive> primitives)
Returns the relations contained in the given collection.protected void
setHelpId(java.lang.String helpId)
void
setPrimitives(java.util.Collection<? extends IPrimitive> primitives)
Specifies the working set of primitives.protected void
updateEnabledState()
Override in subclasses to update the enabled state of the action when something changes.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbstractRelationAction
public AbstractRelationAction()
-
-
Method Detail
-
getRelations
protected static final java.util.Collection<IRelation<?>> getRelations(java.util.Collection<? extends IPrimitive> primitives)
Returns the relations contained in the given collection.- Parameters:
primitives
- collection of primitives- Returns:
- the relation contained in
primitives
-
setPrimitives
public void setPrimitives(java.util.Collection<? extends IPrimitive> primitives)
Description copied from interface:IPrimitiveAction
Specifies the working set of primitives.- Specified by:
setPrimitives
in interfaceIPrimitiveAction
- Parameters:
primitives
- The new working set of primitives. Can be null or empty
-
updateEnabledState
protected void updateEnabledState()
Override in subclasses to update the enabled state of the action when something changes.
-
canModify
protected final boolean canModify()
-
canDownload
protected final boolean canDownload()
-
setHelpId
protected void setHelpId(java.lang.String helpId)
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
-
-