本文整理汇总了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;
}
}
示例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])
};
}