Package org.openstreetmap.josm.actions
Class ParameterizedActionDecorator
- java.lang.Object
-
- org.openstreetmap.josm.actions.ParameterizedActionDecorator
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.util.EventListener
,javax.swing.Action
public class ParameterizedActionDecorator extends java.lang.Object implements javax.swing.Action
Action wrapper that delegates to aParameterizedAction
object using a specific set of parameters.
-
-
Field Summary
Fields Modifier and Type Field Description private ParameterizedAction
action
private java.util.Map<java.lang.String,java.lang.Object>
parameters
-
Constructor Summary
Constructors Constructor Description ParameterizedActionDecorator(ParameterizedAction action, java.util.Map<java.lang.String,java.lang.Object> parameters)
Constructs a new ParameterizedActionDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
java.util.Map<java.lang.String,java.lang.Object>
getParameters()
Get the parameters used to invoke the wrapped action.java.lang.Object
getValue(java.lang.String key)
boolean
isEnabled()
void
putValue(java.lang.String key, java.lang.Object value)
void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
void
setEnabled(boolean b)
-
-
-
Field Detail
-
action
private final ParameterizedAction action
-
parameters
private final java.util.Map<java.lang.String,java.lang.Object> parameters
-
-
Constructor Detail
-
ParameterizedActionDecorator
public ParameterizedActionDecorator(ParameterizedAction action, java.util.Map<java.lang.String,java.lang.Object> parameters)
Constructs a new ParameterizedActionDecorator.- Parameters:
action
- the action that is invoked by this wrapperparameters
- parameters used for invoking the action
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfacejavax.swing.Action
-
getValue
public java.lang.Object getValue(java.lang.String key)
- Specified by:
getValue
in interfacejavax.swing.Action
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfacejavax.swing.Action
-
putValue
public void putValue(java.lang.String key, java.lang.Object value)
- Specified by:
putValue
in interfacejavax.swing.Action
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfacejavax.swing.Action
-
setEnabled
public void setEnabled(boolean b)
- Specified by:
setEnabled
in interfacejavax.swing.Action
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
getParameters
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
Get the parameters used to invoke the wrapped action.- Returns:
- the parameters used to invoke the wrapped action
-
-