Class AbstractRelationAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.relation.AbstractRelationAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,IPrimitiveAction,Destroyable
- Direct Known Subclasses:
AddSelectionToRelations,DeleteRelationsAction,DownloadMembersAction,DownloadRelationAction,DownloadSelectedIncompleteMembersAction,DuplicateRelationAction,EditRelationAction,SelectInRelationListAction,SelectMembersAction,SelectRelationAction
public abstract class AbstractRelationAction
extends 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:
-
Field Summary
FieldsFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanprotected final booleanvoiddestroy()Called when the object has been destroyed.protected static final Collection<IRelation<?>>getRelations(Collection<? extends IPrimitive> primitives) Returns the relations contained in the given collection.protected voidvoidsetPrimitives(Collection<? extends IPrimitive> primitives) Specifies the working set of primitives.protected voidOverride 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, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Field Details
-
relations
relation collection
-
-
Constructor Details
-
AbstractRelationAction
public AbstractRelationAction()
-
-
Method Details
-
getRelations
protected static final Collection<IRelation<?>> getRelations(Collection<? extends IPrimitive> primitives) Returns the relations contained in the given collection.- Parameters:
primitives- collection of primitives- Returns:
- the relation contained in
primitives
-
setPrimitives
Description copied from interface:IPrimitiveActionSpecifies the working set of primitives.- Specified by:
setPrimitivesin interfaceIPrimitiveAction- Parameters:
primitives- The new working set of primitives. Can be null or empty
-
updateEnabledState
Override in subclasses to update the enabled state of the action when something changes. -
canModify
-
canDownload
-
setHelpId
-
destroy
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable
-