messageboxdlg.java

来自「非常接近C/S操作方式的Java Ajax框架-ZK 用ZK框架使你的B/S应」· Java 代码 · 共 81 行

JAVA
81
字号
/* MessageboxDlg.java{{IS_NOTE	Purpose:			Description:			History:		Wed Aug 17 16:42:20     2005, Created by tomyeh}}IS_NOTECopyright (C) 2005 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zul.impl;import org.zkoss.zul.Window;import org.zkoss.zk.ui.UiException;import org.zkoss.zul.Messagebox;/** * Used with {@link Messagebox} to implement a message box. * * @author tomyeh */public class MessageboxDlg extends Window {	/** A OK button. */	public static final int OK = Messagebox.OK;	/** A Cancel button. */	public static final int CANCEL = Messagebox.CANCEL;	/** A Yes button. */	public static final int YES = Messagebox.YES;	/** A No button. */	public static final int NO = Messagebox.NO;	/** A Abort button. */	public static final int ABORT = Messagebox.ABORT;	/** A Retry button. */	public static final int RETRY = Messagebox.RETRY;	/** A IGNORE button. */	public static final int IGNORE = Messagebox.IGNORE;	/** What buttons are allowed. */	private int _buttons;	/** Which button is pressed. */	private int _result;	public void onOK() {		if ((_buttons & OK) != 0) endModal(OK);		else if ((_buttons & YES) != 0) endModal(YES);		else if ((_buttons & RETRY) != 0) endModal(RETRY);	}	public void onCancel() {		if (_buttons == OK) endModal(OK);		else if ((_buttons & CANCEL) != 0) endModal(CANCEL);		else if ((_buttons & NO) != 0) endModal(NO);		else if ((_buttons & ABORT) != 0) endModal(ABORT);	}	/** Sets what buttons are allowed. */	public void setButtons(int buttons) {		_buttons = buttons;	}	/** Called only internally.	 */	public void endModal(int button) {		_result = button;		detach();	}	/** Returns the result which is the button being pressed.	 */	public int getResult() {		return _result;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?