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.AbstractRenderableModel
          extended by org.eclipse.actf.accservice.core.win32.msaa.MsaaGuiModel
All Implemented Interfaces:
IModel, IRenderableModel
Direct Known Subclasses:
IA2GuiModel

public class MsaaGuiModel
extends AbstractRenderableModel

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

Author:
IAccessible interface

Field Summary
static String MSAA_MODEL
           
 
Fields inherited from class org.eclipse.actf.model.AbstractRenderableModel
eventIdMap
 
Fields inherited from class org.eclipse.actf.model.AbstractModel
baseType, configuration, locator, nodeToTypeNameMap, 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. 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. default implementation returns null
 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
 INodeWalker getNodeWalker()
          retrieve the NodeWalker for traversing elements in this model
 String[] getPackageNames()
          returns an array of the names of packages to be imported by CodeProcessors.
 String getTypeName(String nodeName)
          returns the type name associated with this nodeName. The nodeName parameter is most frequently formed by calling getNodeName. The name returned identifies the type that is represented by this node name in the graph.

If the specified nodeName was not obtained from getNodeName, then implementers should make a rough guess regarding the underlying type on the basis of the package names associated with this model via getPackageNames.

returns the original class name from which this node name was derived or, if unsuccessful, tries to form the correct class based on the package names associated with this implementation always returns org.eclipse.actf.accservice.AccessibleElement
protected  void initEventIdMap()
          used to initialize the eventId map, which is keyed by eventId that corresponds to a ModelEventType instance.
 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. 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, Object[] params)
          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. Optional parameters can also be passed to facilitate additional side effects or for additional information about the context in which events are being fired. The only optional parameter is an int that specifies flags for MSAA event-processing.
protected  void registerModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes, Object[] params, String accServiceName)
           
 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.
protected  void unregisterModelEventListener(IModelEventListener listener, ModelEventType[] eventTypes, String accServiceName)
           
 
Methods inherited from class org.eclipse.actf.model.AbstractRenderableModel
getBoundingRectangle, getModelEventType, highlight, initEventIdMap, registerModelEventListener
 
Methods inherited from class org.eclipse.actf.model.AbstractModel
addModelChangeListener, fireModelChangeEvent, getBaseType, getDefaultAliasPrefix, getName, getNodeId, getOrder, 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, removeModelChangeListener, setNodeID
 

Field Detail

MSAA_MODEL

public static final String MSAA_MODEL
See Also:
Constant Field Values
Constructor Detail

MsaaGuiModel

public MsaaGuiModel()
create a new MsaaModel


MsaaGuiModel

protected MsaaGuiModel(String extendedAttrib)
Method Detail

getNodeWalker

public INodeWalker getNodeWalker()
retrieve the NodeWalker for traversing elements in this model

Specified by:
getNodeWalker in interface IModel
Overrides:
getNodeWalker in class AbstractModel
Returns:
walker for traversing nodes in this model or null if no walker is available

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

getTypeName

public String getTypeName(String nodeName)
returns the type name associated with this nodeName. The nodeName parameter is most frequently formed by calling getNodeName. The name returned identifies the type that is represented by this node name in the graph.

If the specified nodeName was not obtained from getNodeName, then implementers should make a rough guess regarding the underlying type on the basis of the package names associated with this model via getPackageNames.

returns the original class name from which this node name was derived or, if unsuccessful, tries to form the correct class based on the package names associated with this implementation always returns org.eclipse.actf.accservice.AccessibleElement

Specified by:
getTypeName in interface IModel
Overrides:
getTypeName in class AbstractModel
Parameters:
nodeName - - as returned by getNodeName
Returns:
type name for the node name specified
See Also:
#getNodeName(Object)Object), IModel.getPackageNames()

getAccessibleElementType

protected Class getAccessibleElementType()

getAccessibilityEventServiceType

protected Class getAccessibilityEventServiceType()

initEventIdMap

protected void initEventIdMap()
Description copied from class: AbstractRenderableModel
used to initialize the eventId map, which is keyed by eventId that corresponds to a ModelEventType instance. Event ids are model-specific and typically defined as part of that model's definition.

Overrides:
initEventIdMap in class AbstractRenderableModel
See Also:
ModelEventType, AbstractRenderableModel.registerModelEventListener(IModelEventListener, ModelEventType[])

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. default implementation returns null

Specified by:
getModelEventTypes in interface IRenderableModel
Overrides:
getModelEventTypes in class AbstractRenderableModel
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:
ModelEventType

registerModelEventListener

public void registerModelEventListener(IModelEventListener listener,
                                       ModelEventType[] eventTypes,
                                       Object[] params)
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. Optional parameters can also be passed to facilitate additional side effects or for additional information about the context in which events are being fired. The only optional parameter is an int that specifies flags for MSAA event-processing. If such a flag (or combination of flags is not present, DEFAULT_CONTEXT_FLAG will be used.

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

registerModelEventListener

protected void registerModelEventListener(IModelEventListener listener,
                                          ModelEventType[] eventTypes,
                                          Object[] params,
                                          String accServiceName)

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 IRenderableModel
Overrides:
unregisterModelEventListener in class AbstractRenderableModel
Parameters:
listener - listener to be unregistered
eventTypes - event types for which listener is to be unregistered
See Also:
IRenderableModel.registerModelEventListener(IModelEventListener, ModelEventType[]), ModelEventType

unregisterModelEventListener

protected void unregisterModelEventListener(IModelEventListener listener,
                                            ModelEventType[] eventTypes,
                                            String accServiceName)

isVisible

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

Specified by:
isVisible in interface IRenderableModel
Overrides:
isVisible in class AbstractRenderableModel
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. default implementation merely checks that the component is not null.

Specified by:
isValid in interface IRenderableModel
Overrides:
isValid in class AbstractRenderableModel
Parameters:
comp - - component to be tested
Returns:
true if this component is valid, false otherwise
See Also:
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 IRenderableModel
Overrides:
requestFocusFor in class AbstractRenderableModel
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:
IRenderableModel.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:
IRenderableModel.isUIThread()

isUIThread

public boolean isUIThread()
Description copied from interface: IRenderableModel
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:
IRenderableModel.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

getPackageNames

public String[] getPackageNames()
Description copied from interface: IModel
returns an array of the names of packages to be imported by CodeProcessors. Any CodeProcessor used in the context of an IModel will, upon its instantiation and initialization, import the list of packages and make their traditional short-forms available. (Of course, short-forms are language-dependent.) Each element of the array is only a name for a package (e.g. 'my.java.package').

Returns:
array of names of packages to be imported by a CodeProcessor or an array of length 0 for no imports