Package io.guise.framework.prototype
Class ProxyActionPrototype
- java.lang.Object
-
- com.globalmentor.beans.BoundPropertyObject
-
- io.guise.framework.model.AbstractModel
-
- io.guise.framework.prototype.AbstractProxyPrototype<P>
-
- io.guise.framework.prototype.AbstractEnableableProxyPrototype<ActionPrototype>
-
- io.guise.framework.prototype.ProxyActionPrototype
-
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,ActionListenable
,ActionModel
,Enableable
,InfoModel
,LabelModel
,Model
,ActionPrototype
,Prototype
public class ProxyActionPrototype extends AbstractEnableableProxyPrototype<ActionPrototype> implements ActionPrototype
An action prototype that is a proxy for another action prototype.- Author:
- Garret Wilson
-
-
Field Summary
-
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Fields inherited from interface io.guise.framework.model.Enableable
ENABLED_PROPERTY
-
Fields inherited from interface io.guise.framework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
-
Fields inherited from interface io.guise.framework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ProxyActionPrototype(ActionPrototype proxiedPrototype)
Proxied prototype constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionListener(ActionListener actionListener)
Adds an action listener.protected void
fireActionPerformed(int force, int option)
Fires an action event to all registered action listeners.protected void
fireActionPerformed(ActionEvent actionEvent)
Fires a given action event to all registered action listeners.java.lang.Iterable<ActionListener>
getActionListeners()
protected ActionListener
getRepeatActionListener()
protected void
installListeners(ActionPrototype newProxiedPrototype)
Installs listeners to a proxied prototype.void
performAction()
Performs the action with default force and default option.void
performAction(int force, int option)
Performs the action with the given force and option.void
removeActionListener(ActionListener actionListener)
Removes an action listener.protected void
uninstallListeners(ActionPrototype oldProxiedPrototype)
Uninstalls listeners from a proxied prototype.-
Methods inherited from class io.guise.framework.prototype.AbstractEnableableProxyPrototype
fireProxiedPrototypeBoundPropertyChanges, isEnabled, setEnabled
-
Methods inherited from class io.guise.framework.prototype.AbstractProxyPrototype
getDescription, getDescriptionContentType, getGlyphURI, getInfo, getInfoContentType, getLabel, getLabelContentType, getProxiedPrototype, setDescription, setDescriptionContentType, setGlyphURI, setInfo, setInfoContentType, setLabel, setLabelContentType, setProxiedPrototype
-
Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
-
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.guise.framework.model.Enableable
isEnabled, setEnabled
-
Methods inherited from interface io.guise.framework.model.InfoModel
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType
-
Methods inherited from interface io.guise.framework.model.LabelModel
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType
-
-
-
-
Constructor Detail
-
ProxyActionPrototype
public ProxyActionPrototype(ActionPrototype proxiedPrototype)
Proxied prototype constructor.- Parameters:
proxiedPrototype
- The prototype proxied by this prototype.- Throws:
java.lang.NullPointerException
- if the given proxied prototype isnull
isnull
.
-
-
Method Detail
-
getRepeatActionListener
protected ActionListener getRepeatActionListener()
- Returns:
- An action listener to repeat copies of events received, using this object as the source.
-
uninstallListeners
protected void uninstallListeners(ActionPrototype oldProxiedPrototype)
Description copied from class:AbstractProxyPrototype
Uninstalls listeners from a proxied prototype.- Overrides:
uninstallListeners
in classAbstractProxyPrototype<ActionPrototype>
- Parameters:
oldProxiedPrototype
- The old proxied prototype.
-
installListeners
protected void installListeners(ActionPrototype newProxiedPrototype)
Description copied from class:AbstractProxyPrototype
Installs listeners to a proxied prototype.- Overrides:
installListeners
in classAbstractProxyPrototype<ActionPrototype>
- Parameters:
newProxiedPrototype
- The new proxied prototype.
-
addActionListener
public void addActionListener(ActionListener actionListener)
Description copied from interface:ActionListenable
Adds an action listener.- Specified by:
addActionListener
in interfaceActionListenable
- Parameters:
actionListener
- The action listener to add.
-
removeActionListener
public void removeActionListener(ActionListener actionListener)
Description copied from interface:ActionListenable
Removes an action listener.- Specified by:
removeActionListener
in interfaceActionListenable
- Parameters:
actionListener
- The action listener to remove.
-
getActionListeners
public java.lang.Iterable<ActionListener> getActionListeners()
- Specified by:
getActionListeners
in interfaceActionModel
- Returns:
- all registered action listeners.
-
performAction
public void performAction()
Performs the action with default force and default option. AnActionEvent
is fired to all registeredActionListener
s. This method delegates toperformAction(int, int)
.- Specified by:
performAction
in interfaceActionModel
-
performAction
public void performAction(int force, int option)
Performs the action with the given force and option. AnActionEvent
is fired to all registeredActionListener
s.This implementation calls
ActionModel.performAction(int, int)
on the proxied prototype to perform the actual action. AnActionEvent
is not fired to registeredActionListener
s; the proxied action prototype should fire such an event, which we will them repeat.- Specified by:
performAction
in interfaceActionModel
- Parameters:
force
- The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.option
- The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiated by a mouse right button click.
-
fireActionPerformed
protected void fireActionPerformed(int force, int option)
Fires an action event to all registered action listeners. This method delegates tofireActionPerformed(ActionEvent)
.- Parameters:
force
- The zero-based force, such as 0 for no force or 1 for an action initiated by from a mouse single click.option
- The zero-based option, such as 0 for an event initiated by a mouse left button click or 1 for an event initiaged by a mouse right button click.- See Also:
ActionListener
,ActionEvent
-
fireActionPerformed
protected void fireActionPerformed(ActionEvent actionEvent)
Fires a given action event to all registered action listeners.- Parameters:
actionEvent
- The action event to fire.
-
-