Package limn.accessibility
Class StateNames
java.lang.Object
limn.accessibility.StateNames
What a state is called, in the user's language, for the one platform field that carries a state
as words rather than as a bit.
That field is UI Automation's ItemStatus, and today the only state spoken through
it is Accessible.State.BUSY. AT-SPI2 has a busy bit, and a reader there translates
it itself. AppKit has a boolean attribute. UI Automation has neither: an item that is working
says so in a status string the client reads out, so the toolkit has to supply the word, just as
RoleNames supplies the eight role phrases UI Automation has no word for. A state with no
phrase here is one no platform needs in words, and answers null.
Resolved under the node's own locale, not the ambient one, and registered from the
walk for RoleNames's reason: a bridge answers from the platform's threads, and
registering a bundle has to happen on the user-interface thread.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringenglishOf(Accessible.State state) static StringkeyFor(Accessible.State state) static @Nullable Stringof(Accessible.State state, Locale locale) static StringofToggle(ToggleFacet.State toggle, boolean isSwitch, Locale locale) The word a toggle's state is spoken as, where a bridge has to say it in a sentence of its own: a switch is on or off, anything else that toggles is checked, not checked or mixed.
-
Method Details
-
ofToggle
The word a toggle's state is spoken as, where a bridge has to say it in a sentence of its own: a switch is on or off, anything else that toggles is checked, not checked or mixed. VoiceOver says it itself for a focused toggle; this is for the one sentence the macOS bridge speaks for a table cell the user moved onto while the table keeps the focus, as a native table does.- Parameters:
toggle- the toggle's stateisSwitch- whether the node is a switch, which is on or off rather than checkedlocale- the node's own locale- Returns:
- the word, or the English when nothing translates it
-
keyFor
- Parameters:
state- a state- Returns:
- the key its phrase lives under,
limn.state.<lower-case-name>
-
of
- Parameters:
state- a statelocale- the locale to speak in, which is the node's own and not the process's- Returns:
- the phrase, or the English when nothing translates it, or
nullfor a state no platform carries as words
-
englishOf
- Parameters:
state- a state- Returns:
- the English phrase without consulting any bundle, or
nullwhen there is none
-