public final class AccessibilityManager

  1. Object
  2. AccessibilityManager

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.

Fields

public static final int CHANGE_STRUCTURE = 1
public static final int CHANGE_CONTENT = 2
public static final int CHANGE_STATE = 4
public static final int CHANGE_VALUE = 8
public static final int CHANGE_BOUNDS = 16
public static final int CHANGE_FOCUS = 32
public static final int CHANGE_ACTIONS = 64
public static final int CHANGE_LIVE_REGION = 128
public static final int CHANGE_PANE = 256
public static final int CHANGE_ALL = 2147483647

Methods

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

Inherited methods

Field details

CHANGE_STRUCTURE

public static final int CHANGE_STRUCTURE = 1

CHANGE_CONTENT

public static final int CHANGE_CONTENT = 2

CHANGE_STATE

public static final int CHANGE_STATE = 4

CHANGE_VALUE

public static final int CHANGE_VALUE = 8

CHANGE_BOUNDS

public static final int CHANGE_BOUNDS = 16

CHANGE_FOCUS

public static final int CHANGE_FOCUS = 32

CHANGE_ACTIONS

public static final int CHANGE_ACTIONS = 64

CHANGE_LIVE_REGION

public static final int CHANGE_LIVE_REGION = 128

CHANGE_PANE

public static final int CHANGE_PANE = 256

CHANGE_ALL

public static final int CHANGE_ALL = 2147483647

Method details

dirtyRootCount

public synchronized int dirtyRootCount()
How many roots are currently recorded as stale.

Returns

the size of the dirty set

emptySnapshot

public synchronized 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 synchronized int cachedRootCount()
How many roots currently have a cached tree.

Returns

the size of the snapshot cache

getInstance

public static AccessibilityManager getInstance()

invalidate

public synchronized 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 TopLevelContainer
the top level to describe, may be null

Returns

the snapshot, never null

releaseRoot

public synchronized void releaseRoot(Container root)
Drops any snapshot cached for a root that is going away.

Parameters

root Container
the root being disposed

getSnapshot

public synchronized AccessibilityTreeSnapshot getSnapshot(Form form)

getPendingChanges

public synchronized int getPendingChanges()

performAction

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