org.fujion.component.Window.setOnCanClose()方法的使用及代码示例

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

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

Window.setOnCanClose介绍

[英]Sets the functional interface that will determine if window closure is permitted.
[中]设置用于确定是否允许关闭窗口的功能界面。

代码示例

代码示例来源:origin: org.fujion/fujion-core

/**
 * Sets whether window closure is permitted using a simple Boolean value. This is a shortcut for
 * calling {@link #setOnCanClose} with a functional interface that returns a fixed Boolean
 * value.
 *
 * @param canClose If true, the tab may be closed.
 */
public void setOnCanClose(boolean canClose) {
  setOnCanClose(() -> canClose);
}

代码示例来源:origin: org.carewebframework/org.carewebframework.ui.core

@Override
public void afterInitialized(BaseComponent comp) {
  this.root = (Window) comp;
  root.setAttribute("controller", this);
  control = (DialogControl<?>) root.getAttribute("control");
  root.setTitle(control.getTitle());
  icon.addClass(control.getIconClass());
  message.addClass(control.getTextClass());
  message.setLabel(control.getMessage());
  root.addClass(control.getPanelClass());
  chkRemember.setVisible(root.hasAttribute("remember"));
  root.setOnCanClose(() -> {
    control.callback(response);
    return true;
  });
  
  if (control.getFormat() == ChoiceFormat.BUTTONS) {
    processButtonResponses();
  } else {
    processListResponses();
  }
}

代码示例来源:origin: org.carewebframework/org.carewebframework.shell

window.setOnCanClose(() -> {
  if (favoritesChanged) {
    PropertyUtil.saveValues(DesignConstants.DESIGN_FAVORITES_PROPERTY, null, false, favorites);

相关文章