com.samskivert.swing
Class EnablingAdapter

java.lang.Object
  extended by com.samskivert.swing.EnablingAdapter
Direct Known Subclasses:
EnablingAdapter.PropertyChangeEnabler

public class EnablingAdapter
extends Object

Used to enable or disable a source component based on some asynchronously changing state.


Nested Class Summary
protected static class EnablingAdapter.PropertyChangeEnabler
          Used by getPropChangeEnabler(java.lang.String, javax.swing.JComponent, boolean).
 
Field Summary
protected  boolean _invert
           
protected  JComponent _target
           
 
Constructor Summary
protected EnablingAdapter(JComponent target, boolean invert)
          Creates an enabling adapter with the specified target component.
 
Method Summary
static PropertyChangeListener getPropChangeEnabler(String property, JComponent target, boolean invert)
          Creates and returns an enabler that listens for changes in the specified property (which must be a Boolean valued property) and updates the target's enabled state accordingly.
protected  void stateChanged(boolean newState)
          Called by the appropriate derived adapter to adjust the target's enabled state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_target

protected JComponent _target

_invert

protected boolean _invert
Constructor Detail

EnablingAdapter

protected EnablingAdapter(JComponent target,
                          boolean invert)
Creates an enabling adapter with the specified target component.

Parameters:
invert - if true, the target component's enabled state is set to the inverse of the monitored state.
Method Detail

getPropChangeEnabler

public static PropertyChangeListener getPropChangeEnabler(String property,
                                                          JComponent target,
                                                          boolean invert)
Creates and returns an enabler that listens for changes in the specified property (which must be a Boolean valued property) and updates the target's enabled state accordingly.


stateChanged

protected void stateChanged(boolean newState)
Called by the appropriate derived adapter to adjust the target's enabled state.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.