APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing

pack-priv abstract Class ActionPropertyChangeListener<T extends JComponent>

extends Object
implements PropertyChangeListener, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.beans.PropertyChangeListener, java.util.EventListener
Known Direct Subclasses
javax.swing.JComboBox.ComboBoxActionPropertyChangeListener, javax.swing.JTextField.TextFieldActionPropertyChangeListener, javax.swing.AbstractButton.ButtonActionPropertyChangeListener
Annotations
@SuppressWarnings:serial
Type Parameters
<T>
the type of JComponent the underlying Action is attached to
Imports
java.beans.PropertyChangeEvent, .PropertyChangeListener, java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serial, .Serializable, java.lang.ref.ReferenceQueue, .WeakReference

A package-private PropertyChangeListener which listens for property changes on an Action and updates the properties of an ActionEvent source.

Subclasses must override the actionPropertyChanged method, which is invoked from the propertyChange method as long as the target is still valid.

WARNING WARNING WARNING WARNING WARNING WARNING:
Do NOT create an anonymous inner class that extends this! If you do, a strong reference will be held to the containing class, which in most cases defeats the purpose of this class.

Author
Georges Saab
See Also
AbstractButton

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private Action
private static ReferenceQueue<JComponent>
private transient ActionPropertyChangeListener.OwnedWeakReference<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract void
actionPropertyChanged(T target, Action action, PropertyChangeEvent e)

Invoked when a property changes on the Action and the target still exists.

public Action
private static ReferenceQueue<JComponent>
public T
public final void
private void
private void
setTarget(T c)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

actionback to summary
private Action action
queueback to summary
private static ReferenceQueue<JComponent> queue
targetback to summary
private transient ActionPropertyChangeListener.OwnedWeakReference<T> target

Constructor Detail

ActionPropertyChangeListenerback to summary
public ActionPropertyChangeListener(T c, Action a)

Method Detail

actionPropertyChangedback to summary
protected abstract void actionPropertyChanged(T target, Action action, PropertyChangeEvent e)

Invoked when a property changes on the Action and the target still exists.

getActionback to summary
public Action getAction()
getQueueback to summary
private static ReferenceQueue<JComponent> getQueue()
getTargetback to summary
public T getTarget()
propertyChangeback to summary
public final void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

PropertyChangeListener method. If the target has been gc'ed this will remove the PropertyChangeListener from the Action, otherwise this will invoke actionPropertyChanged.

readObjectback to summary
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
Annotations
@Serial
@SuppressWarnings:unchecked
setTargetback to summary
private void setTarget(T c)
writeObjectback to summary
private void writeObject(ObjectOutputStream s) throws IOException
Annotations
@Serial
javax.swing back to summary

private Class ActionPropertyChangeListener.OwnedWeakReference<U extends JComponent>

extends WeakReference<U extends JComponent>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private ActionPropertyChangeListener<?>

Constructor Summary

AccessConstructor and Description
pack-priv
OwnedWeakReference(U target, ReferenceQueue<? super U> queue, ActionPropertyChangeListener<?> owner)

Method Summary

Modifier and TypeMethod and Description
public ActionPropertyChangeListener<?>

Field Detail

ownerback to summary
private ActionPropertyChangeListener<?> owner

Constructor Detail

OwnedWeakReferenceback to summary
pack-priv OwnedWeakReference(U target, ReferenceQueue<? super U> queue, ActionPropertyChangeListener<?> owner)

Method Detail

getOwnerback to summary
public ActionPropertyChangeListener<?> getOwner()