edu.rice.cs.drjava.ui.avail
Class AndGUIAvailabilityListener

java.lang.Object
  extended by edu.rice.cs.drjava.ui.avail.AndGUIAvailabilityListener
All Implemented Interfaces:
GUIAvailabilityListener
Direct Known Subclasses:
AndGUIAvailabilityActionAdapter, AndGUIAvailabilityComponentAdapter

public abstract class AndGUIAvailabilityListener
extends Object
implements GUIAvailabilityListener

Listener responding to the availability of several GUI components.

Version:
$Id: AndGUIAvailabilityListener.java 5355 2010-08-11 21:20:32Z mgricken $

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.rice.cs.drjava.ui.avail.GUIAvailabilityListener
GUIAvailabilityListener.ComponentType
 
Field Summary
protected  HashSet<GUIAvailabilityListener.ComponentType> _components
           
protected  boolean _lastValue
           
protected  GUIAvailabilityNotifier _notifier
           
 
Constructor Summary
AndGUIAvailabilityListener(GUIAvailabilityNotifier notifier, GUIAvailabilityListener.ComponentType... components)
          Create a listener that responds to changes in availability of several GUI components.
 
Method Summary
abstract  void availabilityChanged(boolean available)
          Called when the combined availability of all components changes.
 void availabilityChanged(GUIAvailabilityListener.ComponentType component, boolean available)
          Called when a component's availability changes.
 boolean isAvailable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_components

protected final HashSet<GUIAvailabilityListener.ComponentType> _components

_notifier

protected final GUIAvailabilityNotifier _notifier

_lastValue

protected volatile boolean _lastValue
Constructor Detail

AndGUIAvailabilityListener

public AndGUIAvailabilityListener(GUIAvailabilityNotifier notifier,
                                  GUIAvailabilityListener.ComponentType... components)
Create a listener that responds to changes in availability of several GUI components.

Parameters:
components - components that must be available
Method Detail

isAvailable

public boolean isAvailable()
Returns:
true if all required components are available

availabilityChanged

public void availabilityChanged(GUIAvailabilityListener.ComponentType component,
                                boolean available)
Called when a component's availability changes.

Specified by:
availabilityChanged in interface GUIAvailabilityListener
Parameters:
component - the component whose availability changed
available - true if component is available

availabilityChanged

public abstract void availabilityChanged(boolean available)
Called when the combined availability of all components changes.

Parameters:
available - true if all components are available