org.eclipse.actf.accservice.core.win32.msaa
Class MsaaGuiModel

java.lang.Object
  extended by org.eclipse.actf.model.AbstractModel
      extended by org.eclipse.actf.model.AbstractGuiModel
          extended by org.eclipse.actf.accservice.core.win32.msaa.MsaaGuiModel
All Implemented Interfaces:
IGuiModel, IModel
Direct Known Subclasses:
IA2GuiModel

public class MsaaGuiModel
extends AbstractGuiModel

a model implementation for a hierarchy of IAccessible components used by the Microsoft Active Accessibility (MSAA) model

Author:
IAccessible interface

Field Summary
static int CONTEXT_FLAG
           
static String MSAA_MODEL
           
 
Fields inherited from class org.eclipse.actf.model.AbstractGuiModel
eventIdMap
 
Fields inherited from class org.eclipse.actf.model.AbstractModel
baseType, configuration, locator, runtimeContext, treeNodeWalker
 
Constructor Summary
  MsaaGuiModel()
          create a new MsaaModel
protected MsaaGuiModel(String extendedAttrib)
           
 
Method Summary
 void asyncInvokeOnUIThread(Runnable runnable)
          will be invoked on the current thread
protected  Class getAccessibilityEventServiceType()
           
protected  Class getAccessibleElementType()
           
 ModelEventType[] getModelEventTypes(Class sourceType)
          get the model event types for the given source type.
 INodeLocator getNodeLocator()
          retrieves a locator for finding and identifying nodes in the model.
 String getNodeName(Object element)
          return the short name of this element. The id for an element is model-specific. For example, it may be the tag name of an element of a model representing a structure that conforms to W3the C DOM specification or the simple class name of the object. returns the qualified class name (i.e. without the package name) of the given element returns the accessibleRole of this element if it is of type MsaaAccessible
protected  void initEventIdMap()
           
protected  void initEventIdMap(Class accType, Class serviceClass, String fieldPrefix)
           
 void invokeOnUIThread(Runnable runnable)
          will be invoked on the current thread
 boolean isTopDown()
           
 boolean isUIThread()
          returns whether or not the currently executing thread is the UI thread.
 boolean isValid(Object comp)
          returns whether or not the specified component is valid for access. Components may be invalid because their underlying resources have been disposed, because the device that displays or renders them is destroyed, or for many other reasons. This default implementation merely checks that the component is not null.
 boolean isVisible(Object comp)
          returns whether or not the specified component is currently visible
 void registerModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
          register a listener to receive notification when events with the given eventTypes are fired within this model.
 boolean requestFocusFor(Object comp)
          request the focus for the specified component. This method should be invoked, for example, just prior to validation for a report that reflects the state of the component while visible.
 void unregisterModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes)
          unregister a previously registered listener.
 
Methods inherited from class org.eclipse.actf.model.AbstractGuiModel
getBoundingRectangle, getModelEventType, highlight
 
Methods inherited from class org.eclipse.actf.model.AbstractModel
addModelChangeListener, fireModelChangeEvent, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getOrder, getPackageNames, getTreeWalker, removeModelChangeListener, setFilters, setModelType, setNodeID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.actf.model.IModel
addModelChangeListener, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getOrder, getPackageNames, getTreeWalker, removeModelChangeListener, setNodeID
 

Field Detail

MSAA_MODEL

public static final String MSAA_MODEL
See Also:
Constant Field Values

CONTEXT_FLAG

public static final int CONTEXT_FLAG
See Also:
Constant Field Values
Constructor Detail

MsaaGuiModel

public MsaaGuiModel()
create a new MsaaModel


MsaaGuiModel

protected MsaaGuiModel(String extendedAttrib)
Method Detail

getNodeName

public String getNodeName(Object element)
return the short name of this element. The id for an element is model-specific. For example, it may be the tag name of an element of a model representing a structure that conforms to W3the C DOM specification or the simple class name of the object. returns the qualified class name (i.e. without the package name) of the given element returns the accessibleRole of this element if it is of type MsaaAccessible

Specified by:
getNodeName in interface IModel
Overrides:
getNodeName in class AbstractModel
Parameters:
element - - element for which name is desired
Returns:
name of element or null if not available

getAccessibleElementType

protected Class getAccessibleElementType()

getAccessibilityEventServiceType

protected Class getAccessibilityEventServiceType()

initEventIdMap

protected void initEventIdMap()
Overrides:
initEventIdMap in class AbstractGuiModel

initEventIdMap

protected void initEventIdMap(Class accType,
                              Class serviceClass,
                              String fieldPrefix)

getModelEventTypes

public ModelEventType[] getModelEventTypes(Class sourceType)
get the model event types for the given source type. A ModelEventType object describes the types of events that can be fired within the context of this runtime model. If the sourceType is null, then all of the event types of which this model is aware will be returned else only events that can be fired by the given sourceType will be returned.

Specified by:
getModelEventTypes in interface IGuiModel
Overrides:
getModelEventTypes in class AbstractGuiModel
Parameters:
sourceType - type to be queried for events
Returns:
all events that can be fired by instances of the given type or all events of which this model is aware
See Also:
org.eclipse.actf.core.model.event.ModelEventType

registerModelEventListener

public void registerModelEventListener(IModelEventListener listener,
                                       ModelEventType[] eventTypes)
register a listener to receive notification when events with the given eventTypes are fired within this model. The eventTypes should be obtained from one of the getModelEventTypes methods.

Specified by:
registerModelEventListener in interface IGuiModel
Overrides:
registerModelEventListener in class AbstractGuiModel
Parameters:
listener - listener to be notified when specified events occur
eventTypes - event types for which listener is being registered
See Also:
IGuiModel.getModelEventType(Object), IGuiModel.getModelEventTypes(Class)

unregisterModelEventListener

public void unregisterModelEventListener(IModelEventListener listener,
                                         ModelEventType[] eventTypes)
unregister a previously registered listener. The eventTypes should be obtained from either of the getModelEventTypes methods.

Specified by:
unregisterModelEventListener in interface IGuiModel
Overrides:
unregisterModelEventListener in class AbstractGuiModel
Parameters:
listener - listener to be unregistered
eventTypes - event types for which listener is to be unregistered
See Also:
IGuiModel.registerModelEventListener(IModelEventListener, ModelEventType[]), org.eclipse.actf.core.model.event.ModelEventType#getId()

isVisible

public boolean isVisible(Object comp)
returns whether or not the specified component is currently visible

Specified by:
isVisible in interface IGuiModel
Overrides:
isVisible in class AbstractGuiModel
Parameters:
comp - - component to be tested
Returns:
whether or not the component is currently visible or showing on the screen

isValid

public boolean isValid(Object comp)
returns whether or not the specified component is valid for access. Components may be invalid because their underlying resources have been disposed, because the device that displays or renders them is destroyed, or for many other reasons. This default implementation merely checks that the component is not null.

Specified by:
isValid in interface IGuiModel
Overrides:
isValid in class AbstractGuiModel
Parameters:
comp - - component to be tested
Returns:
true if this component is valid, false otherwise
See Also:
org.eclipse.actf.core.model.InvalidComponentException

requestFocusFor

public boolean requestFocusFor(Object comp)
request the focus for the specified component. This method should be invoked, for example, just prior to validation for a report that reflects the state of the component while visible.

Specified by:
requestFocusFor in interface IGuiModel
Overrides:
requestFocusFor in class AbstractGuiModel
Parameters:
comp - - component for which focus is desired
Returns:
true if focus is successful, false otherwise

asyncInvokeOnUIThread

public void asyncInvokeOnUIThread(Runnable runnable)
will be invoked on the current thread

Parameters:
runnable - - Runnable to be invoked in UI thread
See Also:
IGuiModel.invokeOnUIThread(Runnable)

invokeOnUIThread

public void invokeOnUIThread(Runnable runnable)
will be invoked on the current thread

Parameters:
runnable - - Runnable to be invoked in UI thread
See Also:
IGuiModel.isUIThread()

isUIThread

public boolean isUIThread()
Description copied from interface: IGuiModel
returns whether or not the currently executing thread is the UI thread. The UI thread is the thread upon which actions effecting the state or drawing of a component or the event handlers associated with a component are to be executed. If this method returns false, the client will typically need to invoke the invokeOnUIThread method in order to effect the GUI.

Returns:
true if the current thread is the UI thread, false otherwise
See Also:
IGuiModel.invokeOnUIThread(Runnable)

isTopDown

public boolean isTopDown()

getNodeLocator

public INodeLocator getNodeLocator()
Description copied from class: AbstractModel
retrieves a locator for finding and identifying nodes in the model. The locator can provide an XPath expression that describes a node in the model or, given a valid XPath expression, find an object in the model.

Specified by:
getNodeLocator in interface IModel
Overrides:
getNodeLocator in class AbstractModel
Returns:
node locator