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


Java SWT.RETRY属性代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.RETRY属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.RETRY属性的具体用法?Java SWT.RETRY怎么用?Java SWT.RETRY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swt.SWT的用法示例。


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

示例1: ask0

private int ask0() {
	int style = 0;
	switch (this.input_type) {
		case INPUT_OK_CANCEL:
			style |= SWT.CANCEL;
		case INPUT_OK:
			style |= SWT.OK;
			break;

		case INPUT_RETRY_CANCEL_IGNORE:
			style |= SWT.IGNORE;
		case INPUT_RETRY_CANCEL:
			style |= SWT.RETRY;
			style |= SWT.CANCEL;
			break;

		case INPUT_YES_NO_CANCEL:
			style |= SWT.CANCEL;
		case INPUT_YES_NO:
			style |= SWT.YES;
			style |= SWT.NO;
			break;
	}

	switch (this.message_type) {
		case MSG_ERROR:
			style |= SWT.ICON_ERROR;
			break;
		case MSG_INFO:
			style |= SWT.ICON_INFORMATION;
			break;
		case MSG_QUESTION:
			style |= SWT.ICON_QUESTION;
			break;
		case MSG_WARN:
			style |= SWT.ICON_WARNING;
			break;
		case MSG_WORKING:
			style |= SWT.ICON_WORKING;
			break;
	}

	MessageBoxShell mb = new MessageBoxShell(style, this.title,
			this.messagesAsString());
	mb.open(null);
	int result = mb.waitUntilClosed();

	switch (result) {
		case SWT.OK:
			return ANSWER_OK;
		case SWT.YES:
			return ANSWER_YES;
		case SWT.NO:
			return ANSWER_NO;
		case SWT.ABORT:
			return ANSWER_ABORT;
		case SWT.RETRY:
			return ANSWER_RETRY;
		case SWT.IGNORE:
			return ANSWER_IGNORE;
		default: // Cancel if anything else is returned.
			return ANSWER_CANCEL;
	}

}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:65,代码来源:UIMessageImpl.java

示例2: swtButtonStylesToText

private static Object[] swtButtonStylesToText(int style) {
	List<String> buttons = new ArrayList<>(2);
	List<Integer> buttonVal = new ArrayList<>(2);
	int buttonCount = 0;
	if ((style & SWT.OK) > 0) {
		buttons.add(MessageText.getString("Button.ok"));
		buttonVal.add(Integer.valueOf(SWT.OK));
		buttonCount++;
	}
	if ((style & SWT.YES) > 0) {
		buttons.add(MessageText.getString("Button.yes"));
		buttonVal.add(Integer.valueOf(SWT.YES));
		buttonCount++;
	}
	if ((style & SWT.NO) > 0) {
		buttons.add(MessageText.getString("Button.no"));
		buttonVal.add(Integer.valueOf(SWT.NO));
		buttonCount++;
	}
	if ((style & SWT.CANCEL) > 0) {
		buttons.add(MessageText.getString("Button.cancel"));
		buttonVal.add(Integer.valueOf(SWT.CANCEL));
		buttonCount++;
	}
	if ((style & SWT.ABORT) > 0) {
		buttons.add(MessageText.getString("Button.abort"));
		buttonVal.add(Integer.valueOf(SWT.ABORT));
		buttonCount++;
	}
	if ((style & SWT.RETRY) > 0) {
		buttons.add(MessageText.getString("Button.retry"));
		buttonVal.add(Integer.valueOf(SWT.RETRY));
		buttonCount++;
	}
	if ((style & SWT.IGNORE) > 0) {
		buttons.add(MessageText.getString("Button.ignore"));
		buttonVal.add(Integer.valueOf(SWT.IGNORE));
		buttonCount++;
	}
	return new Object[] {
		buttons.toArray(new String[buttonCount]),
		buttonVal.toArray(new Integer[buttonCount])
	};
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:44,代码来源:MessageBoxShell.java


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