<AWT Dev> [7u6] Review request for 7159266: [macosx] ApplicationDelegate should not be set in the headless mode

Scott Kovatch scott.kovatch at oracle.com
Thu Apr 5 13:58:15 PDT 2012

Support for open-document events was added into the SWT about 4 years ago. I remember Kevin Barnes implemented it across all SWT platforms. I think it shows up as an event you can listen for on the Display.

I'm not aware of any SWT apps that cared about sleep/wake events, though I do know there were apps that wanted to add handlers on the application menu items. I added the ability to listen for app menu events entirely in SWT in 3.7. Prior to that you had to use eAWT.

-- Scott

scott.kovatch at oracle.com
Santa Clara/Pleasanton, CA

On Apr 5, 2012, at 1:31 PM, Mike Swingler wrote:

> How would an SWT developer accept new "open document" file double-clicks, or listen for sleep/wake events? AFAIK, eAWT is the only aperture that handles that right now.
> Regards,
> Mike Swingler
> Apple Inc.
> On Apr 5, 2012, at 1:11 PM, steve.x.northover at oracle.com wrote:
>> Hi all,
>> Headless mode works fine for SWT.  SWT doesn't use eAWT to do Quit etc.  Instead, it uses the appropriate native cocoa calls.
>> Steve
>> On 05/04/2012 11:23 AM, Anthony Petrov wrote:
>>> On 04/05/12 19:07, Mike Swingler wrote:
>>>>> Please review a fix for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7159266 at:
>>>>> http://cr.openjdk.java.net/~anthony/7u6-4-fxHang-7159266.0/
>>>>> With this fix we avoid setting an application delegate when AWT is started in the headless mode. This prevents a hang when another GUI toolkit (e.g. JavaFX) is already running in the same Java process.
>>>> This would logically mean that you won't get eAWT events (file open, quit, etc) while started in this mode. Does this impact SWT as well?
>>> In the headless mode an application doesn't have any UI, and as such there's no way to generate e.g. a Quit action. Hence the application delegate isn't necessary in this mode.
>>> SWT uses a special "SWT mode" (== -XstartOnFirstThread) which is different from the headless mode. In the SWT mode the delegate will still be installed.
>>> I think this may not work in case of running an SWT application together with the AWT in headless mode. However, I can't imagine who might want to run SWT/AWT in such configuration because the headless mode is supposed to be primarily used in server environments where a display is physically unavailable, in which case SWT wouldn't be able to run there either.
>>> -- 
>>> best regards,
>>> Anthony

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20120405/a8808863/attachment.html 

More information about the awt-dev mailing list