mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-27 19:00:50 +01:00
Compare commits
272 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9182819b00 | ||
|
|
ee8b0d6e1d | ||
|
|
07c91bbd3b | ||
|
|
30564b5f80 | ||
|
|
171b12a1cb | ||
|
|
3cebc05ae8 | ||
|
|
952b2615ed | ||
|
|
d13c3629cc | ||
|
|
23fedcf940 | ||
|
|
5c962ccb98 | ||
|
|
7dd7110aca | ||
|
|
79445591f5 | ||
|
|
ad3d6aed23 | ||
|
|
8ba48b30d7 | ||
|
|
b5841511a3 | ||
|
|
cdb9263935 | ||
|
|
6d1fc9e235 | ||
|
|
612d900a12 | ||
|
|
5dda0a7aa6 | ||
|
|
f2fffcd720 | ||
|
|
f3978b9968 | ||
|
|
53532a3bf4 | ||
|
|
56e75b0566 | ||
|
|
63e1b66691 | ||
|
|
9d4d4439dc | ||
|
|
a64dbc71e6 | ||
|
|
74d232aeb3 | ||
|
|
2d56703166 | ||
|
|
4a99661c66 | ||
|
|
cfcd38f023 | ||
|
|
fa5050232e | ||
|
|
8c11fbd82d | ||
|
|
cd7d386977 | ||
|
|
9ae1ec4c3c | ||
|
|
1a0eaaee9e | ||
|
|
841ce9c38a | ||
|
|
a6a194dd39 | ||
|
|
348c14b8b8 | ||
|
|
abb786db96 | ||
|
|
bc0735befe | ||
|
|
83ea15a83e | ||
|
|
92dfd0e641 | ||
|
|
05d56b61c6 | ||
|
|
2cf4a934ba | ||
|
|
11541fdad8 | ||
|
|
a16859ab4b | ||
|
|
53e14e4b61 | ||
|
|
99075cb564 | ||
|
|
ef1683ef8c | ||
|
|
bdd41cd1a7 | ||
|
|
56669e9e09 | ||
|
|
5e661ed623 | ||
|
|
9f272ec7b9 | ||
|
|
8d1afac841 | ||
|
|
1f6f2c09c4 | ||
|
|
2ac7969c38 | ||
|
|
d4f14f8854 | ||
|
|
5b3d6e7dc6 | ||
|
|
a19b914dcb | ||
|
|
a513ce31b2 | ||
|
|
304fa73195 | ||
|
|
639400089a | ||
|
|
5765538d66 | ||
|
|
99c43ed87d | ||
|
|
32d5ea9c87 | ||
|
|
1206116021 | ||
|
|
9bb83fd912 | ||
|
|
abd6cbf3c9 | ||
|
|
e2e6419537 | ||
|
|
c349ae994f | ||
|
|
785021ee61 | ||
|
|
6f8a4d52d6 | ||
|
|
a8ef9f0b6d | ||
|
|
021f28427a | ||
|
|
84a849724e | ||
|
|
c908175dee | ||
|
|
d97685926d | ||
|
|
5f86b926c8 | ||
|
|
d7a996fa99 | ||
|
|
933144a841 | ||
|
|
9d39a22a17 | ||
|
|
318dd2f1bd | ||
|
|
b20288a66c | ||
|
|
05aa08f5b6 | ||
|
|
449a08f473 | ||
|
|
526a06e7bf | ||
|
|
189ecd876e | ||
|
|
fbab3486a5 | ||
|
|
980c398d1a | ||
|
|
0af7cc9873 | ||
|
|
37706f7594 | ||
|
|
ab508f5c4b | ||
|
|
c9ab82d08f | ||
|
|
1ecdf7e66b | ||
|
|
34210543ad | ||
|
|
0446bc02f6 | ||
|
|
702b511444 | ||
|
|
c7ae0495a3 | ||
|
|
b58027e9bc | ||
|
|
c89619366f | ||
|
|
44d7c145dd | ||
|
|
dd8bbdad1c | ||
|
|
eaf48fd944 | ||
|
|
fabcc60ba5 | ||
|
|
938e76ad59 | ||
|
|
b5de73b78c | ||
|
|
a37e124669 | ||
|
|
55e42f436c | ||
|
|
5c12616f29 | ||
|
|
20ca991114 | ||
|
|
1915e933ce | ||
|
|
cdbc468c15 | ||
|
|
7151464459 | ||
|
|
e2e187858b | ||
|
|
22ee99e1ce | ||
|
|
45ac40047b | ||
|
|
8c8fa0886f | ||
|
|
18491876fd | ||
|
|
0dac92c123 | ||
|
|
ad8f6507ac | ||
|
|
ac8349bc9c | ||
|
|
8044e5e001 | ||
|
|
11dd9f0e1e | ||
|
|
7b77b2bf3f | ||
|
|
445b14718f | ||
|
|
2a405294bf | ||
|
|
df28978170 | ||
|
|
37fa5f420b | ||
|
|
9641cf935f | ||
|
|
446b73523a | ||
|
|
0eeb76c094 | ||
|
|
a6b54194be | ||
|
|
b75f8ff512 | ||
|
|
e5b3175b10 | ||
|
|
b6793fa2fe | ||
|
|
b189165e85 | ||
|
|
99ec8924fb | ||
|
|
1a7c50da9f | ||
|
|
7a90faa7d0 | ||
|
|
168a949582 | ||
|
|
81c88d05f6 | ||
|
|
d25373ba65 | ||
|
|
4070fab5f0 | ||
|
|
d185a67394 | ||
|
|
38c44caef8 | ||
|
|
71648e5c4c | ||
|
|
a3714f45ae | ||
|
|
3329b267c6 | ||
|
|
3b8fa92f59 | ||
|
|
f652a73ebe | ||
|
|
05d233d5f6 | ||
|
|
5f64946299 | ||
|
|
f06f0c2eb2 | ||
|
|
f60c58ac91 | ||
|
|
a769e4f423 | ||
|
|
130899a342 | ||
|
|
51fbf45a15 | ||
|
|
128ea64fd5 | ||
|
|
5914be1caf | ||
|
|
33d1a0f76c | ||
|
|
76c7c50b6a | ||
|
|
1ef4bd88f0 | ||
|
|
99c3219336 | ||
|
|
90a09c2913 | ||
|
|
667b88de5d | ||
|
|
9a92bf547a | ||
|
|
7a1901ceb3 | ||
|
|
1837a36cd2 | ||
|
|
7b4f18ebf0 | ||
|
|
871ff41acf | ||
|
|
5f02471699 | ||
|
|
a9dbc65d8f | ||
|
|
2b83bed5a8 | ||
|
|
e1168e317c | ||
|
|
b553da5f0b | ||
|
|
dae28264f9 | ||
|
|
3bc2f10854 | ||
|
|
8fdb11cb77 | ||
|
|
2481d0a8e6 | ||
|
|
df73c178b2 | ||
|
|
58ca9ecac7 | ||
|
|
e19c4240c6 | ||
|
|
b26dac8d42 | ||
|
|
41a06866c0 | ||
|
|
6a089dc0b2 | ||
|
|
a161701774 | ||
|
|
f0c672e28d | ||
|
|
ef56815632 | ||
|
|
d2fe0d4496 | ||
|
|
e01837a42e | ||
|
|
cc86e4f23a | ||
|
|
72bf1b4562 | ||
|
|
5cb828436c | ||
|
|
5ff6b031f0 | ||
|
|
fb55e1e23b | ||
|
|
9e086e8405 | ||
|
|
18677037ea | ||
|
|
adfd1a5baf | ||
|
|
b47b04c9a9 | ||
|
|
1372db82a3 | ||
|
|
3827b6407d | ||
|
|
44e2809f9d | ||
|
|
1c70c14246 | ||
|
|
4b759a63c9 | ||
|
|
fc8f2d72ea | ||
|
|
3faea1a84b | ||
|
|
b7b66977c9 | ||
|
|
df173b121c | ||
|
|
77b5b80c38 | ||
|
|
1fb4e57197 | ||
|
|
9d8a402569 | ||
|
|
1bd8fe66e8 | ||
|
|
a7d131f0e6 | ||
|
|
073f68edb0 | ||
|
|
693ca15a30 | ||
|
|
c7dae0f76b | ||
|
|
1e75fb8a4c | ||
|
|
be23595d16 | ||
|
|
17fa431a15 | ||
|
|
0ea2e94b73 | ||
|
|
1f3ad5c22e | ||
|
|
75afd724cd | ||
|
|
e5a9e30d10 | ||
|
|
b710c970b2 | ||
|
|
d033368450 | ||
|
|
55a82c3289 | ||
|
|
b4af29941e | ||
|
|
ba46211b67 | ||
|
|
c62406108e | ||
|
|
7ae82c8286 | ||
|
|
df9149ec76 | ||
|
|
4390648918 | ||
|
|
3d7bae6121 | ||
|
|
79d1c4c648 | ||
|
|
3506e343bc | ||
|
|
24726d7dc6 | ||
|
|
aaedc0d821 | ||
|
|
051afbb8b7 | ||
|
|
8a95ce02a1 | ||
|
|
ed6c442762 | ||
|
|
fa600bab73 | ||
|
|
fd9ca2ec97 | ||
|
|
7784841363 | ||
|
|
5f39d4af08 | ||
|
|
16698ca913 | ||
|
|
c2f77d5943 | ||
|
|
219af25410 | ||
|
|
db3bb466be | ||
|
|
aac5370065 | ||
|
|
29ce2d49cc | ||
|
|
09675a9b9e | ||
|
|
84726c7c84 | ||
|
|
be1001f499 | ||
|
|
a62ecc6b80 | ||
|
|
bce9d36393 | ||
|
|
ec07f7e56e | ||
|
|
6aedcf778d | ||
|
|
eb91a96ff9 | ||
|
|
99d435dac0 | ||
|
|
2ee996abbc | ||
|
|
8302bd3f80 | ||
|
|
e68adefd0e | ||
|
|
be2cc5614f | ||
|
|
eef2b501bb | ||
|
|
315ff06011 | ||
|
|
266cc785b0 | ||
|
|
90c66367c4 | ||
|
|
78c0afe4f5 | ||
|
|
81602f10e6 | ||
|
|
a24b572105 | ||
|
|
69cad4eb9e | ||
|
|
7a63a54009 |
196
.github/README.md
vendored
196
.github/README.md
vendored
@@ -1,196 +0,0 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
|
||||
# Welcome to JetBrains Runtime!
|
||||
|
||||
JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
|
||||
It includes a number of enhancements in font rendering, ligatures, HiDPI support, windowing/focus subsystems, performance improvements, and bugfixes.
|
||||
|
||||
> **_NOTE_**: This is a **development** branch that is periodically synchronized with
|
||||
> the [OpenJDK master](https://github.com/openjdk/jdk/tree/master) branch.
|
||||
>
|
||||
Release builds are based on these branches:
|
||||
* [jbr11](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr11) (JDK 11)
|
||||
* [jbr17](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr17) (JDK 17)
|
||||
|
||||
Download the latest releases of JetBrains Runtime to use with JetBrains IDEs. The full list
|
||||
can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
|
||||
## Releases based on JDK 17
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|--------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2023.1 | [17.0.6-b829.1](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b829.1) | 14-Feb-2023 |
|
||||
| 2022.3 | [17.0.6-b653.32](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b653.32) | 14-Feb-2023 |
|
||||
| 2022.2 | [17.0.5-b469.71](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.5b469.71) | 14-Nov-2022 |
|
||||
|
||||
## Releases based on JDK 11
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2022.1 | [11_0_16-b2043.64](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64) | 10-Nov-2022 |
|
||||
| 2021.3 | [11_0_14_1-b1751.46](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_14_1b1751.46) | 21-Feb-2022 |
|
||||
| 2021.2 | [11_0_13-b1504.49](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jb11_0_13-b1504.49) | 15-Nov-2021 |
|
||||
| 2021.1 | [11.0.11+9-b1341.60](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1248891540)| 15-Jun-2021 |
|
||||
| 2020.3 | [11_0_10-b1145.115](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1249243977) | 21-Jun-2021 |
|
||||
|
||||
## Contents
|
||||
- [Welcome to JetBrains Runtime](#welcome-to-jetbrains-runtime)
|
||||
- [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
|
||||
- [Getting Sources](#getting-sources)
|
||||
- [macOS, Linux](#macos-linux)
|
||||
- [Windows](#sources-windows)
|
||||
- [Configuring the Build Environment](#configuring-the-build-environment)
|
||||
- [Linux (Docker)](#linux-docker)
|
||||
- [Ubuntu Linux](#ubuntu-linux)
|
||||
- [Windows](#build-windows)
|
||||
- [macOS](#macos)
|
||||
- [Developing](#developing)
|
||||
- [Contributing](#contributing)
|
||||
- [Resources](#resources)
|
||||
|
||||
## Products Built on JetBrains Runtime
|
||||
* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
|
||||
* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
|
||||
* [DataGrip](https://www.jetbrains.com/datagrip/). The IDE for Databases and SQL from JetBrains.
|
||||
* [GoLand](https://www.jetbrains.com/go/). The cross-platform Go IDE from JetBrains.
|
||||
* [IntelliJ IDEA](https://www.jetbrains.com/idea/). The IDE for JVM from JetBrains.
|
||||
* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). The Java profiler.
|
||||
* [PhpStorm](https://www.jetbrains.com/phpstorm/). The PHP IDE from JetBrains.
|
||||
* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
|
||||
* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
|
||||
* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
|
||||
* [Toolbox App](https://www.jetbrains.com/toolbox-app/). JetBrains IDE manager.
|
||||
* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
|
||||
* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
|
||||
|
||||
## Getting Sources
|
||||
### macOS, Linux
|
||||
```
|
||||
git config --global core.autocrlf input
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
### Windows
|
||||
<a name="sources-windows"></a>
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
```
|
||||
|
||||
## Configuring the Build Environment
|
||||
Here are quick per-platform instructions for those who can't wait to get started.
|
||||
Please refer to [OpenJDK build docs](https://openjdk.java.net/groups/build/doc/building.html) for in-depth
|
||||
coverage of all the details.
|
||||
|
||||
> **_TIP:_** To get a preliminary report of what's missing, run `./configure` and check its output.
|
||||
> It would usually have meaningful advice on how to solve the problem.
|
||||
|
||||
### Linux (Docker)
|
||||
Create a container:
|
||||
```
|
||||
$ cd jb/project/docker
|
||||
$ docker build .
|
||||
...
|
||||
Successfully built 942ea9900054
|
||||
```
|
||||
Run these commands in the new container:
|
||||
```
|
||||
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
|
||||
# cd /JetBrainsRuntime
|
||||
# sh ./configure
|
||||
# make images CONF=linux-x86_64-normal-server-release
|
||||
```
|
||||
|
||||
### Ubuntu Linux
|
||||
Install the necessary tools, libraries, and headers with:
|
||||
```
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
|
||||
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev
|
||||
```
|
||||
Get Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=linux&package=jdk)).
|
||||
|
||||
Then run the following:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/linux-x86_64-server-release/`.
|
||||
|
||||
### Windows
|
||||
<a name="build-windows"></a>
|
||||
Install the following:
|
||||
* [Cygwin x64](http://www.cygwin.com/).
|
||||
Required packages: `autoconf`, `binutils`, `cpio`, `diffutils`, `file`, `gawk`, `gcc-core`, `make`, `m4`, `unzip`, `zip`.
|
||||
Install those together with Cygwin.
|
||||
* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
|
||||
Install with the desktop development kit, which includes Windows SDK and compilers.
|
||||
Visual Studio 2019 is supported by default.
|
||||
* Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=windows&package=jdk)).
|
||||
If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
|
||||
```
|
||||
The first command sets up environment variables, the second starts a Cygwin shell with the proper environment.
|
||||
|
||||
In the Cygwin shell:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ bash configure --with-toolchain-version=2019
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/windows-x86_64-server-release/`.
|
||||
|
||||
### macOS
|
||||
Install the following:
|
||||
* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
|
||||
* Java 18 (for instance, [Azul Zulu Builds of OpenJDK 18](https://www.azul.com/downloads/?version=java-18-sts&os=macos&package=jdk)).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/macosx-x86_64-server-release/`.
|
||||
|
||||
## Developing
|
||||
You can use [CLion](https://www.jetbrains.com/clion/) to develop native parts of the JetBrains Runtime and
|
||||
[IntelliJ IDEA](https://www.jetbrains.com/idea/) for the parts written in Java.
|
||||
Both require projects to be created.
|
||||
|
||||
### CLion
|
||||
Run
|
||||
```
|
||||
$ make compile-commands
|
||||
```
|
||||
in the git root and open the resulting `build/.../compile_commands.json` file as a project.
|
||||
Then use `Tools | Compilation Database | Change Project Root` to point to git root of this repository.
|
||||
|
||||
See also this detailed step-by-step tutorial for all platforms:
|
||||
[How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
|
||||
### IDEA
|
||||
Run
|
||||
```
|
||||
$ sh ./bin/idea.sh
|
||||
```
|
||||
in the git root to generate project files (add `--help` for options). If you have multiple
|
||||
configurations (for example, `release` and `fastdebug`), supply the `--conf <conf_name>` argument.
|
||||
Then open the git root directory as a project in IDEA.
|
||||
|
||||
## Contributing
|
||||
We are happy to receive your pull requests!
|
||||
Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
|
||||
|
||||
## Resources
|
||||
* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
|
||||
* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
|
||||
* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
|
||||
* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
7
.github/workflows/main.yml
vendored
7
.github/workflows/main.yml
vendored
@@ -26,10 +26,6 @@
|
||||
name: 'OpenJDK GHA Sanity Checks'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
- pr/*
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
@@ -59,7 +55,8 @@ jobs:
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
# additional build options for linux-x64 are disabled
|
||||
# linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
macos-x64: ${{ steps.include.outputs.macos-x64 }}
|
||||
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
|
||||
|
||||
270
.github/workflows/pr.yml
vendored
Normal file
270
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
#
|
||||
# Copyright 2000-2023 JetBrains s.r.o.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
name: 'Build OpenJDK on pull request'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
###
|
||||
### Determine platforms to include
|
||||
###
|
||||
select:
|
||||
name: 'Select platforms'
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
linux-x64: ${{ steps.include.outputs.linux-x64 }}
|
||||
linux-x86: ${{ steps.include.outputs.linux-x86 }}
|
||||
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
|
||||
macos-x64: ${{ steps.include.outputs.macos-x64 }}
|
||||
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
|
||||
windows-x64: ${{ steps.include.outputs.windows-x64 }}
|
||||
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
|
||||
windows-x86: ${{ steps.include.outputs.windows-x86 }}
|
||||
|
||||
steps:
|
||||
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
|
||||
- name: 'Check what jobs to run'
|
||||
id: include
|
||||
run: |
|
||||
# Determine which platform jobs to run
|
||||
|
||||
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
|
||||
# 'false' otherwise.
|
||||
# arg $1: platform name or names to look for
|
||||
function check_platform() {
|
||||
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
|
||||
input='${{ github.event.inputs.platforms }}'
|
||||
elif [[ $GITHUB_EVENT_NAME == push ]]; then
|
||||
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
|
||||
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
|
||||
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
|
||||
echo 'false'
|
||||
return
|
||||
else
|
||||
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
|
||||
fi
|
||||
fi
|
||||
|
||||
normalized_input="$(echo ,$input, | tr -d ' ')"
|
||||
if [[ "$normalized_input" == ",," ]]; then
|
||||
# For an empty input, assume all platforms should run
|
||||
echo 'true'
|
||||
return
|
||||
else
|
||||
# Check for all acceptable platform names
|
||||
for part in $* ; do
|
||||
if echo "$normalized_input" | grep -q -e ",$part," ; then
|
||||
echo 'true'
|
||||
return
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo 'false'
|
||||
}
|
||||
|
||||
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
|
||||
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
|
||||
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
|
||||
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
|
||||
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
|
||||
echo "windows-x86=$(check_platform windows-x86 windows x86)" >> $GITHUB_OUTPUT
|
||||
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
|
||||
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
|
||||
|
||||
###
|
||||
### Build jobs
|
||||
###
|
||||
|
||||
build-linux-x64:
|
||||
name: linux-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
# The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
|
||||
if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-linux-x86:
|
||||
name: linux-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x86
|
||||
gcc-major-version: '10'
|
||||
gcc-package-suffix: '-multilib'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-architecture: 'i386'
|
||||
# Some multilib libraries do not have proper inter-dependencies, so we have to
|
||||
# install their dependencies manually.
|
||||
apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386'
|
||||
extra-conf-options: '--with-target-bits=32'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-x86 == 'true'
|
||||
|
||||
build-linux-cross-compile:
|
||||
name: linux-cross-compile
|
||||
needs:
|
||||
- select
|
||||
- build-linux-x64
|
||||
uses: ./.github/workflows/build-cross-compile.yml
|
||||
with:
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
apt-gcc-cross-version: '10.4.0-4ubuntu1~22.04cross1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.linux-cross-compile == 'true'
|
||||
|
||||
build-macos-x64:
|
||||
name: macos-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-x64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-x64 == 'true'
|
||||
|
||||
build-macos-aarch64:
|
||||
name: macos-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-macos.yml
|
||||
with:
|
||||
platform: macos-aarch64
|
||||
xcode-toolset-version: '12.5.1'
|
||||
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.macos-aarch64 == 'true'
|
||||
|
||||
build-windows-x64:
|
||||
name: windows-x64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86.x64'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x64 == 'true'
|
||||
|
||||
build-windows-x86:
|
||||
name: windows-x86
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-x86
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'x86'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-x86 == 'true'
|
||||
|
||||
build-windows-aarch64:
|
||||
name: windows-aarch64
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-windows.yml
|
||||
with:
|
||||
platform: windows-aarch64
|
||||
msvc-toolset-version: '14.29'
|
||||
msvc-toolset-architecture: 'arm64'
|
||||
make-target: 'hotspot'
|
||||
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.windows-aarch64 == 'true'
|
||||
|
||||
build-docs:
|
||||
name: docs
|
||||
needs: select
|
||||
uses: ./.github/workflows/build-linux.yml
|
||||
with:
|
||||
platform: linux-x64
|
||||
debug-levels: '[ "debug" ]'
|
||||
make-target: 'docs-jdk-bundles'
|
||||
# Make sure we never try to make full docs, since that would require a
|
||||
# build JDK, and we do not need the additional testing of the graphs.
|
||||
extra-conf-options: '--disable-full-docs'
|
||||
gcc-major-version: '10'
|
||||
apt-gcc-version: '10.4.0-4ubuntu1~22.04'
|
||||
configure-arguments: ${{ github.event.inputs.configure-arguments }}
|
||||
make-arguments: ${{ github.event.inputs.make-arguments }}
|
||||
if: needs.select.outputs.docs == 'true'
|
||||
|
||||
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
|
||||
remove-bundles:
|
||||
name: 'Remove bundle artifacts'
|
||||
runs-on: ubuntu-22.04
|
||||
if: always()
|
||||
needs:
|
||||
- build-linux-x64
|
||||
- build-linux-x86
|
||||
- build-linux-cross-compile
|
||||
- build-macos-x64
|
||||
- build-macos-aarch64
|
||||
- build-windows-x64
|
||||
- build-windows-aarch64
|
||||
- build-windows-x86
|
||||
|
||||
steps:
|
||||
# Hack to get hold of the api environment variables that are only defined for actions
|
||||
- name: 'Get API configuration'
|
||||
id: api
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
|
||||
|
||||
- name: 'Remove bundle artifacts'
|
||||
run: |
|
||||
# Find and remove all bundle artifacts
|
||||
ALL_ARTIFACT_URLS="$(curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
|
||||
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
|
||||
for url in $BUNDLE_ARTIFACT_URLS; do
|
||||
echo "Removing $url"
|
||||
curl -s \
|
||||
-H 'Accept: application/json;api-version=6.0-preview' \
|
||||
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
|
||||
-X DELETE "$url" \
|
||||
|| echo "Failed to remove bundle"
|
||||
done
|
||||
220
README.md
220
README.md
@@ -1,14 +1,216 @@
|
||||
[](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
|
||||
|
||||
# Welcome to the JDK!
|
||||
# Welcome to JetBrains Runtime!
|
||||
|
||||
For build instructions please see the
|
||||
[online documentation](https://openjdk.org/groups/build/doc/building.html),
|
||||
or either of these files:
|
||||
JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
|
||||
It supports enhanced class redefinition ([DCEVM](https://ssw.jku.at/dcevm/)),
|
||||
features optional [JCEF](https://github.com/JetBrains/jcef), a framework for embedding Chromium-based browsers,
|
||||
includes a number of improvements in font rendering, keyboards support,
|
||||
windowing/focus subsystems, HiDPI, accessibility, and performance, provides better desktop integration
|
||||
and bugfixes not yet present in OpenJDK.
|
||||
|
||||
- [doc/building.html](doc/building.html) (html version)
|
||||
- [doc/building.md](doc/building.md) (markdown version)
|
||||
> **_NOTE_**: This is a **development** branch that is periodically synchronized with
|
||||
> the [OpenJDK master](https://github.com/openjdk/jdk/tree/master) branch.
|
||||
>
|
||||
Release builds are based on these branches:
|
||||
* [jbr11](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr11) (JDK 11)
|
||||
* [jbr17](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr17) (JDK 17)
|
||||
|
||||
Download the latest releases of JetBrains Runtime to use with JetBrains IDEs. The full list
|
||||
can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
|
||||
See <https://openjdk.org/> for more information about the OpenJDK
|
||||
Community and the JDK and see <https://bugs.openjdk.org> for JDK issue
|
||||
tracking.
|
||||
## Releases based on JDK 17
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|--------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2023.1 | [17.0.6-b829.5](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b829.5) | 01-Mar-2023 |
|
||||
| 2022.3 | [17.0.6-b653.34](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b653.34) | 28-Feb-2023 |
|
||||
| 2022.2 | [17.0.6-b469.82](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b469.82) | 06-Mar-2023 |
|
||||
|
||||
## Releases based on JDK 11
|
||||
|
||||
| IDE Version | Latest JBR | Date Released |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------|---------------|
|
||||
| 2022.1 | [11_0_16-b2043.64](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64) | 10-Nov-2022 |
|
||||
| 2021.3 | [11_0_14_1-b1751.46](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_14_1b1751.46) | 21-Feb-2022 |
|
||||
| 2021.2 | [11_0_13-b1504.49](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jb11_0_13-b1504.49) | 15-Nov-2021 |
|
||||
| 2021.1 | [11.0.11+9-b1341.60](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1248891540)| 15-Jun-2021 |
|
||||
| 2020.3 | [11_0_10-b1145.115](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1249243977) | 21-Jun-2021 |
|
||||
|
||||
## Contents
|
||||
- [Welcome to JetBrains Runtime](#welcome-to-jetbrains-runtime)
|
||||
- [Why Use JetBrains Runtime?](#why-use-jetbrains-runtime)
|
||||
- [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
|
||||
- [Getting Sources](#getting-sources)
|
||||
- [macOS, Linux](#macos-linux)
|
||||
- [Windows](#sources-windows)
|
||||
- [Configuring the Build Environment](#configuring-the-build-environment)
|
||||
- [Linux (Docker)](#linux-docker)
|
||||
- [Ubuntu Linux](#ubuntu-linux)
|
||||
- [Windows](#build-windows)
|
||||
- [macOS](#macos)
|
||||
- [Developing](#developing)
|
||||
- [Contributing](#contributing)
|
||||
- [Resources](#resources)
|
||||
|
||||
## Why Use JetBrains Runtime?
|
||||
* **Embedded browser**: JetBrains Runtime includes the Java Chromium Embedded Framework ([JCEF](https://github.com/JetBrains/jcef)), which
|
||||
enables you to embed a Chromium-based browsers in your JVM-based application.
|
||||
To use it, [download a build with JCEF](https://github.com/JetBrains/JetBrainsRuntime/releases).
|
||||
* **Enhanced class re-definition** with the [DCEVM](https://ssw.jku.at/dcevm/) technology that makes it easier to reload
|
||||
changed code without restarting JVM; this feature needs to be explicitly enabled with `-XX:+AllowEnhancedClassRedefinition`.
|
||||
* **Better FPS performance** for graphics-intensive applications.
|
||||
* **Improved font rendering**, **keyboard input** (such as shortcuts and multinational keyboards),
|
||||
**HiDPI** and **accessibility** support.
|
||||
* **Robust desktop experience**: GUI-related fixes often reach JetBrains Runtime much earlier than the corresponding version of OpenJDK.
|
||||
|
||||
## Products Built on JetBrains Runtime
|
||||
* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
|
||||
* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
|
||||
* [DataGrip](https://www.jetbrains.com/datagrip/). The IDE for Databases and SQL from JetBrains.
|
||||
* [GoLand](https://www.jetbrains.com/go/). The cross-platform Go IDE from JetBrains.
|
||||
* [IntelliJ IDEA](https://www.jetbrains.com/idea/). The IDE for JVM from JetBrains.
|
||||
* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). The Java profiler.
|
||||
* [PhpStorm](https://www.jetbrains.com/phpstorm/). The PHP IDE from JetBrains.
|
||||
* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
|
||||
* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
|
||||
* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
|
||||
* [Toolbox App](https://www.jetbrains.com/toolbox-app/). JetBrains IDE manager.
|
||||
* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
|
||||
* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
|
||||
|
||||
## Getting Sources
|
||||
### macOS, Linux
|
||||
```
|
||||
git config --global core.autocrlf input
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
cd JetBrainsRuntime
|
||||
git checkout jbr21
|
||||
```
|
||||
|
||||
### Windows
|
||||
<a name="sources-windows"></a>
|
||||
```
|
||||
git config --global core.autocrlf false
|
||||
git clone git@github.com:JetBrains/JetBrainsRuntime.git
|
||||
cd JetBrainsRuntime
|
||||
git checkout jbr21
|
||||
```
|
||||
|
||||
## Configuring the Build Environment
|
||||
Here are quick per-platform instructions for those who can't wait to get started.
|
||||
Please refer to [OpenJDK build docs](https://openjdk.java.net/groups/build/doc/building.html) for in-depth
|
||||
coverage of all the details.
|
||||
|
||||
> **_TIP:_** To get a preliminary report of what's missing, run `./configure` and check its output.
|
||||
> It would usually have meaningful advice on how to solve the problem.
|
||||
|
||||
### Linux (Docker)
|
||||
Create a container:
|
||||
```
|
||||
$ cd jb/project/docker
|
||||
$ docker build .
|
||||
...
|
||||
Successfully built 942ea9900054
|
||||
```
|
||||
Run these commands in the new container:
|
||||
```
|
||||
$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
|
||||
# cd /JetBrainsRuntime
|
||||
# sh ./configure
|
||||
# make images CONF=linux-x86_64-normal-server-release
|
||||
```
|
||||
|
||||
### Ubuntu Linux
|
||||
Install the necessary tools, libraries, and headers with:
|
||||
```
|
||||
$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
|
||||
libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev
|
||||
```
|
||||
Get Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=linux&package=jdk)).
|
||||
|
||||
Then run the following:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/linux-x86_64-server-release/`.
|
||||
|
||||
### Windows
|
||||
<a name="build-windows"></a>
|
||||
Install the following:
|
||||
* [Cygwin x64](http://www.cygwin.com/).
|
||||
Required packages: `autoconf`, `binutils`, `cpio`, `diffutils`, `file`, `gawk`, `gcc-core`, `make`, `m4`, `unzip`, `zip`.
|
||||
Install those together with Cygwin.
|
||||
* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
|
||||
Install with the desktop development kit, which includes Windows SDK and compilers.
|
||||
Visual Studio 2019 is supported by default.
|
||||
* Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=windows&package=jdk)).
|
||||
If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
|
||||
```
|
||||
The first command sets up environment variables, the second starts a Cygwin shell with the proper environment.
|
||||
|
||||
In the Cygwin shell:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ bash configure --with-toolchain-version=2019
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/windows-x86_64-server-release/`.
|
||||
|
||||
### macOS
|
||||
Install the following:
|
||||
* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
|
||||
* Java 19 (for instance, [Azul Zulu Builds of OpenJDK 19](https://www.azul.com/downloads/?version=java-19-sts&os=macos&package=jdk)).
|
||||
|
||||
From the command line:
|
||||
```
|
||||
$ cd JetBrainsRuntime
|
||||
$ git checkout main
|
||||
$ sh ./configure
|
||||
$ make images
|
||||
```
|
||||
This will build the release configuration under `./build/macosx-x86_64-server-release/`.
|
||||
|
||||
## Developing
|
||||
You can use [CLion](https://www.jetbrains.com/clion/) to develop native parts of the JetBrains Runtime and
|
||||
[IntelliJ IDEA](https://www.jetbrains.com/idea/) for the parts written in Java.
|
||||
Both require projects to be created.
|
||||
|
||||
### CLion
|
||||
Run
|
||||
```
|
||||
$ make compile-commands
|
||||
```
|
||||
in the git root and open the resulting `build/.../compile_commands.json` file as a project.
|
||||
Then use `Tools | Compilation Database | Change Project Root` to point to git root of this repository.
|
||||
|
||||
See also this detailed step-by-step tutorial for all platforms:
|
||||
[How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
|
||||
### IDEA
|
||||
Run
|
||||
```
|
||||
$ sh ./bin/idea.sh
|
||||
```
|
||||
in the git root to generate project files (add `--help` for options). If you have multiple
|
||||
configurations (for example, `release` and `fastdebug`), supply the `--conf <conf_name>` argument.
|
||||
Then open the git root directory as a project in IDEA.
|
||||
|
||||
## Contributing
|
||||
We are happy to receive your pull requests!
|
||||
Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
|
||||
|
||||
## Resources
|
||||
* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
|
||||
* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
|
||||
* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
|
||||
* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
|
||||
|
||||
@@ -174,11 +174,3 @@ function copy_jmods() {
|
||||
|
||||
echo "${__mods_list}," | while read -d, mod; do cp $__jmods_from/$mod.jmod $__jmods_to/; done
|
||||
}
|
||||
|
||||
function build_jbr_api() {
|
||||
make jbr-api || do_exit $?
|
||||
|
||||
JBR_API_DIR=build/${RELEASE_NAME}/jbr-api
|
||||
JBR_API_JAR=jbr-api-b${build_number}.jar
|
||||
cp "${JBR_API_DIR}/jbr-api.jar" "${JBR_API_JAR}"
|
||||
}
|
||||
|
||||
@@ -154,12 +154,11 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-aarch64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -154,12 +154,11 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x64-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -134,12 +134,11 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x86-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
gzip "$JBRSDK_TEST".tar || do_exit $?
|
||||
fi
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -158,11 +158,10 @@ if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-${architecture}-b${build_number}
|
||||
echo Creating "$JBRSDK_TEST" ...
|
||||
[ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
|
||||
make test-image CONF=$RELEASE_NAME || do_exit $?
|
||||
make test-image jbr-api CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test"
|
||||
[ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
|
||||
COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -101,13 +101,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
@@ -145,6 +145,4 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -94,13 +94,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
@@ -138,6 +138,4 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -89,13 +89,13 @@ esac
|
||||
if [ -z "${INC_BUILD:-}" ]; then
|
||||
do_configure || do_exit $?
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME clean images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
|
||||
fi
|
||||
else
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
|
||||
make LOG=info CONF=$RELEASE_NAME images test-image jbr-api JBR_API_JBR_VERSION=TEST || do_exit $?
|
||||
else
|
||||
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
|
||||
fi
|
||||
@@ -128,6 +128,4 @@ if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type
|
||||
fi
|
||||
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
|
||||
|
||||
build_jbr_api
|
||||
|
||||
do_exit 0
|
||||
|
||||
@@ -51,6 +51,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -51,6 +51,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x64-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -32,6 +32,8 @@ function pack_jbr {
|
||||
[ "$bundle_type" == "nomod" ] && bundle_type=""
|
||||
|
||||
JBRSDK_BUNDLE=jbrsdk
|
||||
RELEASE_NAME=windows-x86_64-server-release
|
||||
IMAGES_DIR=build/$RELEASE_NAME/images
|
||||
BASE_DIR=.
|
||||
|
||||
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
|
||||
@@ -45,6 +47,7 @@ pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
|
||||
|
||||
if [ $do_maketest -eq 1 ]; then
|
||||
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x86-b$build_number
|
||||
cp "build/${RELEASE_NAME}/jbr-api/jbr-api.jar" "${IMAGES_DIR}/test" || do_exit $?
|
||||
echo Creating $JBRSDK_TEST.tar.gz ...
|
||||
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $BASE_DIR --exclude='test/jdk/demos' test || do_exit $?
|
||||
fi
|
||||
@@ -64,139 +64,140 @@ static struct _key
|
||||
{
|
||||
unsigned short keyCode;
|
||||
BOOL postsTyped;
|
||||
BOOL variesBetweenLayouts;
|
||||
jint javaKeyLocation;
|
||||
jint javaKeyCode;
|
||||
}
|
||||
const keyTable[] =
|
||||
{
|
||||
{0x00, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_A},
|
||||
{0x01, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_S},
|
||||
{0x02, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_D},
|
||||
{0x03, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_F},
|
||||
{0x04, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_H},
|
||||
{0x05, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_G},
|
||||
{0x06, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Z},
|
||||
{0x07, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_X},
|
||||
{0x08, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_C},
|
||||
{0x09, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_V},
|
||||
{0x0A, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_QUOTE},
|
||||
{0x0B, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_B},
|
||||
{0x0C, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Q},
|
||||
{0x0D, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_W},
|
||||
{0x0E, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_E},
|
||||
{0x0F, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_R},
|
||||
{0x10, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Y},
|
||||
{0x11, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_T},
|
||||
{0x12, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_1},
|
||||
{0x13, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_2},
|
||||
{0x14, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_3},
|
||||
{0x15, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_4},
|
||||
{0x16, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_6},
|
||||
{0x17, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_5},
|
||||
{0x18, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_EQUALS},
|
||||
{0x19, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_9},
|
||||
{0x1A, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_7},
|
||||
{0x1B, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_MINUS},
|
||||
{0x1C, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_8},
|
||||
{0x1D, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_0},
|
||||
{0x1E, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_CLOSE_BRACKET},
|
||||
{0x1F, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_O},
|
||||
{0x20, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_U},
|
||||
{0x21, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_OPEN_BRACKET},
|
||||
{0x22, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_I},
|
||||
{0x23, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_P},
|
||||
{0x24, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x25, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_L},
|
||||
{0x26, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_J},
|
||||
{0x27, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_QUOTE},
|
||||
{0x28, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_K},
|
||||
{0x29, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_SEMICOLON},
|
||||
{0x2A, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SLASH},
|
||||
{0x2B, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_COMMA},
|
||||
{0x2C, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_SLASH},
|
||||
{0x2D, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_N},
|
||||
{0x2E, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_M},
|
||||
{0x2F, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_PERIOD},
|
||||
{0x30, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_TAB},
|
||||
{0x31, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_SPACE},
|
||||
{0x32, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_QUOTE},
|
||||
{0x33, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SPACE},
|
||||
{0x34, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x35, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_ESCAPE},
|
||||
{0x36, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x37, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_META}, // ****
|
||||
{0x38, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_SHIFT}, // ****
|
||||
{0x39, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_CAPS_LOCK},
|
||||
{0x3A, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_ALT}, // ****
|
||||
{0x3B, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_CONTROL}, // ****
|
||||
{0x3C, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x3D, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_ALT_GRAPH},
|
||||
{0x3E, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x3F, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED}, // the 'fn' key on PowerBooks
|
||||
{0x40, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F17},
|
||||
{0x41, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_DECIMAL},
|
||||
{0x42, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x43, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_MULTIPLY},
|
||||
{0x44, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x45, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_ADD},
|
||||
{0x46, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x47, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_CLEAR},
|
||||
{0x48, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x49, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4A, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4B, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_DIVIDE},
|
||||
{0x4C, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x4D, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4E, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_SUBTRACT},
|
||||
{0x4F, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F18},
|
||||
{0x50, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F19},
|
||||
{0x51, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_EQUALS},
|
||||
{0x52, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD0},
|
||||
{0x53, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD1},
|
||||
{0x54, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD2},
|
||||
{0x55, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD3},
|
||||
{0x56, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD4},
|
||||
{0x57, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD5},
|
||||
{0x58, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD6},
|
||||
{0x59, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD7},
|
||||
{0x5A, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F20},
|
||||
{0x5B, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD8},
|
||||
{0x5C, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD9},
|
||||
{0x5D, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SLASH}, // This is a combo yen/backslash on JIS keyboards.
|
||||
{0x5E, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_UNDERSCORE},
|
||||
{0x5F, YES, KL_NUMPAD, java_awt_event_KeyEvent_VK_COMMA},
|
||||
{0x60, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F5},
|
||||
{0x61, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F6},
|
||||
{0x62, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F7},
|
||||
{0x63, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F3},
|
||||
{0x64, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F8},
|
||||
{0x65, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F9},
|
||||
{0x66, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_ALPHANUMERIC},
|
||||
{0x67, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F11},
|
||||
{0x68, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_KATAKANA},
|
||||
{0x69, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F13},
|
||||
{0x6A, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F16},
|
||||
{0x6B, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F14},
|
||||
{0x6C, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x6D, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F10},
|
||||
{0x6E, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x6F, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F12},
|
||||
{0x70, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x71, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F15},
|
||||
{0x72, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_HELP},
|
||||
{0x73, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_HOME},
|
||||
{0x74, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_PAGE_UP},
|
||||
{0x75, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_DELETE},
|
||||
{0x76, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F4},
|
||||
{0x77, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_END},
|
||||
{0x78, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F2},
|
||||
{0x79, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_PAGE_DOWN},
|
||||
{0x7A, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F1},
|
||||
{0x7B, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_LEFT},
|
||||
{0x7C, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_RIGHT},
|
||||
{0x7D, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_DOWN},
|
||||
{0x7E, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_UP},
|
||||
{0x7F, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x00, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_A},
|
||||
{0x01, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_S},
|
||||
{0x02, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_D},
|
||||
{0x03, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_F},
|
||||
{0x04, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_H},
|
||||
{0x05, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_G},
|
||||
{0x06, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Z},
|
||||
{0x07, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_X},
|
||||
{0x08, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_C},
|
||||
{0x09, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_V},
|
||||
{0x0A, YES, YES, KL_STANDARD, 0x1000000 + 0x00A7},
|
||||
{0x0B, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_B},
|
||||
{0x0C, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Q},
|
||||
{0x0D, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_W},
|
||||
{0x0E, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_E},
|
||||
{0x0F, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_R},
|
||||
{0x10, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_Y},
|
||||
{0x11, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_T},
|
||||
{0x12, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_1},
|
||||
{0x13, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_2},
|
||||
{0x14, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_3},
|
||||
{0x15, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_4},
|
||||
{0x16, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_6},
|
||||
{0x17, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_5},
|
||||
{0x18, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_EQUALS},
|
||||
{0x19, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_9},
|
||||
{0x1A, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_7},
|
||||
{0x1B, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_MINUS},
|
||||
{0x1C, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_8},
|
||||
{0x1D, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_0},
|
||||
{0x1E, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_CLOSE_BRACKET},
|
||||
{0x1F, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_O},
|
||||
{0x20, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_U},
|
||||
{0x21, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_OPEN_BRACKET},
|
||||
{0x22, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_I},
|
||||
{0x23, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_P},
|
||||
{0x24, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x25, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_L},
|
||||
{0x26, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_J},
|
||||
{0x27, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_QUOTE},
|
||||
{0x28, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_K},
|
||||
{0x29, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_SEMICOLON},
|
||||
{0x2A, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SLASH},
|
||||
{0x2B, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_COMMA},
|
||||
{0x2C, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_SLASH},
|
||||
{0x2D, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_N},
|
||||
{0x2E, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_M},
|
||||
{0x2F, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_PERIOD},
|
||||
{0x30, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_TAB},
|
||||
{0x31, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_SPACE},
|
||||
{0x32, YES, YES, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_QUOTE},
|
||||
{0x33, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SPACE},
|
||||
{0x34, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x35, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_ESCAPE},
|
||||
{0x36, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x37, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_META}, // ****
|
||||
{0x38, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_SHIFT}, // ****
|
||||
{0x39, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_CAPS_LOCK},
|
||||
{0x3A, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_ALT}, // ****
|
||||
{0x3B, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_CONTROL}, // ****
|
||||
{0x3C, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x3D, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_ALT_GRAPH},
|
||||
{0x3E, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x3F, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED}, // the 'fn' key on PowerBooks
|
||||
{0x40, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F17},
|
||||
{0x41, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_DECIMAL},
|
||||
{0x42, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x43, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_MULTIPLY},
|
||||
{0x44, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x45, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_ADD},
|
||||
{0x46, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x47, NO, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_CLEAR},
|
||||
{0x48, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x49, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4A, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4B, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_DIVIDE},
|
||||
{0x4C, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_ENTER},
|
||||
{0x4D, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x4E, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_SUBTRACT},
|
||||
{0x4F, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F18},
|
||||
{0x50, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F19},
|
||||
{0x51, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_EQUALS},
|
||||
{0x52, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD0},
|
||||
{0x53, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD1},
|
||||
{0x54, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD2},
|
||||
{0x55, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD3},
|
||||
{0x56, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD4},
|
||||
{0x57, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD5},
|
||||
{0x58, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD6},
|
||||
{0x59, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD7},
|
||||
{0x5A, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F20},
|
||||
{0x5B, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD8},
|
||||
{0x5C, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_NUMPAD9},
|
||||
{0x5D, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_BACK_SLASH}, // This is a combo yen/backslash on JIS keyboards.
|
||||
{0x5E, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_UNDERSCORE},
|
||||
{0x5F, YES, NO, KL_NUMPAD, java_awt_event_KeyEvent_VK_COMMA},
|
||||
{0x60, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F5},
|
||||
{0x61, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F6},
|
||||
{0x62, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F7},
|
||||
{0x63, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F3},
|
||||
{0x64, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F8},
|
||||
{0x65, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F9},
|
||||
{0x66, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_ALPHANUMERIC},
|
||||
{0x67, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F11},
|
||||
{0x68, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_KATAKANA},
|
||||
{0x69, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F13},
|
||||
{0x6A, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F16},
|
||||
{0x6B, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F14},
|
||||
{0x6C, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x6D, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F10},
|
||||
{0x6E, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x6F, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F12},
|
||||
{0x70, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
{0x71, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F15},
|
||||
{0x72, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_HELP},
|
||||
{0x73, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_HOME},
|
||||
{0x74, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_PAGE_UP},
|
||||
{0x75, YES, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_DELETE},
|
||||
{0x76, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F4},
|
||||
{0x77, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_END},
|
||||
{0x78, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F2},
|
||||
{0x79, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_PAGE_DOWN},
|
||||
{0x7A, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_F1},
|
||||
{0x7B, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_LEFT},
|
||||
{0x7C, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_RIGHT},
|
||||
{0x7D, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_DOWN},
|
||||
{0x7E, NO, NO, KL_STANDARD, java_awt_event_KeyEvent_VK_UP},
|
||||
{0x7F, NO, NO, KL_UNKNOWN, java_awt_event_KeyEvent_VK_UNDEFINED},
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -488,6 +489,7 @@ NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
|
||||
unichar *deadChar)
|
||||
{
|
||||
static const size_t keyTableSize = sizeof(keyTable) / sizeof(struct _key);
|
||||
|
||||
NSInteger offset;
|
||||
|
||||
// If the key without modifiers generates a dead char, then this is the character
|
||||
@@ -517,6 +519,24 @@ NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
|
||||
}
|
||||
}
|
||||
|
||||
if (key < keyTableSize) {
|
||||
// US physical key -> character mapping
|
||||
*postsTyped = keyTable[key].postsTyped;
|
||||
*keyCode = keyTable[key].javaKeyCode;
|
||||
*keyLocation = keyTable[key].javaKeyLocation;
|
||||
|
||||
if (!keyTable[key].variesBetweenLayouts) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Should we report this? This means we've got a keyboard
|
||||
// we don't know about...
|
||||
*postsTyped = NO;
|
||||
*keyCode = java_awt_event_KeyEvent_VK_UNDEFINED;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
|
||||
return;
|
||||
}
|
||||
|
||||
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
|
||||
|
||||
// Whether this is a latin-based keyboard layout (English, German, French, etc)
|
||||
@@ -525,11 +545,17 @@ NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
|
||||
|
||||
unichar testLowercaseChar = tolower(ch);
|
||||
|
||||
if (useNationalLayouts && asciiCapable) {
|
||||
if (!useNationalLayouts || asciiCapable) {
|
||||
// If national layouts are enabled and the current keyboard is latin-based then
|
||||
// we try to look up a character in a table first, before falling back to looking up
|
||||
// the virtual key code from macOS's hardware key code, since hardware key codes
|
||||
// don't respect the specific keyboard layout the user uses.
|
||||
// The same happens when the national layouts are disabled to be consistent
|
||||
// with the default behavior of OpenJDK.
|
||||
|
||||
// Together with the following two checks (letters and digits) this table
|
||||
// properly handles all keys that have corresponding VK_ codes.
|
||||
// Unfortunately not all keys are like that. They are handled separately.
|
||||
|
||||
for (const struct CharToVKEntry *map = extraCharToVKTable; map->c != 0; ++map) {
|
||||
if (map->c == testLowercaseChar) {
|
||||
@@ -541,62 +567,43 @@ NsCharToJavaVirtualKeyCode(unichar ch, BOOL isDeadChar,
|
||||
}
|
||||
}
|
||||
|
||||
if ((!useNationalLayouts || asciiCapable) && [[NSCharacterSet letterCharacterSet] characterIsMember:ch]) {
|
||||
// Let's convert the received letter to a key code.
|
||||
// If national layouts are enabled, then the letter must be (extended) latin.
|
||||
// Otherwise, we will look up the key code from the key location further down below.
|
||||
|
||||
// key is an alphabetic character
|
||||
offset = testLowercaseChar - 'a';
|
||||
if (offset >= 0 && offset <= 25) {
|
||||
// checking for A-Z characters
|
||||
*postsTyped = YES;
|
||||
// do quick conversion
|
||||
*keyCode = java_awt_event_KeyEvent_VK_A + offset;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
} else {
|
||||
// checking for non-english characters
|
||||
// this value comes from ExtendedKeyCodes.java
|
||||
offset += 0x01000000;
|
||||
*postsTyped = YES;
|
||||
// do quick conversion
|
||||
// the keyCode is off by 32, so adding it here
|
||||
*keyCode = java_awt_event_KeyEvent_VK_A + offset + 32;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
}
|
||||
|
||||
if (testLowercaseChar >= 'a' && testLowercaseChar <= 'z') {
|
||||
// key is a basic latin letter
|
||||
*postsTyped = YES;
|
||||
*keyCode = java_awt_event_KeyEvent_VK_A + testLowercaseChar - 'a';
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
return;
|
||||
}
|
||||
|
||||
if ([[NSCharacterSet decimalDigitCharacterSet] characterIsMember:ch]) {
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
// key is a digit
|
||||
// numpad digits are already handled, since they don't vary between layouts
|
||||
offset = ch - '0';
|
||||
// make sure in range for decimal digits
|
||||
if (offset >= 0 && offset <= 9) {
|
||||
jboolean numpad = ((flags & NSNumericPadKeyMask) &&
|
||||
(key > 81 && key < 93));
|
||||
*postsTyped = YES;
|
||||
if (numpad) {
|
||||
*keyCode = offset + java_awt_event_KeyEvent_VK_NUMPAD0;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_NUMPAD;
|
||||
} else {
|
||||
*keyCode = offset + java_awt_event_KeyEvent_VK_0;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
}
|
||||
return;
|
||||
}
|
||||
*keyCode = offset + java_awt_event_KeyEvent_VK_0;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
return;
|
||||
}
|
||||
|
||||
if (key < keyTableSize) {
|
||||
*postsTyped = keyTable[key].postsTyped;
|
||||
*keyCode = keyTable[key].javaKeyCode;
|
||||
*keyLocation = keyTable[key].javaKeyLocation;
|
||||
} else {
|
||||
// Should we report this? This means we've got a keyboard
|
||||
// we don't know about...
|
||||
*postsTyped = NO;
|
||||
*keyCode = java_awt_event_KeyEvent_VK_UNDEFINED;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN;
|
||||
BOOL isLetter = [[NSCharacterSet letterCharacterSet] characterIsMember:ch];
|
||||
BOOL needExtendedKeyCodeConversion = useNationalLayouts ? asciiCapable : isLetter;
|
||||
|
||||
if (needExtendedKeyCodeConversion) {
|
||||
// If useNationalLayouts = false, then we only convert the key codes for letters here.
|
||||
// This is the default behavior in OpenJDK and I don't think it's a good idea to change that.
|
||||
|
||||
// If useNationalLayouts = true but the keyboard is not ASCII-capable then this conversion
|
||||
// doesn't happen, meaning that key codes remain in the US layout.
|
||||
|
||||
// Otherwise we also need to report characters other than letters.
|
||||
// If we ended up in this branch, this means that the character doesn't have its own VK_ code.
|
||||
// Apart from letters, this is the case for characters like the Section Sign (U+00A7) on the
|
||||
// US ISO English keyboard or the Left-Pointing Double Angle Quotation Mark (U+00AB) found on the
|
||||
// Canadian French - PC (ISO) keyboard. I couldn't find examples of ANSI keyboards that have non-letter
|
||||
// characters that don't have a VK_ code.
|
||||
|
||||
*postsTyped = YES;
|
||||
*keyCode = 0x01000000 + testLowercaseChar;
|
||||
*keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_STANDARD;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
[self setUpCustomTitleBar];
|
||||
}
|
||||
|
||||
self.currentDisplayID = nil;
|
||||
self.currentDisplayID = [AWTWindow getNSWindowDisplayID_AppKitThread:nsWindow];;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -838,8 +838,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
}
|
||||
|
||||
if (self.currentDisplayID == nil) {
|
||||
// Do not trigger notification at first appearance
|
||||
// to avoid flickering on popups
|
||||
// Do not trigger notification at first initialization
|
||||
self.currentDisplayID = newDisplayID;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#import "JNIUtilities.h"
|
||||
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
#import "CRobotKeyCode.h"
|
||||
#import "LWCToolkit.h"
|
||||
@@ -324,7 +325,26 @@ Java_sun_lwawt_macosx_CRobot_keyEvent
|
||||
autoDelay(NO);
|
||||
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
|
||||
CGEventSourceRef source = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
|
||||
CGKeyCode keyCode = GetCGKeyCode(javaKeyCode);
|
||||
CGKeyCode keyCode;
|
||||
if (javaKeyCode == 0x1000000 + 0x0060) {
|
||||
// This is a dirty, dirty hack and is only used in tests.
|
||||
// When receiving this key code, Robot should switch the keyboard type to ISO
|
||||
// and then send the key code corresponding to VK_BACK_QUOTE.
|
||||
|
||||
// find an ISO keyboard type...
|
||||
// LMGetKbdType() returns Uint8, why don't we just iterate over all the possible values and find one
|
||||
// that works? It's really sad that macOS doesn't provide a decent API for this sort of thing.
|
||||
for (UInt32 keyboardType = 0; keyboardType < 0x100; ++keyboardType) {
|
||||
if (KBGetLayoutType(keyboardType) == kKeyboardISO) {
|
||||
CGEventSourceSetKeyboardType(source, keyboardType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
keyCode = OSX_kVK_ANSI_Grave;
|
||||
} else {
|
||||
keyCode = GetCGKeyCode(javaKeyCode);
|
||||
}
|
||||
CGEventRef event = CGEventCreateKeyboardEvent(source, keyCode, keyPressed);
|
||||
if (event != NULL) {
|
||||
// this assumes Robot isn't used to generate Fn key presses
|
||||
|
||||
@@ -160,6 +160,11 @@
|
||||
[NSNumber numberWithInt : OSX_F19], [NSNumber numberWithInt : java_awt_event_KeyEvent_VK_F19],
|
||||
[NSNumber numberWithInt : OSX_F20], [NSNumber numberWithInt : java_awt_event_KeyEvent_VK_F20],
|
||||
|
||||
// There's no VK_ key code for the section key (\u00a7), found on the Standard QWERTY (ABC) ISO layout.
|
||||
// For consistency, let's use the code returned by getExtendedKeyCodeForChar for this symbol.
|
||||
// Also see src/java.desktop/share/classes/sun/awt/ExtendedKeyCodes.java
|
||||
[NSNumber numberWithInt : OSX_kVK_ISO_Section], [NSNumber numberWithInt : 0x1000000 + 0x00A7],
|
||||
|
||||
nil];
|
||||
}
|
||||
|
||||
|
||||
@@ -266,17 +266,20 @@ class WFramePeer extends WWindowPeer implements FramePeer {
|
||||
}
|
||||
private static native void updateCustomTitleBar(WWindowPeer peer);
|
||||
|
||||
// Used from native
|
||||
private static final boolean WIN11_OR_NEWER;
|
||||
static {
|
||||
if ("Windows 10".equals(System.getProperty("os.name"))) {
|
||||
WIN11_OR_NEWER = false;
|
||||
@SuppressWarnings("removal")
|
||||
private static boolean isWin11OrNewer() {
|
||||
String osName = AccessController.doPrivileged(new GetPropertyAction("os.name"));
|
||||
String osVersion = AccessController.doPrivileged(new GetPropertyAction("os.version"));
|
||||
if ("Windows 10".equals(osName)) {
|
||||
return false;
|
||||
} else {
|
||||
int version = 10;
|
||||
try {
|
||||
version = (int) Double.parseDouble(System.getProperty("os.version"));
|
||||
version = (int) Double.parseDouble(osVersion);
|
||||
} catch (NullPointerException | NumberFormatException ignored) {}
|
||||
WIN11_OR_NEWER = version >= 10;
|
||||
return version >= 10;
|
||||
}
|
||||
}
|
||||
// Used from native
|
||||
private static final boolean WIN11_OR_NEWER = isWin11OrNewer();
|
||||
}
|
||||
|
||||
@@ -552,7 +552,6 @@ MsgRouting AwtFrame::WmMouseUp(UINT flags, int x, int y, int button) {
|
||||
}
|
||||
|
||||
MsgRouting AwtFrame::WmMouseMove(UINT flags, int x, int y) {
|
||||
if (customTitleBarControls) customTitleBarControls->Hit(CustomTitleBarControls::HitType::RESET, 0, 0);
|
||||
/**
|
||||
* If this Frame is non-focusable then we should implement move and size operation for it by
|
||||
* ourselfves because we don't dispatch appropriate mouse messages to default window procedure.
|
||||
|
||||
@@ -24,12 +24,14 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.awt.AWTException;
|
||||
import java.awt.Button;
|
||||
import java.awt.Robot;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@@ -48,16 +50,26 @@ import java.awt.event.InputEvent;
|
||||
public class ActionListenerTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), actionListener);
|
||||
TaskResult awtResult = CommonAPISuite.runTestSuite(List.of(TestUtils::createFrameWithCustomTitleBar, TestUtils::createDialogWithCustomTitleBar), actionListenerAWT);
|
||||
TaskResult swingResult = CommonAPISuite.runTestSuite(List.of(TestUtils::createJFrameWithCustomTitleBar, TestUtils::createJFrameWithCustomTitleBar), actionListenerSwing);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("ActionListenerTest FAILED");
|
||||
TaskResult result = awtResult.merge(swingResult);
|
||||
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Task actionListener = new Task("Using of action listener") {
|
||||
private static final Task actionListenerAWT = new Task("Using of action listener in AWT") {
|
||||
|
||||
private Button button;
|
||||
private boolean actionListenerGotEvent = false;
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
actionListenerGotEvent = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareTitleBar() {
|
||||
@@ -68,38 +80,76 @@ public class ActionListenerTest {
|
||||
@Override
|
||||
public void customizeWindow() {
|
||||
button = new Button();
|
||||
button.setBounds(200, 20, 50, 50);
|
||||
button.setLocation(window.getWidth() / 2, 0);
|
||||
button.addActionListener(a -> {
|
||||
System.out.println("Action listener got event");
|
||||
actionListenerGotEvent = true;
|
||||
});
|
||||
window.add(button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void test() throws AWTException {
|
||||
final int initialHeight = window.getHeight();
|
||||
final int initialWidth = window.getWidth();
|
||||
doClick(button.getLocationOnScreen(), button.getWidth(), button.getHeight());
|
||||
|
||||
System.out.println("Initial bounds: " + window.getBounds());
|
||||
|
||||
Robot robot = new Robot();
|
||||
robot.delay(500);
|
||||
int x = button.getLocationOnScreen().x + button.getWidth() / 2;
|
||||
int y = button.getLocationOnScreen().y + button.getHeight() / 2;
|
||||
System.out.println("Click at (" + x + ", " + y + ")");
|
||||
robot.mouseMove(x, y);
|
||||
robot.delay(300);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(2000);
|
||||
|
||||
if (window.getHeight() != initialHeight || window.getWidth() != initialWidth) {
|
||||
passed = false;
|
||||
System.out.println("Adding of action listener should block native title bar behavior");
|
||||
if (!actionListenerGotEvent) {
|
||||
err("button didn't get event by action listener");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static final Task actionListenerSwing = new Task("Using of action listener in Swing") {
|
||||
|
||||
private JButton button;
|
||||
private boolean actionListenerGotEvent = false;
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
actionListenerGotEvent = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareTitleBar() {
|
||||
titleBar = JBR.getWindowDecorations().createCustomTitleBar();
|
||||
titleBar.setHeight(TestUtils.TITLE_BAR_HEIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customizeWindow() {
|
||||
button = new JButton();
|
||||
button.setLocation(window.getWidth() / 2, 0);
|
||||
button.addActionListener(a -> {
|
||||
actionListenerGotEvent = true;
|
||||
});
|
||||
window.add(button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void test() throws AWTException {
|
||||
doClick(button.getLocationOnScreen(), button.getWidth(), button.getHeight());
|
||||
|
||||
if (!actionListenerGotEvent) {
|
||||
err("button didn't get event by action listener");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static void doClick(Point location, int w, int h) throws AWTException {
|
||||
Robot robot = new Robot();
|
||||
robot.waitForIdle();
|
||||
int x = location.x + w / 2;
|
||||
int y = location.y + h / 2;
|
||||
System.out.println("Click at (" + x + ", " + y + ")");
|
||||
robot.mouseMove(x, y);
|
||||
robot.waitForIdle();
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,8 +24,11 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Verify modifying of title bar height
|
||||
@@ -43,11 +46,13 @@ import util.TestUtils;
|
||||
public class ChangeTitleBarHeightTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), changeTitleBarHeight);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), changeTitleBarHeight);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("ChangeTitleBarHeightTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Task changeTitleBarHeight = new Task("Changing of title bar height") {
|
||||
|
||||
@@ -24,8 +24,11 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @summary Verify creating to a custom title bar
|
||||
@@ -43,11 +46,13 @@ import util.TestUtils;
|
||||
public class CreateTitleBarTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), createTitleBar);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), createTitleBar);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("CreateTitleBarTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Task createTitleBar = new Task("Create title bar with default settings") {
|
||||
@@ -64,8 +69,7 @@ public class CreateTitleBarTest {
|
||||
passed = passed && TestUtils.checkFrameInsets(window);
|
||||
|
||||
if (titleBar.getLeftInset() == 0 && titleBar.getRightInset() == 0) {
|
||||
passed = false;
|
||||
System.out.println("Left or right space must be occupied by system controls");
|
||||
err("Left or right space must be occupied by system controls");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,10 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
@@ -32,6 +29,7 @@ import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -51,11 +49,13 @@ import java.util.List;
|
||||
public class DialogNativeControlsTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = nativeControlClicks.run(TestUtils::createDialogWithCustomTitleBar);
|
||||
TaskResult result = nativeControlClicks.run(TestUtils::createDialogWithCustomTitleBar);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("DialogNativeControlsTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Task nativeControlClicks = new Task("Native controls clicks") {
|
||||
@@ -105,13 +105,13 @@ public class DialogNativeControlsTest {
|
||||
|
||||
@Override
|
||||
public void test() throws Exception {
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(window.getLocationOnScreen().x + window.getWidth() / 2,
|
||||
window.getLocationOnScreen().y + window.getHeight() / 2);
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
if (foundControls.size() == 0) {
|
||||
passed = false;
|
||||
@@ -129,24 +129,22 @@ public class DialogNativeControlsTest {
|
||||
int h = window.getBounds().height;
|
||||
int w = window.getBounds().width;
|
||||
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
window.setBounds(screenX, screenY, w, h);
|
||||
window.setVisible(true);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
});
|
||||
|
||||
if (System.getProperty("os.name").toLowerCase().startsWith("mac") && !maximizingActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: maximizing action was not detected");
|
||||
err("maximizing action was not detected");
|
||||
}
|
||||
|
||||
if (!closingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: closing action was not detected");
|
||||
err("closing action was not detected");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,11 +22,7 @@
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import com.jetbrains.WindowDecorations;
|
||||
import util.CommonAPISuite;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import java.awt.Frame;
|
||||
@@ -37,6 +33,7 @@ import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -61,11 +58,13 @@ public class FrameNativeControlsMacOSTest {
|
||||
public static void main(String... args) {
|
||||
List<Function<WindowDecorations.CustomTitleBar, Window>> functions =
|
||||
List.of(TestUtils::createFrameWithCustomTitleBar, TestUtils::createJFrameWithCustomTitleBar);
|
||||
boolean status = CommonAPISuite.runTestSuite(functions, frameNativeControlsClicks);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(functions, frameNativeControlsClicks);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("FrameNativeControlsMacOSTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Task frameNativeControlsClicks = new Task("Frame native controls clicks") {
|
||||
@@ -164,7 +163,7 @@ public class FrameNativeControlsMacOSTest {
|
||||
robot.delay(500);
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
if (foundControls.size() == 0) {
|
||||
passed = false;
|
||||
@@ -193,22 +192,18 @@ public class FrameNativeControlsMacOSTest {
|
||||
});
|
||||
|
||||
if (!maximizingActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: maximizing action was not detected");
|
||||
err("maximizing action was not detected");
|
||||
}
|
||||
|
||||
if (!closingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: closing action was not detected");
|
||||
err("closing action was not detected");
|
||||
}
|
||||
|
||||
if (!iconifyingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: iconifying action was not detected");
|
||||
err("iconifying action was not detected");
|
||||
}
|
||||
if (!deiconifyindActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: deiconifying action was not detected");
|
||||
err("deiconifying action was not detected");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,18 +21,21 @@
|
||||
* questions.
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import com.jetbrains.WindowDecorations;
|
||||
import util.*;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@@ -51,10 +54,13 @@ import java.util.List;
|
||||
public class FrameNativeControlsTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = frameNativeControlsClicks.run(TestUtils::createFrameWithCustomTitleBar);
|
||||
List<Function<WindowDecorations.CustomTitleBar, Window>> functions =
|
||||
List.of(TestUtils::createFrameWithCustomTitleBar, TestUtils::createJFrameWithCustomTitleBar);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(functions, frameNativeControlsClicks);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("FrameNativeControlsTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +79,15 @@ public class FrameNativeControlsTest {
|
||||
@Override
|
||||
public void windowIconified(WindowEvent e) {
|
||||
iconifyingActionCalled = true;
|
||||
|
||||
if (window.getName().equals("Frame")) {
|
||||
((Frame) window).setState(Frame.NORMAL);
|
||||
} else if (window.getName().equals("JFrame")) {
|
||||
((JFrame) window).setState(JFrame.NORMAL);
|
||||
}
|
||||
|
||||
window.setVisible(true);
|
||||
window.requestFocus();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -124,7 +138,7 @@ public class FrameNativeControlsTest {
|
||||
robot.delay(500);
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
if (foundControls.size() == 0) {
|
||||
passed = false;
|
||||
@@ -142,33 +156,29 @@ public class FrameNativeControlsTest {
|
||||
int h = window.getBounds().height;
|
||||
int w = window.getBounds().width;
|
||||
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
window.setBounds(screenX, screenY, w, h);
|
||||
window.setVisible(true);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
});
|
||||
|
||||
if (!maximizingActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: maximizing action was not detected");
|
||||
err("maximizing action was not detected");
|
||||
}
|
||||
|
||||
if (!closingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: closing action was not detected");
|
||||
err("closing action was not detected");
|
||||
}
|
||||
|
||||
if (!iconifyingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: iconifying action was not detected");
|
||||
err("iconifying action was not detected");
|
||||
}
|
||||
if (!deiconifyindActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: deiconifying action was not detected");
|
||||
err("deiconifying action was not detected");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -21,14 +21,11 @@
|
||||
* questions.
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Robot;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -48,10 +45,11 @@ import java.util.List;
|
||||
public class HiddenNativeControlsTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), hiddenControls);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), hiddenControls);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("HiddenNativeControlsTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,25 +75,22 @@ public class HiddenNativeControlsTest {
|
||||
passed = passed && TestUtils.checkFrameInsets(window);
|
||||
|
||||
if (!"false".equals(titleBar.getProperties().get(PROPERTY_NAME).toString())) {
|
||||
passed = false;
|
||||
System.out.println("controls.visible isn't false");
|
||||
err("controls.visible isn't false");
|
||||
}
|
||||
if (titleBar.getLeftInset() != 0 || titleBar.getRightInset() != 0) {
|
||||
passed = false;
|
||||
System.out.println("System controls are hidden so insets must be zero");
|
||||
err("System controls are hidden so insets must be zero");
|
||||
}
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
|
||||
System.out.println("image w = " + image.getWidth() + " h = " + image.getHeight());
|
||||
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar, true);
|
||||
System.out.println("Found controls at the title bar:");
|
||||
foundControls.forEach(System.out::println);
|
||||
|
||||
if (foundControls.size() != 0) {
|
||||
passed = false;
|
||||
System.out.println("Error: there are must be 0 controls");
|
||||
err("controls are disabled, but found in the screenshot");
|
||||
}
|
||||
|
||||
if (!passed) {
|
||||
|
||||
@@ -24,8 +24,12 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import java.awt.AWTException;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
@@ -36,6 +40,8 @@ import java.awt.Robot;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -55,14 +61,17 @@ import java.util.List;
|
||||
public class HitTestClientArea {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), hitTestClientArea);
|
||||
TaskResult awtResult = CommonAPISuite.runTestSuite(List.of(TestUtils::createFrameWithCustomTitleBar, TestUtils::createDialogWithCustomTitleBar), hitTestClientAreaAWT);
|
||||
TaskResult swingResult = CommonAPISuite.runTestSuite(List.of(TestUtils::createJFrameWithCustomTitleBar, TestUtils::createJFrameWithCustomTitleBar), hitTestClientAreaSwing);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("HitTestClientArea FAILED");
|
||||
TaskResult result = awtResult.merge(swingResult);
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Task hitTestClientArea = new Task("Hit test client area") {
|
||||
private static final Task hitTestClientAreaAWT = new Task("Hit test client area AWT") {
|
||||
|
||||
private static final List<Integer> BUTTON_MASKS = List.of(
|
||||
InputEvent.BUTTON1_DOWN_MASK,
|
||||
@@ -72,13 +81,17 @@ public class HitTestClientArea {
|
||||
private static final int PANEL_WIDTH = 400;
|
||||
private static final int PANEL_HEIGHT = (int) TestUtils.TITLE_BAR_HEIGHT;
|
||||
|
||||
private final boolean[] gotClicks = new boolean[BUTTON_MASKS.size()];
|
||||
private final int[] gotClicks = new int[BUTTON_MASKS.size()];
|
||||
private static boolean mousePressed = false;
|
||||
private static boolean mouseReleased = false;
|
||||
|
||||
private Panel panel;
|
||||
|
||||
@Override
|
||||
protected void cleanup() {
|
||||
super.cleanup();
|
||||
Arrays.fill(gotClicks, 0);
|
||||
mousePressed = false;
|
||||
mouseReleased = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,33 +122,20 @@ public class HitTestClientArea {
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
hit();
|
||||
if (e.getButton() >= 1 && e.getButton() <= 3) {
|
||||
gotClicks[e.getButton() - 1] = true;
|
||||
gotClicks[e.getButton() - 1]++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
hit();
|
||||
mousePressed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
hit();
|
||||
mouseReleased = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -146,41 +146,182 @@ public class HitTestClientArea {
|
||||
public void test() throws AWTException {
|
||||
Robot robot = new Robot();
|
||||
|
||||
BUTTON_MASKS.forEach(mask -> {
|
||||
robot.delay(500);
|
||||
int initialX = window.getLocationOnScreen().x + PANEL_WIDTH / 2;
|
||||
int initialY = window.getLocationOnScreen().y + PANEL_HEIGHT / 2;
|
||||
|
||||
robot.mouseMove(panel.getLocationOnScreen().x + panel.getWidth() / 2,
|
||||
panel.getLocationOnScreen().y + panel.getHeight() / 2);
|
||||
window.requestFocus();
|
||||
for (Integer mask: BUTTON_MASKS) {
|
||||
robot.waitForIdle();
|
||||
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(mask);
|
||||
robot.mouseRelease(mask);
|
||||
|
||||
robot.delay(500);
|
||||
});
|
||||
robot.waitForIdle();
|
||||
}
|
||||
|
||||
Point initialLocation = window.getLocationOnScreen();
|
||||
robot.delay(500);
|
||||
int initialX = panel.getLocationOnScreen().x + panel.getWidth() / 2;
|
||||
int initialY = panel.getLocationOnScreen().y + panel.getHeight() / 2;
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
initialX += 3;
|
||||
initialY += 3;
|
||||
robot.delay(500);
|
||||
robot.delay(300);
|
||||
robot.mouseMove(initialX, initialY);
|
||||
}
|
||||
robot.delay(500);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
Point newLocation = window.getLocationOnScreen();
|
||||
boolean moved = initialLocation.x < newLocation.x && initialLocation.y < newLocation.y;
|
||||
|
||||
for (int i = 0; i < BUTTON_MASKS.size(); i++) {
|
||||
if (!gotClicks[i]) {
|
||||
System.out.println("Mouse click to button no " + (i+1) + " was not registered");
|
||||
passed = false;
|
||||
System.out.println("Button no " + (i+1) + " clicks count = " + gotClicks[i]);
|
||||
if (gotClicks[i] == 0) {
|
||||
err("Mouse click to button no " + (i+1) + " was not registered");
|
||||
}
|
||||
}
|
||||
passed = passed && !moved;
|
||||
|
||||
boolean moved = initialLocation.x < newLocation.x && initialLocation.y < newLocation.y;
|
||||
if (moved) {
|
||||
err("Window was moved, but drag'n drop action must be disabled in the client area");
|
||||
}
|
||||
|
||||
if (!mousePressed) {
|
||||
err("Mouse press to the client area wasn't detected");
|
||||
}
|
||||
if (!mouseReleased) {
|
||||
err("Mouse release to the client area wasn't detected");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final Task hitTestClientAreaSwing = new Task("Hit test client area Swing") {
|
||||
private static final List<Integer> BUTTON_MASKS = List.of(
|
||||
InputEvent.BUTTON1_DOWN_MASK,
|
||||
InputEvent.BUTTON2_DOWN_MASK,
|
||||
InputEvent.BUTTON3_DOWN_MASK
|
||||
);
|
||||
private static final int PANEL_WIDTH = 400;
|
||||
private static final int PANEL_HEIGHT = (int) TestUtils.TITLE_BAR_HEIGHT;
|
||||
|
||||
private final int[] gotClicks = new int[BUTTON_MASKS.size()];
|
||||
private static boolean mousePressed = false;
|
||||
private static boolean mouseReleased = false;
|
||||
|
||||
private JPanel panel;
|
||||
|
||||
@Override
|
||||
protected void cleanup() {
|
||||
Arrays.fill(gotClicks, 0);
|
||||
mousePressed = false;
|
||||
mouseReleased = false;
|
||||
titleBar = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareTitleBar() {
|
||||
titleBar = JBR.getWindowDecorations().createCustomTitleBar();
|
||||
titleBar.setHeight(TestUtils.TITLE_BAR_HEIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customizeWindow() {
|
||||
|
||||
panel = new JPanel() {
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
Rectangle r = g.getClipBounds();
|
||||
g.setColor(Color.CYAN);
|
||||
g.fillRect(r.x, r.y, PANEL_WIDTH, PANEL_HEIGHT);
|
||||
}
|
||||
};
|
||||
|
||||
if (window.getName().equals("JFrame")) {
|
||||
((JFrame) window).setContentPane(panel);
|
||||
} else if (window.getName().equals("JDialog")) {
|
||||
((JDialog) window).setContentPane(panel);
|
||||
}
|
||||
|
||||
panel.setBounds(0, 0, PANEL_WIDTH, PANEL_HEIGHT);
|
||||
panel.setSize(PANEL_WIDTH, PANEL_HEIGHT);
|
||||
panel.addMouseListener(new MouseAdapter() {
|
||||
private void hit() {
|
||||
titleBar.forceHitTest(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
hit();
|
||||
if (e.getButton() >= 1 && e.getButton() <= 3) {
|
||||
gotClicks[e.getButton() - 1]++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
hit();
|
||||
mousePressed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
hit();
|
||||
mouseReleased = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void test() throws AWTException {
|
||||
Robot robot = new Robot();
|
||||
|
||||
int initialX = window.getLocationOnScreen().x + PANEL_WIDTH / 2;
|
||||
int initialY = window.getLocationOnScreen().y + PANEL_HEIGHT / 2;
|
||||
|
||||
for (Integer mask: BUTTON_MASKS) {
|
||||
robot.waitForIdle();
|
||||
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(mask);
|
||||
robot.mouseRelease(mask);
|
||||
|
||||
robot.waitForIdle();
|
||||
}
|
||||
|
||||
Point initialLocation = window.getLocationOnScreen();
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
initialX += 3;
|
||||
initialY += 3;
|
||||
robot.delay(300);
|
||||
robot.mouseMove(initialX, initialY);
|
||||
}
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
Point newLocation = window.getLocationOnScreen();
|
||||
|
||||
for (int i = 0; i < BUTTON_MASKS.size(); i++) {
|
||||
System.out.println("Button no " + (i+1) + " clicks count = " + gotClicks[i]);
|
||||
if (gotClicks[i] == 0) {
|
||||
err("Mouse click to button no " + (i+1) + " was not registered");
|
||||
}
|
||||
}
|
||||
|
||||
boolean moved = initialLocation.x < newLocation.x && initialLocation.y < newLocation.y;
|
||||
if (moved) {
|
||||
err("Window was moved, but drag'n drop action must be disabled in the client area");
|
||||
}
|
||||
|
||||
if (!mousePressed) {
|
||||
err("Mouse press to the client area wasn't detected");
|
||||
}
|
||||
if (!mouseReleased) {
|
||||
err("Mouse release to the client area wasn't detected");
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.awt.AWTException;
|
||||
@@ -35,6 +36,7 @@ import java.awt.Robot;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -55,10 +57,11 @@ import java.util.List;
|
||||
public class HitTestNonClientArea {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), hitTestNonClientArea);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), hitTestNonClientArea);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("HitTestNonClientArea FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +82,7 @@ public class HitTestNonClientArea {
|
||||
@Override
|
||||
protected void cleanup() {
|
||||
Arrays.fill(gotClicks, false);
|
||||
titleBar = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,21 +118,6 @@ public class HitTestNonClientArea {
|
||||
public void mouseReleased(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
hit();
|
||||
}
|
||||
};
|
||||
button.addMouseListener(adapter);
|
||||
button.addMouseMotionListener(adapter);
|
||||
@@ -143,31 +132,31 @@ public class HitTestNonClientArea {
|
||||
public void test() throws AWTException {
|
||||
Robot robot = new Robot();
|
||||
|
||||
BUTTON_MASKS.forEach(mask -> {
|
||||
robot.delay(500);
|
||||
int initialX = button.getLocationOnScreen().x + button.getWidth() / 2;
|
||||
int initialY = button.getLocationOnScreen().y + button.getHeight() / 2;
|
||||
|
||||
robot.mouseMove(button.getLocationOnScreen().x + button.getWidth() / 2,
|
||||
button.getLocationOnScreen().y + button.getHeight() / 2);
|
||||
for (Integer mask: BUTTON_MASKS) {
|
||||
robot.waitForIdle();
|
||||
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(mask);
|
||||
robot.mouseRelease(mask);
|
||||
|
||||
robot.delay(500);
|
||||
});
|
||||
robot.waitForIdle();
|
||||
}
|
||||
|
||||
Point initialLocation = window.getLocationOnScreen();
|
||||
robot.delay(500);
|
||||
int initialX = button.getLocationOnScreen().x + button.getWidth() / 2;
|
||||
int initialY = button.getLocationOnScreen().y + button.getHeight() / 2;
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(initialX, initialY);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
initialX += 3;
|
||||
initialY += 3;
|
||||
robot.delay(500);
|
||||
robot.delay(300);
|
||||
robot.mouseMove(initialX, initialY);
|
||||
}
|
||||
robot.delay(500);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
Point newLocation = window.getLocationOnScreen();
|
||||
|
||||
passed = initialLocation.x < newLocation.x && initialLocation.y < newLocation.y;
|
||||
@@ -176,8 +165,7 @@ public class HitTestNonClientArea {
|
||||
}
|
||||
for (int i = 0; i < BUTTON_MASKS.size(); i++) {
|
||||
if (!gotClicks[i]) {
|
||||
System.out.println("Mouse click to button no " + (i+1) + " was not registered");
|
||||
passed = false;
|
||||
err("Mouse click to button no " + (i+1) + " was not registered");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,7 @@
|
||||
* questions.
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Robot;
|
||||
import java.awt.event.InputEvent;
|
||||
@@ -33,6 +30,7 @@ import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -52,10 +50,11 @@ import java.util.List;
|
||||
public class JDialogNativeControlsTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = nativeControlClicks.run(TestUtils::createJDialogWithCustomTitleBar);
|
||||
TaskResult result = nativeControlClicks.run(TestUtils::createJDialogWithCustomTitleBar);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("JDialogNativeControlsTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +111,7 @@ public class JDialogNativeControlsTest {
|
||||
robot.delay(500);
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
if (foundControls.size() == 0) {
|
||||
passed = false;
|
||||
@@ -130,24 +129,25 @@ public class JDialogNativeControlsTest {
|
||||
int h = window.getBounds().height;
|
||||
int w = window.getBounds().width;
|
||||
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
window.setBounds(screenX, screenY, w, h);
|
||||
window.setVisible(true);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
});
|
||||
|
||||
if (!maximizingActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: maximizing action was not detected");
|
||||
final String os = System.getProperty("os.name").toLowerCase();
|
||||
if (os.startsWith("mac os")) {
|
||||
if (!maximizingActionDetected) {
|
||||
err("maximizing action was not detected");
|
||||
}
|
||||
}
|
||||
|
||||
if (!closingActionCalled) {
|
||||
passed = false;
|
||||
System.out.println("Error: closing action was not detected");
|
||||
err("closing action was not detected");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.jetbrains.JBR;
|
||||
import com.jetbrains.WindowDecorations;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.awt.AWTException;
|
||||
@@ -35,6 +36,10 @@ import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@@ -53,14 +58,23 @@ import java.awt.event.InputEvent;
|
||||
public class MaximizeWindowTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), maximizeWindow);
|
||||
final String os = System.getProperty("os.name").toLowerCase();
|
||||
List<Function<WindowDecorations.CustomTitleBar, Window>> functions;
|
||||
if (os.startsWith("windows")) {
|
||||
functions = List.of(TestUtils::createFrameWithCustomTitleBar, TestUtils::createJFrameWithCustomTitleBar);
|
||||
} else {
|
||||
functions = TestUtils.getWindowCreationFunctions();
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("MaximizeWindowTest FAILED");
|
||||
TaskResult result = CommonAPISuite.runTestSuite(functions, maximizeWindow);
|
||||
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Task maximizeWindow = new Task("Maximize frame") {
|
||||
private static final Task maximizeWindow = new Task("Maximize window") {
|
||||
|
||||
@Override
|
||||
public void prepareTitleBar() {
|
||||
@@ -79,8 +93,7 @@ public class MaximizeWindowTest {
|
||||
System.out.printf(String.format("Initial size (w = %d, h = %d)%n", window.getWidth(), window.getHeight()));
|
||||
System.out.printf(String.format("New size (w = %d, h = %d)%n", window.getWidth(), window.getHeight()));
|
||||
if (initialHeight == window.getHeight() && initialWidth == window.getWidth()) {
|
||||
passed = false;
|
||||
System.out.println("Frame size wasn't changed");
|
||||
err("Frame size wasn't changed after double click to title bar");
|
||||
}
|
||||
|
||||
setResizable(false);
|
||||
@@ -91,8 +104,7 @@ public class MaximizeWindowTest {
|
||||
System.out.printf(String.format("Initial size (w = %d, h = %d)%n", window.getWidth(), window.getHeight()));
|
||||
System.out.printf(String.format("New size (w = %d, h = %d)%n", window.getWidth(), window.getHeight()));
|
||||
if (initialHeight != window.getHeight() || initialWidth != window.getWidth()) {
|
||||
passed = false;
|
||||
System.out.println("Frame size was changed");
|
||||
err("Frame size was changed after double click to title bar, but resize is disabled");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +122,7 @@ public class MaximizeWindowTest {
|
||||
System.out.println("Window was created with bounds: " + window.getBounds());
|
||||
|
||||
int w = window.getBounds().width / 2;
|
||||
int h = window.getBounds().height / 2;
|
||||
int h = Math.max(window.getBounds().height / 2, 20 + (int) titleBar.getHeight());
|
||||
window.setBounds(window.getBounds().x, window.getBounds().y, w, h);
|
||||
|
||||
System.out.println("New window bounds: " + window.getBounds());
|
||||
@@ -143,4 +155,4 @@ public class MaximizeWindowTest {
|
||||
robot.delay(1000);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,16 @@
|
||||
*/
|
||||
|
||||
import com.jetbrains.JBR;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Frame;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import java.awt.event.WindowStateListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -52,10 +51,11 @@ import java.util.List;
|
||||
public class MinimizingWindowTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = minimizingWindowTest.run(TestUtils::createFrameWithCustomTitleBar);
|
||||
TaskResult result = minimizingWindowTest.run(TestUtils::createFrameWithCustomTitleBar);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("MinimizingWindowTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public class MinimizingWindowTest {
|
||||
@Override
|
||||
public void windowIconified(WindowEvent e) {
|
||||
iconifyingActionCalled = true;
|
||||
window.setVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,6 +77,8 @@ public class MinimizingWindowTest {
|
||||
System.out.println("change " + e.getOldState() + " -> " + e.getNewState());
|
||||
if (e.getOldState() == 0 && e.getNewState() == 1) {
|
||||
iconifyingActionDetected = true;
|
||||
((Frame) window).setState(Frame.NORMAL);
|
||||
window.setVisible(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -108,17 +109,16 @@ public class MinimizingWindowTest {
|
||||
|
||||
@Override
|
||||
public void test() throws Exception {
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(window.getLocationOnScreen().x + window.getWidth() / 2,
|
||||
window.getLocationOnScreen().y + window.getHeight() / 2);
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
if (foundControls.size() == 0) {
|
||||
passed = false;
|
||||
System.out.println("Error: no controls found");
|
||||
err("no controls found");
|
||||
}
|
||||
|
||||
foundControls.forEach(control -> {
|
||||
@@ -132,19 +132,18 @@ public class MinimizingWindowTest {
|
||||
int h = window.getBounds().height;
|
||||
int w = window.getBounds().width;
|
||||
|
||||
robot.delay(500);
|
||||
robot.waitForIdle();
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
window.setBounds(screenX, screenY, w, h);
|
||||
window.setVisible(true);
|
||||
robot.delay(1500);
|
||||
robot.waitForIdle();
|
||||
});
|
||||
|
||||
if (!iconifyingActionCalled || !iconifyingActionDetected) {
|
||||
passed = false;
|
||||
System.out.println("Error: iconifying action was not detected");
|
||||
err("iconifying action was not detected");
|
||||
}
|
||||
|
||||
if (!passed) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.awt.AWTException;
|
||||
@@ -34,6 +35,7 @@ import java.awt.Robot;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -54,10 +56,11 @@ import java.util.List;
|
||||
public class MouseEventsOnClientArea {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), mouseClicks);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), mouseClicks);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("MouseEventsOnClientArea FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +77,6 @@ public class MouseEventsOnClientArea {
|
||||
private final boolean[] buttonsPressed = new boolean[BUTTON_MASKS.size()];
|
||||
private final boolean[] buttonsReleased = new boolean[BUTTON_MASKS.size()];
|
||||
private final boolean[] buttonsClicked = new boolean[BUTTON_MASKS.size()];
|
||||
private boolean mouseEntered;
|
||||
private boolean mouseExited;
|
||||
|
||||
private Panel panel;
|
||||
|
||||
@@ -84,8 +85,6 @@ public class MouseEventsOnClientArea {
|
||||
Arrays.fill(buttonsPressed, false);
|
||||
Arrays.fill(buttonsReleased, false);
|
||||
Arrays.fill(buttonsClicked, false);
|
||||
mouseEntered = false;
|
||||
mouseExited = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,16 +128,6 @@ public class MouseEventsOnClientArea {
|
||||
buttonsReleased[e.getButton() - 1] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
mouseEntered = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
mouseExited = true;
|
||||
}
|
||||
});
|
||||
window.add(panel);
|
||||
}
|
||||
@@ -147,40 +136,29 @@ public class MouseEventsOnClientArea {
|
||||
public void test() throws AWTException {
|
||||
Robot robot = new Robot();
|
||||
|
||||
int x = panel.getLocationOnScreen().x + panel.getWidth() / 2;
|
||||
int y = panel.getLocationOnScreen().y + panel.getHeight() / 2;
|
||||
|
||||
BUTTON_MASKS.forEach(mask -> {
|
||||
robot.delay(500);
|
||||
|
||||
robot.mouseMove(panel.getLocationOnScreen().x + panel.getWidth() / 2,
|
||||
panel.getLocationOnScreen().y + panel.getHeight() / 2);
|
||||
robot.mouseMove(x, y);
|
||||
robot.mousePress(mask);
|
||||
robot.mouseRelease(mask);
|
||||
|
||||
robot.delay(500);
|
||||
});
|
||||
|
||||
robot.delay(500);
|
||||
robot.mouseMove(panel.getLocationOnScreen().x + panel.getWidth() / 2,
|
||||
panel.getLocationOnScreen().y + panel.getHeight() / 2);
|
||||
robot.delay(500);
|
||||
robot.mouseMove(panel.getLocationOnScreen().x + panel.getWidth() + 10,
|
||||
panel.getLocationOnScreen().y + panel.getWidth() + 10);
|
||||
robot.delay(500);
|
||||
|
||||
boolean status = true;
|
||||
for (int i = 0; i < BUTTON_MASKS.size(); i++) {
|
||||
System.out.println("Button mask: " + BUTTON_MASKS.get(i));
|
||||
System.out.println("pressed = " + buttonsPressed[i]);
|
||||
System.out.println("released = " + buttonsReleased[i]);
|
||||
System.out.println("clicked = " + buttonsClicked[i]);
|
||||
passed = buttonsPressed[i] && buttonsReleased[i] && buttonsClicked[i];
|
||||
status = status && buttonsPressed[i] && buttonsReleased[i] && buttonsClicked[i];
|
||||
}
|
||||
|
||||
if (!mouseEntered) {
|
||||
System.out.println("Error: mouse enter wasn't detected");
|
||||
passed = false;
|
||||
}
|
||||
if (!mouseExited) {
|
||||
System.out.println("Error: mouse exit wasn't detected");
|
||||
passed = false;
|
||||
if (!status) {
|
||||
err("some of mouse events weren't registered");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,14 +22,11 @@
|
||||
*/
|
||||
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Rect;
|
||||
import util.Task;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Robot;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -49,15 +46,15 @@ import java.util.List;
|
||||
public class NativeControlsVisibilityTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), visibleControls);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), visibleControls);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("NativeControlsVisibilityTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Task visibleControls = new Task("Visible native controls") {
|
||||
private static final String PROPERTY_NAME = "controls.visible";
|
||||
@Override
|
||||
public void prepareTitleBar() {
|
||||
titleBar = JBR.getWindowDecorations().createCustomTitleBar();
|
||||
@@ -82,22 +79,50 @@ public class NativeControlsVisibilityTest {
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
|
||||
// List<Rect> foundControls = ScreenShotHelpers.detectControls(image, (int) titleBar.getHeight(),
|
||||
// (int) titleBar.getLeftInset(), (int) titleBar.getRightInset());
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar, false);
|
||||
System.out.println("Found controls at the title bar:");
|
||||
foundControls.forEach(System.out::println);
|
||||
|
||||
if (foundControls.size() != 3) {
|
||||
passed = false;
|
||||
System.out.println("Error: there are must be 3 controls");
|
||||
}
|
||||
passed = verifyControls(foundControls, window.getName());
|
||||
|
||||
if (!passed) {
|
||||
String path = ScreenShotHelpers.storeScreenshot("visible-controls-test-" + window.getName(), image);
|
||||
System.out.println("Screenshot stored in " + path);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean verifyControls(List<Rect> foundControls, String windowName) {
|
||||
final String os = System.getProperty("os.name").toLowerCase();
|
||||
if (os.startsWith("windows")) {
|
||||
return verifyControlsOnWindows(foundControls, windowName);
|
||||
} else if (os.startsWith("mac os")) {
|
||||
return verifyControlsOnMac(foundControls);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean verifyControlsOnWindows(List<Rect> foundControls, String windowName) {
|
||||
if (windowName.equals("Frame") || windowName.equals("JFrame")) {
|
||||
if (foundControls.size() != 3) {
|
||||
System.out.println("Error: there are must be 3 controls");
|
||||
return false;
|
||||
}
|
||||
} else if (windowName.equals("JDialog") || windowName.equals("Dialog")) {
|
||||
if (foundControls.size() != 1) {
|
||||
System.out.println("Error: there are must be 1 control");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean verifyControlsOnMac(List<Rect> foundControls) {
|
||||
if (foundControls.size() != 3) {
|
||||
System.out.println("Error: there are must be 3 controls");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -21,16 +21,13 @@
|
||||
* questions.
|
||||
*/
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.RectCoordinates;
|
||||
import util.Task;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@@ -49,10 +46,11 @@ import java.awt.image.BufferedImage;
|
||||
public class WindowResizeTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), windowResizeTest);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), windowResizeTest);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("WindowResizeTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +76,7 @@ public class WindowResizeTest {
|
||||
robot.delay(1000);
|
||||
|
||||
if (titleBar.getHeight() != initialTitleBarHeight) {
|
||||
passed = false;
|
||||
System.out.println("Error: title bar height has been changed");
|
||||
err("title bar height has been changed");
|
||||
}
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Task;
|
||||
import util.TaskResult;
|
||||
import util.TestUtils;
|
||||
|
||||
import java.awt.Robot;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
|
||||
/*
|
||||
* @test
|
||||
@@ -44,10 +46,11 @@ import java.awt.Robot;
|
||||
public class WindowVisibilityTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), visibilityTest);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), visibilityTest);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("WindowVisibilityTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,12 +75,10 @@ public class WindowVisibilityTest {
|
||||
robot.delay(1000);
|
||||
|
||||
if (titleBarHeight != titleBar.getHeight()) {
|
||||
passed = false;
|
||||
System.out.println("Error: title bar height has been changed");
|
||||
err("Error: title bar height has been changed");
|
||||
}
|
||||
if (!titleBar.getContainingWindow().equals(window)) {
|
||||
passed = false;
|
||||
System.out.println("Error: wrong containing window");
|
||||
err("wrong containing window");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,15 +22,12 @@
|
||||
*/
|
||||
|
||||
import com.jetbrains.JBR;
|
||||
import util.CommonAPISuite;
|
||||
import util.Rect;
|
||||
import util.ScreenShotHelpers;
|
||||
import util.Task;
|
||||
import util.TestUtils;
|
||||
import util.*;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Robot;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
@@ -38,30 +35,23 @@ import java.util.List;
|
||||
* @summary Verify a property to change visibility of native controls
|
||||
* @requires os.family == "windows"
|
||||
* @run main/othervm WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.25 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.25 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 10" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=4.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dos.version=10 -Dos.name="Windows 11" -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=4.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.25 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=1.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=2.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.0 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=3.5 WindowsControlWidthTest
|
||||
* @run main/othervm -Dsun.java2d.uiScale.enabled=true -Dsun.java2d.uiScale=4.0 WindowsControlWidthTest
|
||||
*/
|
||||
public class WindowsControlWidthTest {
|
||||
|
||||
public static void main(String... args) {
|
||||
boolean status = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), nativeControlsWidth);
|
||||
TaskResult result = CommonAPISuite.runTestSuite(TestUtils.getWindowCreationFunctions(), nativeControlsWidth);
|
||||
|
||||
if (!status) {
|
||||
throw new RuntimeException("WindowsControlWidthTest FAILED");
|
||||
if (!result.isPassed()) {
|
||||
final String message = String.format("%s FAILED. %s", MethodHandles.lookup().lookupClass().getName(), result.getError());
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,25 +73,37 @@ public class WindowsControlWidthTest {
|
||||
passed = passed && TestUtils.checkFrameInsets(window);
|
||||
|
||||
if (titleBar.getLeftInset() == 0 && titleBar.getRightInset() == 0) {
|
||||
passed = false;
|
||||
System.out.println("Left or right inset must be non-zero");
|
||||
err("Left or right inset must be non-zero");
|
||||
}
|
||||
|
||||
BufferedImage image = ScreenShotHelpers.takeScreenshot(window);
|
||||
|
||||
List<Rect> foundControls = ScreenShotHelpers.detectControlsByBackground(image, (int) titleBar.getHeight(), TestUtils.TITLE_BAR_COLOR);
|
||||
List<Rect> foundControls = ScreenShotHelpers.findControls(image, window, titleBar);
|
||||
|
||||
foundControls.forEach(control -> {
|
||||
System.out.println("Detected control: " + control);
|
||||
int calculatedWidth = control.getY2() - control.getY1();
|
||||
System.out.println("Calculated width: " + calculatedWidth);
|
||||
double uiScale = TestUtils.getUIScale();
|
||||
double adjustedControlsWidth = CONTROLS_WIDTH / uiScale;
|
||||
|
||||
float diff = (float) calculatedWidth / (float) (control.getX2() - control.getX1());
|
||||
if (diff < 0.9 || diff > 1.1) {
|
||||
System.out.println("Error: control's width is much differ than the expected value");
|
||||
passed = false;
|
||||
if (foundControls.size() == 0) {
|
||||
err("controls not found");
|
||||
} else if (foundControls.size() == 3) {
|
||||
System.out.println("3 controls found");
|
||||
int minX = foundControls.get(0).getX1();
|
||||
int maxX = foundControls.get(2).getX2();
|
||||
int dist = (foundControls.get(1).getX1() - foundControls.get(0).getX2() + foundControls.get(2).getX1() - foundControls.get(1).getX2()) / 2;
|
||||
int calculatedWidth = maxX - minX + dist;
|
||||
double diff = calculatedWidth / adjustedControlsWidth;
|
||||
if (diff < 0.95 || diff > 1.05) {
|
||||
err("control's width is much differ than the expected value");
|
||||
}
|
||||
});
|
||||
} else if (foundControls.size() == 1){
|
||||
System.out.println("1 control found");
|
||||
int calculatedWidth = foundControls.get(0).getX2() - foundControls.get(0).getX1();
|
||||
if (calculatedWidth < 0.5) {
|
||||
err("control's width is much differ than the expected value");
|
||||
}
|
||||
} else {
|
||||
err("unexpected controls count = " + foundControls.size());
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -26,17 +26,24 @@ package util;
|
||||
import com.jetbrains.WindowDecorations;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommonAPISuite {
|
||||
|
||||
public static boolean runTestSuite(List<Function<WindowDecorations.CustomTitleBar, Window>> functions, Task task) {
|
||||
public static TaskResult runTestSuite(List<Function<WindowDecorations.CustomTitleBar, Window>> functions, Task task) {
|
||||
AtomicBoolean testPassed = new AtomicBoolean(true);
|
||||
functions.forEach(function -> testPassed.set(testPassed.get() && task.run(function)));
|
||||
List<String> errors = new ArrayList<>();
|
||||
functions.forEach(function -> {
|
||||
TaskResult result = task.run(function);
|
||||
testPassed.set(testPassed.get() && result.isPassed());
|
||||
errors.add(result.getError());
|
||||
});
|
||||
|
||||
return testPassed.get();
|
||||
return new TaskResult(testPassed.get(), errors.stream().collect(Collectors.joining("\n")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
*/
|
||||
package util;
|
||||
|
||||
import com.jetbrains.WindowDecorations;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.AWTException;
|
||||
import java.awt.Color;
|
||||
@@ -57,6 +59,88 @@ public class ScreenShotHelpers {
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
|
||||
public static List<Rect> findControls(BufferedImage image, Window window, WindowDecorations.CustomTitleBar titleBar) {
|
||||
return findControls(image, window, titleBar, false);
|
||||
}
|
||||
|
||||
public static List<Rect> findControls(BufferedImage image, Window window, WindowDecorations.CustomTitleBar titleBar, boolean disabledControls) {
|
||||
final int windowWidth = window.getWidth();
|
||||
final int windowHeight = window.getHeight();
|
||||
final int titleBarHeight = (int) titleBar.getHeight();
|
||||
final int leftInset = Math.round(titleBar.getLeftInset());
|
||||
final int rightInset = Math.round(titleBar.getRightInset());
|
||||
|
||||
System.out.println("Image w = " + image.getWidth() + " height = " + image.getHeight());
|
||||
System.out.println("Window w = " + windowWidth + " height = " + window.getHeight());
|
||||
|
||||
// option 1
|
||||
List<Rect> controls1 = detectControlsByBackground(image, titleBarHeight, TestUtils.TITLE_BAR_COLOR);
|
||||
System.out.println("Option1 for " + window.getName());
|
||||
controls1.forEach(System.out::println);
|
||||
|
||||
if (isMatchCondition(window, controls1.size(), disabledControls)) {
|
||||
return controls1;
|
||||
}
|
||||
|
||||
// option2
|
||||
List<Rect> controls2 = detectControlsByBackground2(image, windowWidth, windowHeight, titleBarHeight, leftInset, rightInset, TestUtils.TITLE_BAR_COLOR);
|
||||
System.out.println("Option2 for " + window.getName());
|
||||
controls2.forEach(System.out::println);
|
||||
|
||||
if (isMatchCondition(window, controls2.size(), disabledControls)) {
|
||||
return controls2;
|
||||
}
|
||||
|
||||
// option3
|
||||
List<Rect> controls3 = detectControls(image, titleBarHeight, leftInset, rightInset);
|
||||
System.out.println("Option3 for " + window.getName());
|
||||
controls3.forEach(System.out::println);
|
||||
|
||||
if (isMatchCondition(window, controls3.size(), disabledControls)) {
|
||||
return controls3;
|
||||
}
|
||||
|
||||
// option4
|
||||
List<Rect> controls4 = detectControls2(image, windowWidth, windowHeight, titleBarHeight, leftInset, rightInset);
|
||||
System.out.println("Option4 for " + window.getName());
|
||||
controls4.forEach(System.out::println);
|
||||
|
||||
return controls4;
|
||||
}
|
||||
|
||||
private static boolean isMatchCondition(Window window, int size, boolean disabledControls) {
|
||||
if (!disabledControls) {
|
||||
if (window.getName().equals("Frame") || window.getName().equals("JFrame")) {
|
||||
return size == 3;
|
||||
}
|
||||
if (window.getName().equals("Dialog") || window.getName().equals("JDialog")) {
|
||||
final String os = System.getProperty("os.name").toLowerCase();
|
||||
if (os.startsWith("windows")) {
|
||||
return size == 1;
|
||||
}
|
||||
return size == 3;
|
||||
}
|
||||
}
|
||||
return size == 0;
|
||||
}
|
||||
|
||||
public static RectCoordinates calculateControlsRect(BufferedImage image, int windowWidth, int windowHeight, int titleBarHeight, int leftInset, int rightInset) {
|
||||
final int shiftW = (image.getWidth() - windowWidth) / 2;
|
||||
final int shiftH = (image.getHeight() - windowHeight) / 2;
|
||||
int x1;
|
||||
int y1 = shiftH;
|
||||
int x2;
|
||||
int y2 = shiftH + titleBarHeight;
|
||||
if (leftInset > rightInset) {
|
||||
x1 = shiftW;
|
||||
x2 = shiftW + leftInset;
|
||||
} else {
|
||||
x1 = shiftW + windowWidth - rightInset;
|
||||
x2 = windowWidth - shiftW;
|
||||
}
|
||||
return new RectCoordinates(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
public static RectCoordinates findRectangleTitleBar(BufferedImage image, int titleBarHeight) {
|
||||
int centerX = image.getWidth() / 2;
|
||||
int centerY = titleBarHeight / 2;
|
||||
@@ -106,6 +190,7 @@ public class ScreenShotHelpers {
|
||||
RectCoordinates coords = findRectangleTitleBar(image, titleBarHeight);
|
||||
List<Rect> result = new ArrayList<>();
|
||||
|
||||
System.out.println("Detect controls by background");
|
||||
System.out.println(coords);
|
||||
|
||||
List<Integer> lefts = new ArrayList<>();
|
||||
@@ -114,9 +199,54 @@ public class ScreenShotHelpers {
|
||||
int leftX = -1;
|
||||
int rightX = -1;
|
||||
|
||||
for (int x = coords.x1(); x <= coords.x2(); x++) {
|
||||
for (int x = coords.x1(); x < coords.x2(); x++) {
|
||||
boolean isBackground = true;
|
||||
for (int y = coords.y1(); y <= coords.y2(); y++) {
|
||||
for (int y = coords.y1(); y < coords.y2(); y++) {
|
||||
Color color = adjustColor(new Color(image.getRGB(x, y)));
|
||||
if (!color.equals(backgroundColor)) {
|
||||
isBackground = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isBackground) {
|
||||
if (leftX == -1) {
|
||||
leftX = x;
|
||||
}
|
||||
rightX = x;
|
||||
} else if (leftX != -1) {
|
||||
lefts.add(leftX);
|
||||
rights.add(rightX);
|
||||
leftX = -1;
|
||||
rightX = -1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < lefts.size(); i++) {
|
||||
int lx = lefts.get(i);
|
||||
int rx = rights.get(i);
|
||||
|
||||
System.out.println("lx = " + lx + " rx = " + rx);
|
||||
result.add(new Rect(lx, coords.y1(), rx, coords.y2(), 0, Color.BLACK));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<Rect> detectControlsByBackground2(BufferedImage image, int windowWidth, int windowHeight, int titleBarHeight, int leftInset, int rightInset, Color backgroundColor) {
|
||||
RectCoordinates coords = calculateControlsRect(image, windowWidth, windowHeight, titleBarHeight, leftInset, rightInset);
|
||||
List<Rect> result = new ArrayList<>();
|
||||
|
||||
System.out.println("Detect controls by background2");
|
||||
System.out.println(coords);
|
||||
|
||||
List<Integer> lefts = new ArrayList<>();
|
||||
List<Integer> rights = new ArrayList<>();
|
||||
|
||||
int leftX = -1;
|
||||
int rightX = -1;
|
||||
|
||||
for (int x = coords.x1(); x < coords.x2(); x++) {
|
||||
boolean isBackground = true;
|
||||
for (int y = coords.y1(); y < coords.y2(); y++) {
|
||||
Color color = adjustColor(new Color(image.getRGB(x, y)));
|
||||
if (!color.equals(backgroundColor)) {
|
||||
isBackground = false;
|
||||
@@ -148,11 +278,41 @@ public class ScreenShotHelpers {
|
||||
|
||||
public static List<Rect> detectControls(BufferedImage image, int titleBarHeight, int leftInset, int rightInset) {
|
||||
RectCoordinates coords = ScreenShotHelpers.findRectangleTitleBar(image, titleBarHeight);
|
||||
System.out.println("Detect controls");
|
||||
System.out.println(coords);
|
||||
|
||||
Map<Color, Rect> map = new HashMap<>();
|
||||
|
||||
for (int x = coords.x1(); x <= coords.x2(); x++) {
|
||||
for (int y = coords.y1(); y <= coords.y2(); y++) {
|
||||
for (int x = coords.x1(); x < coords.x2(); x++) {
|
||||
for (int y = coords.y1(); y < coords.y2(); y++) {
|
||||
Color color = new Color(image.getRGB(x, y));
|
||||
Color adjustedColor = adjustColor(color);
|
||||
Rect rect = map.getOrDefault(adjustedColor, new Rect(adjustedColor));
|
||||
rect.addPoint(x, y);
|
||||
map.put(adjustedColor, rect);
|
||||
}
|
||||
}
|
||||
|
||||
int checkedHeight = coords.y2() - coords.y1() + 1;
|
||||
int checkedWidth = coords.x2() - coords.x1() + 1;
|
||||
int pixels = checkedWidth * checkedHeight;
|
||||
|
||||
int nonCoveredAreaApprox = pixels - (leftInset * checkedHeight + rightInset * checkedHeight);
|
||||
|
||||
List<Rect> rects = map.values().stream().filter(v -> v.getPixelCount() < nonCoveredAreaApprox).toList();
|
||||
|
||||
return groupRects(rects);
|
||||
}
|
||||
|
||||
public static List<Rect> detectControls2(BufferedImage image, int windowWidth, int windowHeight, int titleBarHeight, int leftInset, int rightInset) {
|
||||
RectCoordinates coords = calculateControlsRect(image, windowWidth, windowHeight, titleBarHeight, leftInset, rightInset);
|
||||
System.out.println("Detect controls 2");
|
||||
System.out.println(coords);
|
||||
|
||||
Map<Color, Rect> map = new HashMap<>();
|
||||
|
||||
for (int x = coords.x1(); x < coords.x2(); x++) {
|
||||
for (int y = coords.y1(); y < coords.y2(); y++) {
|
||||
Color color = new Color(image.getRGB(x, y));
|
||||
Color adjustedColor = adjustColor(color);
|
||||
Rect rect = map.getOrDefault(adjustedColor, new Rect(adjustedColor));
|
||||
|
||||
@@ -36,23 +36,25 @@ abstract public class Task {
|
||||
protected Window window;
|
||||
protected boolean passed = true;
|
||||
protected Robot robot;
|
||||
protected String error;
|
||||
|
||||
|
||||
public Task(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public final boolean run(Function<WindowDecorations.CustomTitleBar, Window> windowCreator) {
|
||||
public final TaskResult run(Function<WindowDecorations.CustomTitleBar, Window> windowCreator) {
|
||||
try {
|
||||
robot = new Robot();
|
||||
} catch (AWTException e) {
|
||||
System.out.println("ERROR: unable to initialize robot");
|
||||
final String message = "ERROR: unable to initialize robot";
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
return new TaskResult(false, message);
|
||||
}
|
||||
init();
|
||||
System.out.printf("RUN TEST CASE: %s%n", name);
|
||||
passed = true;
|
||||
error = "";
|
||||
prepareTitleBar();
|
||||
window = windowCreator.apply(titleBar);
|
||||
System.out.println("Created a window with the custom title bar. Window name: " + window.getName());
|
||||
@@ -71,12 +73,21 @@ abstract public class Task {
|
||||
titleBar = null;
|
||||
window.dispose();
|
||||
|
||||
if (passed) {
|
||||
System.out.println("State: PASSED");
|
||||
} else {
|
||||
System.out.println("State: FAILED");
|
||||
if (!TestUtils.isBasicTestCase()) {
|
||||
boolean isMetConditions = TestUtils.checkScreenSizeConditions(window);
|
||||
if (!isMetConditions) {
|
||||
error += "SKIPPED: environment don't match screen size conditions";
|
||||
return new TaskResult(false, true, error);
|
||||
}
|
||||
}
|
||||
return passed;
|
||||
|
||||
return new TaskResult(passed, error);
|
||||
}
|
||||
|
||||
protected void err(String message) {
|
||||
this.error = error + message + "\n";
|
||||
passed = false;
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
|
||||
35
test/jdk/jb/java/awt/CustomTitleBar/util/TaskResult.java
Normal file
35
test/jdk/jb/java/awt/CustomTitleBar/util/TaskResult.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package util;
|
||||
|
||||
public class TaskResult {
|
||||
|
||||
private final boolean passed;
|
||||
private final boolean metConditions;
|
||||
private final String error;
|
||||
|
||||
public TaskResult(boolean passed, String error) {
|
||||
this.passed = passed;
|
||||
this.metConditions = true;
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public TaskResult(boolean metConditions, boolean passed, String error) {
|
||||
this.metConditions = metConditions;
|
||||
this.passed = passed;
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public boolean isPassed() {
|
||||
return passed;
|
||||
}
|
||||
|
||||
public String getError() {
|
||||
return error;
|
||||
}
|
||||
|
||||
public TaskResult merge(TaskResult another) {
|
||||
final String error = this.error + "\n" + another.error;
|
||||
final boolean status = this.passed && another.passed;
|
||||
return new TaskResult(status, error);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,14 +160,56 @@ public class TestUtils {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
private static Rectangle calculateWindowBounds(Window window) {
|
||||
public static boolean isBasicTestCase() {
|
||||
return getUIScale() == 1.0;
|
||||
}
|
||||
|
||||
public static boolean checkScreenSizeConditions(Window window) {
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
Insets scnMax = Toolkit.getDefaultToolkit().
|
||||
getScreenInsets(window.getGraphicsConfiguration());
|
||||
int maxHeight = screenSize.height - scnMax.top - scnMax.bottom;
|
||||
int maxWidth = screenSize.width - scnMax.left - scnMax.right;
|
||||
System.out.println("Screen size: " + screenSize);
|
||||
System.out.println("Screen insets: " + scnMax);
|
||||
final int width = screenSize.width - scnMax.left - scnMax.right;
|
||||
final int height = screenSize.height - scnMax.top - scnMax.bottom;
|
||||
System.out.println("Max width = " + width + " max height = " + height);
|
||||
|
||||
return new Rectangle(scnMax.left + 2, scnMax.top + 2, (int) (maxWidth * 0.8), (int) (maxHeight * 0.8));
|
||||
double uiScale = getUIScale();
|
||||
|
||||
final int effectiveWidth = (int) (width / uiScale);
|
||||
final int effectiveHeight = (int) (height / uiScale);
|
||||
|
||||
if (effectiveWidth < 200 || effectiveHeight < 200) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Rectangle calculateWindowBounds(Window window) {
|
||||
double uiScale = getUIScale();
|
||||
System.out.println("UI Scale: " + uiScale);
|
||||
|
||||
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
System.out.println("Screen size: " + screenSize);
|
||||
|
||||
Insets scnMax = Toolkit.getDefaultToolkit().
|
||||
getScreenInsets(window.getGraphicsConfiguration());
|
||||
int maxHeight = (int) ((screenSize.height - scnMax.top - scnMax.bottom) / uiScale);
|
||||
int maxWidth = (int) ((screenSize.width - scnMax.left - scnMax.right) / uiScale);
|
||||
|
||||
Rectangle bounds = new Rectangle(scnMax.left + 2, scnMax.top + 2, (int) (maxWidth * 0.95), (int) (maxHeight * 0.95));
|
||||
System.out.println("Window bounds: " + bounds);
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
public static double getUIScale() {
|
||||
boolean scaleEnabled = "true".equals(System.getProperty("sun.java2d.uiScale.enabled"));
|
||||
double uiScale = 1.0;
|
||||
if (scaleEnabled) {
|
||||
uiScale = Float.parseFloat(System.getProperty("sun.java2d.uiScale"));
|
||||
}
|
||||
return uiScale;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
* @requires (os.family == "mac")
|
||||
*/
|
||||
|
||||
import com.jetbrains.JBR;
|
||||
import com.jetbrains.WindowDecorations;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -81,7 +84,11 @@ public class MacNativeTransparentTitleBarWithCustomHeight
|
||||
}
|
||||
|
||||
robot.delay(DELAY);
|
||||
runSwing(() -> rootPane.putClientProperty("apple.awt.windowTransparentTitleBarHeight", 42f));
|
||||
runSwing(() -> {
|
||||
WindowDecorations.CustomTitleBar titleBar = JBR.getWindowDecorations().createCustomTitleBar();
|
||||
titleBar.setHeight(42f);
|
||||
JBR.getWindowDecorations().setCustomTitleBar(frame, titleBar);
|
||||
});
|
||||
robot.delay(DELAY);
|
||||
|
||||
// check that titlebar is of background color
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
import static java.awt.event.KeyEvent.*;
|
||||
|
||||
public class KeyCodesTest implements Runnable {
|
||||
static private final int VK_BACK_QUOTE_ISO = 0x01000000+0x0060;
|
||||
static private final int VK_SECTION = 0x01000000+0x00A7;
|
||||
@Override
|
||||
public void run() {
|
||||
verify('!', VK_EXCLAMATION_MARK, "com.apple.keylayout.French-PC", VK_SLASH);
|
||||
@@ -63,7 +65,28 @@ public class KeyCodesTest implements Runnable {
|
||||
verify('}', VK_BRACERIGHT, "com.apple.keylayout.LatinAmerican", VK_BACK_SLASH);
|
||||
verify('\u00a1', VK_INVERTED_EXCLAMATION_MARK, "com.apple.keylayout.Spanish-ISO", VK_EQUALS);
|
||||
// TODO: figure out which keyboard layout has VK_EURO_SIGN as a key on the primary layer
|
||||
verify('/', VK_DIVIDE, "com.apple.keylayout.ABC", VK_DIVIDE, VK_SLASH);
|
||||
verify('*', VK_MULTIPLY, "com.apple.keylayout.ABC", VK_MULTIPLY, VK_ASTERISK);
|
||||
verify('+', VK_ADD, "com.apple.keylayout.ABC", VK_ADD, VK_PLUS);
|
||||
verify('-', VK_SUBTRACT, "com.apple.keylayout.ABC", VK_SUBTRACT, VK_MINUS);
|
||||
verify('\t', VK_TAB, "com.apple.keylayout.ABC", VK_TAB);
|
||||
verify(' ', VK_SPACE, "com.apple.keylayout.ABC", VK_SPACE);
|
||||
|
||||
// Test numpad numbers
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
verify((char)('0' + i), VK_NUMPAD0 + i, "com.apple.keylayout.ABC", VK_NUMPAD0 + i, VK_0 + i);
|
||||
}
|
||||
verify('\0', VK_F1, "com.apple.keylayout.ABC", VK_F1);
|
||||
verify('\0', VK_F19, "com.apple.keylayout.ABC", VK_F19);
|
||||
|
||||
// Test ANSI/ISO keyboard weirdness
|
||||
verify('\u00a7', 0x01000000+0x00A7, "com.apple.keylayout.ABC", VK_SECTION);
|
||||
verify('\u00b2', 0x01000000+0x00B2, "com.apple.keylayout.French-PC", VK_SECTION);
|
||||
verify('#', VK_NUMBER_SIGN, "com.apple.keylayout.CanadianFrench-PC", VK_SECTION);
|
||||
verify('\u00ab', 0x01000000+0x00AB, "com.apple.keylayout.CanadianFrench-PC", VK_BACK_QUOTE_ISO);
|
||||
verify('#', VK_NUMBER_SIGN, "com.apple.keylayout.CanadianFrench-PC", VK_BACK_QUOTE);
|
||||
|
||||
// Test extended key codes that don't match the unicode char
|
||||
verify('\u00e4', 0x01000000+0x00C4, "com.apple.keylayout.German", VK_QUOTE);
|
||||
verify('\u00e5', 0x01000000+0x00C5, "com.apple.keylayout.Norwegian", VK_OPEN_BRACKET);
|
||||
verify('\u00e6', 0x01000000+0x00C6, "com.apple.keylayout.Norwegian", VK_QUOTE);
|
||||
@@ -73,12 +96,18 @@ public class KeyCodesTest implements Runnable {
|
||||
verify('\u00f8', 0x01000000+0x00D8, "com.apple.keylayout.Norwegian", VK_SEMICOLON);
|
||||
}
|
||||
|
||||
private void verify(char ch, int vk, String layout, int key) {
|
||||
private void verify(char ch, int vk, String layout, int key, int correctKeyCode) {
|
||||
InputMethodTest.section("Key code test: " + vk + ", char: " + ch);
|
||||
InputMethodTest.layout(layout);
|
||||
InputMethodTest.type(key, 0);
|
||||
InputMethodTest.expect(String.valueOf(ch));
|
||||
InputMethodTest.expectKeyCode(vk);
|
||||
InputMethodTest.expectTrue(getExtendedKeyCodeForChar(ch) == vk, "getExtendedKeyCodeForChar(ch) == vk");
|
||||
if (ch != 0) {
|
||||
InputMethodTest.expect(String.valueOf(ch));
|
||||
InputMethodTest.expectTrue(getExtendedKeyCodeForChar(ch) == correctKeyCode, "getExtendedKeyCodeForChar");
|
||||
}
|
||||
}
|
||||
|
||||
private void verify(char ch, int vk, String layout, int key) {
|
||||
verify(ch, vk, layout, key, vk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ public class Key {
|
||||
// So to press some key on the current layout, one needs to pass corresponding US layout key code to Robot.
|
||||
// So every key stores corresponding KeyEvent.VK_ constant name to provide mapping to US layout.
|
||||
int getKeyCode_US() {
|
||||
if (vkName.equals("VK_SECTION")) {
|
||||
return 0x01000000 + 0x00A7;
|
||||
}
|
||||
try {
|
||||
return KeyEvent.class.getField(vkName).getInt(null);
|
||||
} catch (IllegalAccessException | NoSuchFieldException e) {
|
||||
|
||||
@@ -38,10 +38,7 @@ public enum Layout_ABC implements LayoutKey {
|
||||
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
|
||||
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
|
||||
|
||||
// TODO Robot cannot press section sign key (16777383),
|
||||
// located on the left side of the key 1 on the Apple International English keyboard
|
||||
// SECTION ('§', '§', '±', '±'),
|
||||
|
||||
VK_SECTION ('§', '§', '±', '±', '0'),
|
||||
VK_MINUS ('-', '–', '_', '—', '\u001F'),
|
||||
VK_EQUALS ('=', '≠', '+', '±', '='),
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public enum Layout_FRENCH_PC implements LayoutKey {
|
||||
|
||||
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
|
||||
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
|
||||
|
||||
VK_SECTION ('²', '≤', '>', '≥', '0'),
|
||||
VK_MINUS (')', ']', '°', ']', '\u001B'),
|
||||
VK_EQUALS ('=', '}', '+', '≠', '\u001F'),
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ public enum Layout_GERMAN implements LayoutKey {
|
||||
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
|
||||
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
|
||||
|
||||
VK_SECTION (KeyChar.dead('^'), KeyChar.ch('„'), KeyChar.ch('°'), KeyChar.ch('“'), KeyChar.ch('\u001E')),
|
||||
// Eszett
|
||||
VK_MINUS ('ß', '¿', '?', '˙', 'ß'),
|
||||
VK_EQUALS (KeyChar.dead('´'), KeyChar.ch('\''), KeyChar.dead('`'), KeyChar.ch('˚'), KeyChar.ch('´')),
|
||||
|
||||
@@ -37,6 +37,7 @@ public enum Layout_SPANISH_ISO implements LayoutKey {
|
||||
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
|
||||
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
|
||||
|
||||
VK_SECTION ('º', '\\', 'ª', '°', '0'),
|
||||
VK_MINUS ('\'', '´', '?', '¸', '\u001F'),
|
||||
VK_EQUALS ('¡', '‚', '¿', '˛', '='),
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ public enum Layout_US_INTERNATIONAL_PC implements LayoutKey {
|
||||
// Enum name must be the same as KeyEvent.VK_ constant name corresponding to the key on US keyboard layout
|
||||
// Note that '\u0000' may be used if no char is mapped to a key + modifier or if one wants to skip its testing
|
||||
|
||||
VK_SECTION ('§', '§', '±', '±', '0'),
|
||||
VK_MINUS ('-', '–', '_', '—', '\u001F'),
|
||||
VK_EQUALS ('=', '≠', '+', '±', '='),
|
||||
|
||||
|
||||
@@ -114,7 +114,6 @@
|
||||
# jdk_awt
|
||||
|
||||
java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.java 8168389 windows-all,macosx-all
|
||||
java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java 8224055 macosx-all
|
||||
java/awt/Focus/FocusOwnerFrameOnClick/FocusOwnerFrameOnClick.java 8081489 generic-all
|
||||
java/awt/Focus/FocusSubRequestTest/FocusSubRequestTest.java JBR-5178 windows-all
|
||||
java/awt/Focus/FrameMinimizeTest/FrameMinimizeTest.java 8016266 linux-all
|
||||
@@ -134,12 +133,12 @@ java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java 8029680 generic-all
|
||||
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java 8171510,JBR-881 macosx-all,linux-all
|
||||
javax/swing/dnd/7171812/bug7171812.java 8041447,8253184 macosx-all,windows-all
|
||||
java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all
|
||||
java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all
|
||||
java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252,JBR-5178 macosx-all,windows-all
|
||||
java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618,JBR-814 macosx-all,linux-all
|
||||
java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252,JBR-5178 windows-all
|
||||
java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java 8194753 linux-all,macosx-all
|
||||
java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java 7152980 macosx-all
|
||||
java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 7156130 linux-all
|
||||
java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096,JBR-4880 macosx-all,windows-all
|
||||
java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096,JBR-4880,JBR-5387 windows-all,linux-all
|
||||
java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all
|
||||
java/awt/Frame/ExceptionOnSetExtendedStateTest/ExceptionOnSetExtendedStateTest.java 8198237 macosx-all
|
||||
java/awt/Frame/SetMinimumSizeTest/SetMinimumSizeTest2.java JBR-5210 windows-all
|
||||
@@ -212,12 +211,12 @@ java/awt/Focus/8000326/SetFocusTraversalKeysEnabledTest.java JBR-4997 windows-al
|
||||
java/awt/Focus/8073453/AWTFocusTransitionTest.java JBR-5210,8298247 windows-all,linux-all
|
||||
java/awt/Focus/8073453/SwingFocusTransitionTest.java JBR-5210 windows-all
|
||||
java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java JBR-5210 windows-all
|
||||
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all
|
||||
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 macosx-all,windows-all
|
||||
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all
|
||||
java/awt/event/KeyEvent/KeyChar/KeyCharTest.java 8169474,8224055 windows-all
|
||||
|
||||
java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java JBR-3636,JBR-4880 macosx-all,windows-all
|
||||
java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java JBR-3636,JBR-4880 windows-all
|
||||
|
||||
java/awt/event/KeyEvent/KeyTyped/CtrlSpace.java JBR-3817 windows-all,macosx-all
|
||||
java/awt/event/KeyEvent/KeyTyped/CtrlSpace.java JBR-3817 windows-all
|
||||
|
||||
java/awt/dnd/BadSerializationTest/BadSerializationTest.java 8277817 linux-x64,windows-x64
|
||||
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all
|
||||
@@ -267,9 +266,10 @@ java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java 8253184 w
|
||||
java/awt/print/Headless/HeadlessPrinterJob.java 8196088 windows-all
|
||||
sun/awt/datatransfer/SuplementaryCharactersTransferTest.java 8011371 generic-all
|
||||
sun/awt/shell/ShellFolderMemoryLeak.java 8197794 windows-all
|
||||
sun/java2d/DirectX/OpaqueImageToSurfaceBlitTest/OpaqueImageToSurfaceBlitTest.java JBR-5393 windows-aarch64
|
||||
sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all
|
||||
sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180,8252812 windows-all,macosx-all,linux-all
|
||||
java/awt/Graphics2D/CopyAreaOOB.java JBR-5354 macosx-all,windows-aarch64
|
||||
java/awt/Graphics2D/CopyAreaOOB.java JBR-5354 macosx-all,windows-all
|
||||
java/awt/Graphics2D/DrawString/DisposerTest.java JBR-5010 linux-aarch64
|
||||
java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8266283 linux-all
|
||||
java/awt/Graphics2D/DrawString/TextRenderingTest.java JBR-4260,JBR-5359 macosx-11.7.1,windows-aarch64
|
||||
@@ -568,7 +568,7 @@ java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java 7107528,8253
|
||||
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java 8282232 windows-all
|
||||
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithOverlay.java 8253184 windows-all
|
||||
java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676,8253184 linux-all,windows-all
|
||||
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,windows-all,macosx-all
|
||||
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,windows-all
|
||||
java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java 8253184 windows-all
|
||||
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163
|
||||
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
|
||||
@@ -578,7 +578,6 @@ java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
|
||||
java/awt/GraphicsDevice/CheckDisplayModes.java 8266242 macosx-aarch64
|
||||
java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223 linux-all,windows-all,macosx-all
|
||||
java/awt/keyboard/8218917/AltKeyBug.java JBR-3636,JBR-5312 macosx-all,windows-all
|
||||
java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all
|
||||
java/awt/keyboard/AltPlusNumberKeyCombinationsTest/AltPlusNumberKeyCombinationsTest.java JBR-5210 windows-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java JBR-5210 windows-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogTest.java JBR-5210 windows-all
|
||||
@@ -586,7 +585,6 @@ java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java JBR
|
||||
java/awt/FullScreen/8013581/bug8013581.java 8169471,JBR-80 macosx-all,windows-all
|
||||
java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 8233568 macosx-all
|
||||
java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java 8233568 macosx-all
|
||||
java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java 8233568 macosx-all
|
||||
java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java 8233568 macosx-all
|
||||
java/awt/event/KeyEvent/DeadKey/deadKeyMacOSX.java 8233568 macosx-all
|
||||
java/awt/TrayIcon/RightClickWhenBalloonDisplayed/RightClickWhenBalloonDisplayed.java 8238720 windows-all
|
||||
@@ -848,6 +846,7 @@ javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
|
||||
javax/swing/JEditorPane/8195095/ImageViewTest.java 8253184 windows-all
|
||||
javax/swing/JRadioButton/4314194/bug4314194.java 8298153 linux-all
|
||||
javax/swing/JRootPane/4670486/bug4670486.java 8042381,8197552 macosx-all,windows-all
|
||||
javax/swing/JRootPane/DefaultButtonTest.java 8285635 windows-all,linux-all
|
||||
javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java JBR-5210 windows-all
|
||||
javax/swing/text/html/StyleSheet/bug4936917.java JBR-899 windows-all
|
||||
javax/swing/plaf/metal/MetalGradient/8163193/ButtonGradientTest.java 8253184 windows-all
|
||||
@@ -857,10 +856,10 @@ javax/swing/plaf/synth/SynthScrollbarThumbPainter/SynthScrollbarThumbPainterTest
|
||||
javax/swing/JInternalFrame/5066752/bug5066752.java 8253184 windows-all
|
||||
javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java JBR-5359 windows-aarch64
|
||||
javax/swing/JInternalFrame/8020708/bug8020708.java JBR-4879 windows-all
|
||||
javax/swing/JInternalFrame/8069348/bug8069348.java 8253184 windows-all
|
||||
javax/swing/JInternalFrame/8069348/bug8069348.java 8253184,JBR-900 macosx-aarch64,windows-all
|
||||
javax/swing/text/DefaultEditorKit/4278839/bug4278839.java CODETOOLS-7901623 windows-all
|
||||
javax/swing/text/GlyphPainter2/6427244/bug6427244.java JBR-896 windows-all
|
||||
javax/swing/text/JTextComponent/5074573/bug5074573.java CODETOOLS-7901623 windows-all
|
||||
javax/swing/text/JTextComponent/5074573/bug5074573.java CODETOOLS-7901623,JBR-5386 windows-all,linux-all
|
||||
javax/swing/text/StyledEditorKit/4506788/bug4506788.java JBR-180 windows-all
|
||||
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java 8253184 windows-all
|
||||
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8253184 windows-all
|
||||
@@ -985,7 +984,7 @@ java/awt/font/OutlineTextRendererEmoji.java JBR-5009 linux-aarch64
|
||||
java/awt/font/EmojiVariation.java JBR-5009 linux-aarch64
|
||||
java/awt/font/TextLayout/TestJustification.html 8250791 macosx-all
|
||||
java/awt/font/TextLayout/TestSinhalaChar.java JBR-5103 generic-all
|
||||
javax/swing/JTableHeader/6889007/bug6889007.java 8253184 windows-all
|
||||
javax/swing/JTableHeader/6889007/bug6889007.java 8253184,JBR-5387 windows-all,linux-all
|
||||
java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all
|
||||
java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all
|
||||
java/awt/FileDialog/RegexpFilterTest/RegexpFilterTest.html 7187728 macosx-all,linux-all
|
||||
@@ -1077,7 +1076,7 @@ java/awt/image/multiresolution/MenuMultiresolutionIconTest.java JBR-4880,8253184
|
||||
java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java JBR-4880 windows-all
|
||||
javax/swing/JFileChooser/8002077/bug8002077.java JBR-4880 windows-all
|
||||
javax/swing/JFileChooser/JFileChooserSetLocationTest.java 8295804 linux-all,macosx-all,windows-all
|
||||
javax/swing/JSlider/6348946/bug6348946.java 8197552 windows-all
|
||||
javax/swing/JSlider/6348946/bug6348946.java 8197552,JBR-5387 windows-all,linux-all
|
||||
javax/swing/JSpinner/4973721/bug4973721.java JBR-4880 windows-all
|
||||
javax/swing/JSpinner/5012888/bug5012888.java JBR-4880 windows-all
|
||||
javax/swing/JSpinner/JSpinnerFocusTest.java JBR-5288 windows-all
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# cannotbe run against jbr which does not contain some jbrsdk's utilities required for test executions
|
||||
javax/imageio/stream/StreamCloserLeak/run_test.sh NO_BUG generic_all
|
||||
javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh NO_BUG generic_all
|
||||
javax/imageio/stream/StreamCloserLeak/run_test.sh nobug generic-all
|
||||
javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh nobug generic-all
|
||||
|
||||
#
|
||||
# intermittently failed, they were muted in regular runs with the option "unmute manually"
|
||||
@@ -17,7 +17,6 @@ java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java no
|
||||
java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java nobug windows-all,macosx-all,linux-all
|
||||
java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java nobug windows-all
|
||||
java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java nobug windows-all
|
||||
java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java nobug windows-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java nobug windows-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java nobug windows-all
|
||||
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java nobug windows-all
|
||||
@@ -54,7 +53,6 @@ javax/swing/JFrame/8016356/bug8016356.java nobug windows-all
|
||||
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java nobug windows-all
|
||||
javax/swing/JInternalFrame/5066752/bug5066752.java nobug windows-all
|
||||
javax/swing/JInternalFrame/6288609/TestJInternalFrameDispose.java nobug windows-all
|
||||
javax/swing/JInternalFrame/8069348/bug8069348.java nobug windows-all
|
||||
javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java nobug windows-all,linux-all
|
||||
javax/swing/JInternalFrame/Test6505027.java nobug windows-all
|
||||
javax/swing/JLabel/7004134/bug7004134.java nobug linux-all
|
||||
|
||||
Reference in New Issue
Block a user