# Class AccessibilityManager

java.lang.Object
com.codename1.ui.accessibility.AccessibilityManager

public final class AccessibilityManager extends Object

Builds, caches, diffs, and dispatches actions for the portable semantic tree.

The tree is always constructed on the Codename One EDT. Native ports read the last immutable snapshot and post actions through `performAction(long, String, Object)`, so native accessibility threads never synchronously enter application code.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CHANGE_ACTIONS`
  `static final int`
  `CHANGE_ALL`
  `static final int`
  `CHANGE_BOUNDS`
  `static final int`
  `CHANGE_CONTENT`
  `static final int`
  `CHANGE_FOCUS`
  `static final int`
  `CHANGE_LIVE_REGION`
  `static final int`
  `CHANGE_PANE`
  `static final int`
  `CHANGE_STATE`
  `static final int`
  `CHANGE_STRUCTURE`
  `static final int`
  `CHANGE_VALUE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `cachedRootCount()`
  How many roots currently have a cached tree.
  `int`
  `dirtyRootCount()`
  How many roots are currently recorded as stale.
  `AccessibilityTreeSnapshot`
  `emptySnapshot()`
  A tree describing nothing.
  `AccessibilityTreeSnapshot`
  `getCurrentSnapshot()`
  `static AccessibilityManager`
  `getInstance()`
  `int`
  `getPendingChanges()`
  `AccessibilityTreeSnapshot`
  `getSnapshot(Form form)`
  `AccessibilityTreeSnapshot`
  `getSnapshot(TopLevelContainer top)`
  The accessibility tree for a top level, which may be a `com.codename1.ui.Window` rather than a `Form`.
  `void`
  `invalidate(Component component, int changeType)`
  `void`
  `invalidateAll()`
  `boolean`
  `performAction(long nodeId, String actionId, Object argument)`
  `void`
  `releaseRoot(Container root)`
  Drops any snapshot cached for a root that is going away.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### CHANGE_STRUCTURE

    public static final int CHANGE_STRUCTURE
    See Also:
      - Constant Field Values

  - ### CHANGE_CONTENT

    public static final int CHANGE_CONTENT
    See Also:
      - Constant Field Values

  - ### CHANGE_STATE

    public static final int CHANGE_STATE
    See Also:
      - Constant Field Values

  - ### CHANGE_VALUE

    public static final int CHANGE_VALUE
    See Also:
      - Constant Field Values

  - ### CHANGE_BOUNDS

    public static final int CHANGE_BOUNDS
    See Also:
      - Constant Field Values

  - ### CHANGE_FOCUS

    public static final int CHANGE_FOCUS
    See Also:
      - Constant Field Values

  - ### CHANGE_ACTIONS

    public static final int CHANGE_ACTIONS
    See Also:
      - Constant Field Values

  - ### CHANGE_LIVE_REGION

    public static final int CHANGE_LIVE_REGION
    See Also:
      - Constant Field Values

  - ### CHANGE_PANE

    public static final int CHANGE_PANE
    See Also:
      - Constant Field Values

  - ### CHANGE_ALL

    public static final int CHANGE_ALL
    See Also:
      - Constant Field Values

- ## Method Details

  - ### dirtyRootCount

    public int dirtyRootCount()

    How many roots are currently recorded as stale.

    ###### Returns

    the size of the dirty set

  - ### emptySnapshot

    public AccessibilityTreeSnapshot emptySnapshot()

    A tree describing nothing.

    For a surface that no longer exists. A port can outlive a window -- an accessibility bridge is held by the platform and asked for its tree after the window it describes has been disposed -- and the alternatives are both wrong: the last tree built anywhere belongs to some other window, and rebuilding is impossible with nothing to walk.

    ###### Returns

    an empty snapshot, never null

  - ### cachedRootCount

    public int cachedRootCount()

    How many roots currently have a cached tree.

    ###### Returns

    the size of the snapshot cache

  - ### getInstance

    public static AccessibilityManager getInstance()

  - ### invalidate

    public void invalidate(Component component, int changeType)

  - ### invalidateAll

    public void invalidateAll()

  - ### getCurrentSnapshot

    public AccessibilityTreeSnapshot getCurrentSnapshot()

  - ### getSnapshot

    public AccessibilityTreeSnapshot getSnapshot(TopLevelContainer top)

    The accessibility tree for a top level, which may be a `com.codename1.ui.Window` rather than a `Form`.

    ###### Parameters

    - `top`: the top level to describe, may be null

    ###### Returns

    the snapshot, never null

  - ### releaseRoot

    public void releaseRoot(Container root)

    Drops any snapshot cached for a root that is going away.

    ###### Parameters

    - `root`: the root being disposed

  - ### getSnapshot

    public AccessibilityTreeSnapshot getSnapshot(Form form)

  - ### getPendingChanges

    public int getPendingChanges()

  - ### performAction

    public boolean performAction(long nodeId, String actionId, Object argument)