org.eclipse.actf.accservice.javapp.adapt
Class SwtAccessibilityAdaptor

java.lang.Object
  extended by org.eclipse.actf.accservice.adapt.AccessibilityAdaptor
      extended by org.eclipse.actf.accservice.javapp.adapt.SwtAccessibilityAdaptor
All Implemented Interfaces:
IAdaptor

public class SwtAccessibilityAdaptor
extends AccessibilityAdaptor

adaptor implementation for converting nodes in an Eclipse SWT control hierarchy to instances of IAccessibleElement.

Author:
Mike Squillace

Field Summary
protected static ClassLoaderCache CL_CACHE
           
protected static String CTRL_TYPE_NAME
           
 
Constructor Summary
SwtAccessibilityAdaptor()
           
 
Method Summary
 Object adapt(Object o, Class type)
          adapts the object to the given type.
 
Methods inherited from class org.eclipse.actf.accservice.adapt.AccessibilityAdaptor
createAccessibleElement, getSupportedTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CL_CACHE

protected static final ClassLoaderCache CL_CACHE

CTRL_TYPE_NAME

protected static final String CTRL_TYPE_NAME
See Also:
Constant Field Values
Constructor Detail

SwtAccessibilityAdaptor

public SwtAccessibilityAdaptor()
Method Detail

adapt

public Object adapt(Object o,
                    Class type)
             throws Exception
adapts the object to the given type. This method is responsible for casting or transforming or somehow producing an object of the specified type that represents a set of properties of or directly corresponds to the specified object. The type to which the object is to be adapted should be one of those returned by getSupportedTypes.

All attempts should be made to insure that this method is symmetric. That is, if object o is of type B, then:

 adapt(adapt(o, A.class), B.class) = o
 

Also note that both types A and B should be returned by getSupportedTypes.

Parameters:
o - - object to be adapted
type - - the type to which the object is to be adapted
Returns:
an instance of the specified type or null if the object could not be adapted to the given type
Throws:
Exception
See Also:
IAdaptor.getSupportedTypes()