public static class LayoutFactory.BasicPropertyAdaptSupport extends Object implements PropertyChangeListener
PropertyChangeListener
that adapts a
wrapped JComponent
to the following properties.
An instance will add itself as a
via
PropertyChangeListener
on the component to adapt to.
Component.addPropertyChangeListener(PropertyChangeListener)
However components should also be able to send property changes that make instances of this class garbage - collectable by removing them as a property change listener from them. The constructor given values mark those property changes that will cause instances of this class to remove themselves as a property change listener from the component listened to. These properties may be configured in glue code (as components are generic and should not be hard coded for tasks that are hooked to them).
Modifier and Type | Class and Description |
---|---|
static interface |
LayoutFactory.BasicPropertyAdaptSupport.IRemoveAsListenerFromComponentCondition
Interface to handle the removal of the
as a property change event
listener. |
static class |
LayoutFactory.BasicPropertyAdaptSupport.RemoveAsListenerFromComponentIfTraceIsDropped
Implementation based on the event
sent with an old
value that has to be matched. |
static class |
LayoutFactory.BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever
Implementation dummy that never will decide to remove the calling
to be removed. |
Modifier and Type | Field and Description |
---|---|
protected WeakReference<Component> |
m_delegate
The weak reference to the component to adapt properties on.
|
Constructor and Description |
---|
BasicPropertyAdaptSupport(Component delegate,
Component adaptee,
LayoutFactory.BasicPropertyAdaptSupport.IRemoveAsListenerFromComponentCondition quitListeningControl)
Creates an instance that will listen to basic properties
("font","foreground","background") on the given component and install
those on the delegate component.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Removes the listener for basic property changes from the component to
adapt to.
|
void |
propertyChange(PropertyChangeEvent evt) |
protected WeakReference<Component> m_delegate
public BasicPropertyAdaptSupport(Component delegate, Component adaptee, LayoutFactory.BasicPropertyAdaptSupport.IRemoveAsListenerFromComponentCondition quitListeningControl)
delegate
- The component to adapt the properties on.adaptee
- The peer component delegate will be adapted to.quitListeningControl
- Used to decide when to stop listening on the component
(adaptee).protected void finalize() throws Throwable
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
Copyright © 2001 - 2010 LGPL, All Rights Footloose.