本文整理匯總了Java中org.eclipse.swt.SWT.ABORT屬性的典型用法代碼示例。如果您正苦於以下問題:Java SWT.ABORT屬性的具體用法?Java SWT.ABORT怎麽用?Java SWT.ABORT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.ABORT屬性的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])
};
}