net.rim.device.api.ui.accessibility
Interface AccessibleTreeFieldCallback


public interface AccessibleTreeFieldCallback

Adds accessibility to tree field callback. Classes implement this interface to provide accessible functionality to the tree nodes.

This interface should be implemented only if the accessible objects are different from tree nodes. Here is an example of a tree field with string elements.

 
 public class MyTreeCallback implements TreeFieldCallback, AccessibleTreeFieldCallback
 {
     // draw tree field node
     public void drawTreeItem( TreeField treeField, Graphics graphics, int node, int y, int width, int indent )
     {
         String nodeLabel = treeField.getCookie( node );
         graphics.drawText( nodeLabel, 0, y );
     }

     // return accessible wrapped element
     public AccessibleContext getAccessible( TreeField treeField, int node )
     {
         String nodeLabel = treeField.getCookie( node );
         AccessibleContext accessible = new MyAccessibleLabelWrapper( nodeLabel );
         return accessible;
     }
 }
 
 

TreeField's getAccessibleChildAt() method checks whether the callback implements AccessibleTreeFieldCallback interface and if so calls it. Otherwise it uses the node cookie element.

See Also:
TreeFieldCallback
Since:
BlackBerry API 4.6.1

Method Summary
 AccessibleContext getAccessible(TreeField treeField, int node)
          Returns accessible element at specified tree node.
 



Method Detail

getAccessible

AccessibleContext getAccessible(TreeField treeField,
                                int node)
Returns accessible element at specified tree node.

Parameters:
treeField - accessible tree field that displays the tree
node - index of the element
Returns:
accessible element at specified node
Since:
BlackBerry API 4.6.1





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal