类java.awt.desktop.QuitHandler源码实例Demo

下面列出了怎么用java.awt.desktop.QuitHandler的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-jdk9   文件: _AppEventHandler.java
void performUsing(final QuitHandler handler, final _NativeEvent event) {
    if (_AppMiscHandlers.isSuddenTerminationEnbaled()) {
        performDefaultAction(event);
        return;
    }
    final MacQuitResponse response = obtainQuitResponse(); // obtains the "current" quit response
    handler.handleQuitRequestWith(new QuitEvent(), response);
}
 
源代码2 项目: Bytecoder   文件: Desktop.java
/**
 * Installs the handler which determines if the application should quit. The
 * handler is passed a one-shot {@link java.awt.desktop.QuitResponse} which can cancel or
 * proceed with the quit. Setting the handler to {@code null} causes
 * all quit requests to directly perform the default {@link QuitStrategy}.
 *
 * @param quitHandler the handler that is called when the application is
 * asked to quit
 *
 * @throws SecurityException if a security manager exists and it
 * will not allow the caller to invoke {@code System.exit} or it denies the
 * {@code RuntimePermission("canProcessApplicationEvents")} permission
 * @throws UnsupportedOperationException if the current platform
 * does not support the {@link Desktop.Action#APP_QUIT_HANDLER} action
 * @since 9
 */
public void setQuitHandler(final QuitHandler quitHandler) {
    checkEventsProcessingPermission();
    checkQuitPermission();
    checkActionSupport(Action.APP_QUIT_HANDLER);
    peer.setQuitHandler(quitHandler);
}
 
源代码3 项目: openjdk-jdk9   文件: Desktop.java
/**
 * Installs the handler which determines if the application should quit. The
 * handler is passed a one-shot {@link java.awt.desktop.QuitResponse} which can cancel or
 * proceed with the quit. Setting the handler to {@code null} causes
 * all quit requests to directly perform the default {@link QuitStrategy}.
 *
 * @param quitHandler the handler that is called when the application is
 * asked to quit
 *
 * @throws SecurityException if a security manager exists and it
 * will not allow the caller to invoke {@code System.exit} or it denies the
 * {@code RuntimePermission("canProcessApplicationEvents")} permission
 * @throws UnsupportedOperationException if the current platform
 * does not support the {@link Desktop.Action#APP_QUIT_HANDLER} action
 * @since 9
 */
public void setQuitHandler(final QuitHandler quitHandler) {
    checkEventsProcessingPermission();
    checkQuitPermission();
    checkActionSupport(Action.APP_QUIT_HANDLER);
    peer.setQuitHandler(quitHandler);
}
 
源代码4 项目: Bytecoder   文件: DesktopPeer.java
/**
 * Installs the handler which determines if the application should quit.
 *
 * @param quitHandler the handler that is called when the application is
 * asked to quit
 * @see java.awt.Desktop#setQuitHandler(java.awt.desktop.QuitHandler)
 */
default void setQuitHandler(final QuitHandler quitHandler) {
}
 
源代码5 项目: openjdk-jdk9   文件: DesktopPeer.java
/**
 * Installs the handler which determines if the application should quit.
 *
 * @param quitHandler the handler that is called when the application is
 * asked to quit
 * @see java.awt.Desktop#setQuitHandler(java.awt.desktop.QuitHandler)
 */
default void setQuitHandler(final QuitHandler quitHandler) {
}
 
源代码6 项目: openjdk-jdk9   文件: Application.java
/**
 * Installs the handler which determines if the application should quit.
 * The handler is passed a one-shot {@link QuitResponse} which can cancel or proceed with the quit.
 * Setting the handler to {@code null} causes all quit requests to directly perform the default {@link QuitStrategy}.
 *
 * @param quitHandler the handler that is called when the application is asked to quit
 * @since Java for Mac OS X 10.6 Update 3
 * @since Java for Mac OS X 10.5 Update 8
 */
public void setQuitHandler(final QuitHandler quitHandler) {
    eventHandler.quitDispatcher.setHandler(quitHandler);
}
 
 类所在包
 类方法
 同包方法