junit.extensions.awt
Class DefaultComponentManager

java.lang.Object
  |
  +--junit.extensions.awt.DefaultComponentFinder
        |
        +--junit.extensions.awt.DefaultComponentManager
All Implemented Interfaces:
ComponentFinder, ComponentManager, Resolver

public class DefaultComponentManager
extends DefaultComponentFinder
implements ComponentManager

Default implementation of a component manager.


Constructor Summary
DefaultComponentManager()
           
 
Method Summary
 ComponentReference addComponent(java.awt.Component comp)
          Add a new component to the existing collection.
 void disposeWindows()
           
protected  void disposeWindows(java.awt.Window[] windows)
          Dispose of all windows, making sure they're ignored in the future.
 ComponentReference getComponentReference(java.awt.Component c)
          Return the existing reference for the given component, or null if none exists.
 ComponentReference getComponentReference(java.lang.String refid)
          Convert the reference ID into a component reference.
 java.util.Collection getComponentReferences()
          Returns a collection of all the existing references.
 java.lang.String getUniqueID(ComponentReference ref)
          Derive a unique identifier for the given reference.
 void setResolver(Resolver resolver)
           
 
Methods inherited from class junit.extensions.awt.DefaultComponentFinder
componentsMatch, discardComponent, filterComponent, findActivePopupMenu, findComponent, findDescendent, findMenuItemByName, findWindow, getComponentFrame, getComponentFrameTitle, getComponentParent, getComponents, getComponentWindow, getEventQueue, getFrames, getTestedClass, getTester, getTester, getTester, getWindows, getWindows, isFiltered, setFilterEnabled
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface junit.extensions.awt.ComponentFinder
componentsMatch, discardComponent, filterComponent, findActivePopupMenu, findComponent, findMenuItemByName, findWindow, getComponentFrame, getComponentFrameTitle, getComponentParent, getComponents, getComponentWindow, getEventQueue, getFrames, getTestedClass, getTester, getTester, getTester, getWindows, getWindows, isFiltered, setFilterEnabled
 

Constructor Detail

DefaultComponentManager

public DefaultComponentManager()
Method Detail

setResolver

public void setResolver(Resolver resolver)
Specified by:
setResolver in interface ComponentManager

getComponentReference

public ComponentReference getComponentReference(java.lang.String refid)
                                         throws ComponentNotFoundException
Description copied from interface: Resolver
Convert the reference ID into a component reference.
Specified by:
getComponentReference in interface Resolver

getComponentReference

public ComponentReference getComponentReference(java.awt.Component c)
Description copied from interface: Resolver
Return the existing reference for the given component, or null if none exists.
Specified by:
getComponentReference in interface Resolver

addComponent

public ComponentReference addComponent(java.awt.Component comp)
Description copied from interface: Resolver
Add a new component to the existing collection.
Specified by:
addComponent in interface Resolver

getUniqueID

public java.lang.String getUniqueID(ComponentReference ref)
Description copied from interface: Resolver
Derive a unique identifier for the given reference.
Specified by:
getUniqueID in interface Resolver

getComponentReferences

public java.util.Collection getComponentReferences()
Description copied from interface: Resolver
Returns a collection of all the existing references.
Specified by:
getComponentReferences in interface Resolver

disposeWindows

public void disposeWindows()
Specified by:
disposeWindows in interface ComponentManager

disposeWindows

protected void disposeWindows(java.awt.Window[] windows)
Dispose of all windows, making sure they're ignored in the future.