javafx.stage.Window.removeEventFilter()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(246)

本文整理了Java中javafx.stage.Window.removeEventFilter()方法的一些代码示例,展示了Window.removeEventFilter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.removeEventFilter()方法的具体详情如下:
包路径:javafx.stage.Window
类名称:Window
方法名:removeEventFilter

Window.removeEventFilter介绍

暂无

代码示例

代码示例来源:origin: dev.rico/rico-remoting-client-javafx

/**
 * The method will register an event handler to the window that will automatically call the {@link AbstractViewController#destroy()}
 * method when the windows becomes hidden.
 * @param window the window
 * @param viewBinder the view binder
 * @param <M> the model type
 * @return a subscription to unsubsribe / deregister the handler.
 */
public static <M> Subscription destroyOnClose(final Window window, final AbstractViewController<M> viewBinder) {
  Assert.requireNonNull(window, "window");
  Assert.requireNonNull(viewBinder, "viewBinder");
  final EventHandler<WindowEvent> handler = e -> viewBinder.destroy();
  window.addEventFilter(WindowEvent.WINDOW_HIDDEN, handler);
  return () -> window.removeEventFilter(WindowEvent.WINDOW_HIDDEN, handler);
}

代码示例来源:origin: com.canoo.dolphin-platform/dolphin-platform-client-javafx

/**
 * The method will register an event handler to the window that will automatically call the {@link AbstractViewBinder#destroy()}
 * method when the windows becomes hidden.
 * @param window the window
 * @param viewBinder the view binder
 * @param <M> the model type
 * @return a subscription to unsubsribe / deregister the handler.
 */
public static <M> Subscription destroyOnClose(final Window window, final AbstractViewBinder<M> viewBinder) {
  Assert.requireNonNull(window, "window");
  Assert.requireNonNull(viewBinder, "viewBinder");
  final EventHandler<WindowEvent> handler = e -> viewBinder.destroy();
  window.addEventFilter(WindowEvent.WINDOW_HIDDEN, handler);
  return () -> window.removeEventFilter(WindowEvent.WINDOW_HIDDEN, handler);
}

代码示例来源:origin: org.controlsfx/controlsfx

ownerWindow.removeEventFilter(WindowEvent.WINDOW_CLOSE_REQUEST,
    closePopOverOnOwnerWindowClose);
ownerWindow.removeEventFilter(WindowEvent.WINDOW_HIDING,
  closePopOverOnOwnerWindowClose);

相关文章