Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# openfx-uia

Full UIA Support for OpenJFX
Full [UIA](https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-uiautomationoverview) Support for OpenJFX

# Getting It
## Getting It

https://maven.bestsolution.at/repos/releases/
Group ID: at.bestsolution.openfx-uia
<https://maven.bestsolution.at/repos/releases/>\
Group ID: [`at.bestsolution.openfx-uia`](https://mvnrepository.com/artifact/at.bestsolution.openfx-uia)

You need the artifacts `UIAPlatform` and `UIAPlatform.agent` to develop an application.
ou need the artifacts `UIAPlatform` and `UIAPlatform.agent` to develop an application.

The agent adds `UIAPlatform.core` to the ext classpath and hooks the Accessible creation mechanism of javafx, while `UIAPlatform` contains the library and provides the API.
he agent adds `UIAPlatform.core` to the ext classpath and hooks the Accessible creation mechanism of javafx, while `UIAPlatform` contains the library and provides the API.

`UIAPlatform.sample` contains some samples and
`UIAPlatform.fullsample` contains a self running jar launcher for the samples with all dependencies. It only needs the environment variable `JDK8FX` set to your java 8 + fx home.
`UIAPlatform.sample` contains some samples and
`UIAPlatform.fullsample` contains a self running jar launcher for the samples with all dependencies. It only needs the environment variable `JDK8FX` set to your java 8 + fx home.

# Usage
## Usage

* add `UIAPlatform.jar` to your classpath
* launch your application with `-javaagent:UIAPlatform.agent.jar`
* add `UIAPlatform.jar` to your classpath
* launch your application with `-javaagent:UIAPlatform.agent.jar`

To create an UIA Element you have to implement a `IUIAElement` for it. There is also a `IUIAVirtualRootElement` for virtual roots and a `IUIAVirtaulElement` for virtual children. A virtual root is a JavaFX node with virtual children (the javafx children are no longer visible for the a11y). This can be used for example if you render on a canvas and want to add a11y information to the rendered content.

Expand All @@ -41,9 +41,9 @@ For how to use UIA look at the Microsoft documentation (here is a link to the [C

## Logging

to enable logging add `-Duia.log=true`
to enable logging add `-Duia.log=true`

# Supported Providers
## Supported Providers

| Provider |
| ------------------------ |
Expand Down Expand Up @@ -77,24 +77,25 @@ For how to use UIA look at the Microsoft documentation (here is a link to the [C
| IVirtualizedItemProvider |
| IWindowProvider |

# HRESULT Support
## HRESULT Support

`HRESULT` is now supported by throwing a `HResultException`. Any other exception thrown is handled as an `HRESULT` of the type `E_JAVAEXCEPTION` which is defined by javafx as `MAKE_HRESULT(SEVERITY_ERROR, 0xDE, 1)` (`0x80de0001`).

# Differences between UIA and openfx-uia
## Differences between UIA and openfx-uia

* The simple interfaces (`IRawElementPoviderSimple`, ...) are not supported and replaced by the `IUIAElement` and `IUIAVirtualRootElement`
* `IRawElementPRoviderFragment#Navigate()` cannot be implementeted, instead `IUIAVirtualRootElement#getChildren()` `IUIAVirtualElement#getChildren()` and `IUIAVirtualElement#getParent()` is provided.
* Most types are provided in a java friendly way. Type names should be the same as in the C API.
* Events are encapsulated in `IEvent` objects which can be obtained from the initialze method in the providers (There are also Context objects in the providers which provider the default events)
* Property Change events are encapsulated in `IProperty` objects which can be obtained from the initialize method in the providers (Those are also provided by the Context objects)

## Development Notes

# Development Notes
When launching via gradle the `--no-daemon` flag helps with the initial focus of the launched application. If omitted it behaves differently compared to starting by double clicking an icon.
When launching via gradle the `--no-daemon` flag helps with the initial focus of the launched application. If omitted it behaves differently compared to starting by double clicking an icon.

## Dev environment

# Dev environment
### jdk

## jdk
`winget install Azul.ZuluFX.8.JDK`
`$env:JDK8FX="C:\Program Files\Zulu\zulu-8"`
`$env:JDK8FX="C:\Program Files\Zulu\zulu-8"`