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.

Since:
JDE 4.7.0
See Also:
TreeFieldCallback

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

Method Detail

getAccessible

public 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:
JDE 4.7.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.