当前位置: 首页>>代码示例>>Java>>正文


Java QuitHandler类代码示例

本文整理汇总了Java中java.awt.desktop.QuitHandler的典型用法代码示例。如果您正苦于以下问题:Java QuitHandler类的具体用法?Java QuitHandler怎么用?Java QuitHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QuitHandler类属于java.awt.desktop包,在下文中一共展示了QuitHandler类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performUsing

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:_AppEventHandler.java

示例2: performUsing

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
void performUsing(final QuitHandler handler, final _NativeEvent event) {
    final MacQuitResponse response = obtainQuitResponse(); // obtains the "current" quit response
    handler.handleQuitRequestWith(new QuitEvent(), response);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:5,代码来源:_AppEventHandler.java

示例3: setQuitHandler

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:Desktop.java

示例4: setQuitHandler

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
/**
 * 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) {
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:DesktopPeer.java

示例5: setQuitHandler

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:Application.java

示例6: setQuitHandler

import java.awt.desktop.QuitHandler; //导入依赖的package包/类
/**
 * 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}
 * @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) {
    checkQuitPermission();
    checkActionSupport(Action.APP_QUIT_HANDLER);
    peer.setQuitHandler(quitHandler);
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:21,代码来源:Desktop.java


注:本文中的java.awt.desktop.QuitHandler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。