On 1 Aug 2011, at 23:53, Mike Swingler wrote:
> On Jul 29, 2011, at 6:01 PM, Stephen Winnall wrote:
>
>> I've just discovered that Java applications under Lion also recognise alt-apple-Q, aka "Quit and Discard Windows" in addition to the old apple-Q. Do we as programmers have to do anything to handle this, or is it all handled automatically? Can we detect and handle it at all?
>
> Currently no, Java applications are not "Resume" aware, and would require adoption of new API to make them so.
>
>> I have done the following in an application:
>>
>> com.apple.eawt.Application appleApplication = com.apple.eawt.Application.getApplication();
>> appleApplication.disableSuddenTermination();
>> appleApplication.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
>>
>> This says - if I understand correctly - that the application should always close all windows on termination. Shouldn't one of apple-Q or alt-apple-Q be disabled in this case?
>
> It would be possible for us to add new API to the eAWT application to handle/distinguish the "quit and save" vs. "quit and don't save" cases.
Couldn't you just add a QuitAndDiscardHandler (like the existing QuitHandler) to com.apple.eawt? Or is that what you meant? That's all I would need. I'll put in an enhancement request for that.
> We could also offer a way to persist a small map of values per-window, attached via a client property. Obviously we can't do anything as expansive as AppKit's NSDocument…but this area seems fertile for a small-scoped enhancement request. Please file one at <http://bugreporter.apple.com> if you would like to see a feature like this, and be sure to include the types of data you would want to persist.
My main concern is that the user has a meaningful experience, i.e. either apple-Q and alt-apple-Q do something different and meaningful, or one or the other can be suppressed. I'm not too bothered about resumption.
Steve _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden