org.eclipse.jface.window.Window.setReturnCode()方法的使用及代码示例

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

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

Window.setReturnCode介绍

[英]Sets this window's return code. The return code is automatically returned by open if block on open is enabled. For non-blocking opens, the return code needs to be retrieved manually using getReturnCode.
[中]设置此窗口的返回代码。如果启用了“打开时阻塞”,返回代码将由open自动返回。对于非阻塞打开,需要使用getReturnCode手动检索返回代码。

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Notifies that the window's close button was pressed, the close menu was
 * selected, or the ESCAPE key pressed.
 * <p>
 * The default implementation of this framework method sets the window's
 * return code to <code>CANCEL</code> and closes the window using
 * <code>close</code>. Subclasses may extend or reimplement.
 * </p>
 */
protected void handleShellCloseEvent() {
  setReturnCode(CANCEL);
  close();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * Notifies that the window's close button was pressed, the close menu was
 * selected, or the ESCAPE key pressed.
 * <p>
 * The default implementation of this framework method sets the window's
 * return code to <code>CANCEL</code> and closes the window using
 * <code>close</code>. Subclasses may extend or reimplement.
 * </p>
 */
protected void handleShellCloseEvent() {
  setReturnCode(CANCEL);
  close();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Notifies that the window's close button was pressed, the close menu was
 * selected, or the ESCAPE key pressed.
 * <p>
 * The default implementation of this framework method sets the window's
 * return code to <code>CANCEL</code> and closes the window using
 * <code>close</code>. Subclasses may extend or reimplement.
 * </p>
 */
protected void handleShellCloseEvent() {
  setReturnCode(CANCEL);
  close();
}

相关文章