RCP App + java.awt.Desktop#setOpenUriHandler on MacOS [message #1842794] |
Thu, 01 July 2021 13:13 |
Aleksei Airapetov Messages: 13 Registered: December 2019 |
Junior Member |
|
|
Hi, I'm currently developing and testing a small RCP App example, which can handle custom URI scheme calls on MacOS.
I use https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Desktop.html#setOpenURIHandler(java.awt.desktop.OpenURIHandler) method to register custom URI handler in the code.
But I'm facing a problem which is that the handler does not being called.
The symptoms are as follows:
- with debugger, I made sure that the handler registration code is being executed (can't tell if it is being executed properly, because it calls native method under the hood, but no exceptions are thrown during the call of Desktop#setOpenUriHandler)
- I am convinced that the URI call is executed properly on the side of the OS (when I enter custom URL in browser, OS suggests to open my application and brings its window to front)
- However, the code inside the handler is not being executed
I tried to call the handler registering method from different places in my code (in bundle Activator, in ViewPart#createControl method, and also tried to create declarative service and call it there) but still no effect.
I am also attaching archive with my whole project.
One can reproduce the issue following these steps:
- build project by calling: mvn clean install
- launch eclipse-repository/target/products/example.product.id/macosx/cocoa/x86_64/Eclipse.app
- try to call custom URI by entering example://test in your browser address bar
- by this point the application window should display entered URL which however is not happening
Tested it on MacOS Big Sur with openjdk 11.0.11
Maybe someone faced such problem before? Any tips are welcome, thanks.
|
|
|
|
|
Powered by
FUDForum. Page generated in 2.16963 seconds