本文整理汇总了Java中org.openide.DialogDescriptor.YES_NO_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.YES_NO_OPTION属性的具体用法?Java DialogDescriptor.YES_NO_OPTION怎么用?Java DialogDescriptor.YES_NO_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.YES_NO_OPTION属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: overrideAll
private boolean overrideAll(Collection<ShortcutAction> actions) {
JPanel innerPane = new JPanel();
StringBuffer display = new StringBuffer();
for(ShortcutAction sc : actions) {
display.append(" '" + sc.getDisplayName() + "'<br>"); //NOI18N
}
innerPane.add(new JLabel(NbBundle.getMessage(KeymapViewModel.class, "Override_All", display))); //NOI18N
DialogDescriptor descriptor = new DialogDescriptor(
innerPane,
NbBundle.getMessage(KeymapViewModel.class, "Conflicting_Shortcut_Dialog"), //NOI18N
true,
DialogDescriptor.YES_NO_OPTION,
null,
null);
DialogDisplayer.getDefault().notify(descriptor);
if (descriptor.getValue().equals(DialogDescriptor.YES_OPTION))
return true;
else return false;
}
示例2: showConfirmation
/** Opens confirmation dialog. */
void showConfirmation() {
DialogDescriptor dd = new DialogDescriptor(
this,
NbBundle.getMessage(ImportConfirmationPanel.class, "ImportConfirmationPanel.title"),
true,
DialogDescriptor.YES_NO_OPTION,
DialogDescriptor.YES_OPTION,
null);
dd.setMessageType(DialogDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
if (DialogDescriptor.OK_OPTION.equals(dd.getValue())) {
confirmed = true;
} else {
confirmed = false;
}
}
示例3: showConfirmation
/** Opens confirmation dialog. */
void showConfirmation() {
DialogDescriptor dd = new DialogDescriptor(
this,
NbBundle.getMessage(ExportConfirmationPanel.class, "ExportConfirmationPanel.title"),
true,
DialogDescriptor.YES_NO_OPTION,
DialogDescriptor.YES_OPTION,
null);
dd.setMessageType(DialogDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
if (DialogDescriptor.OK_OPTION.equals(dd.getValue())) {
confirmed = true;
storeSkipOption();
} else {
confirmed = false;
}
}
示例4: overrride
/**
* Shows dialog where user chooses whether SC of conflicting action should be overridden
* @param displayName name of conflicting action
* @return dialog result
*/
private Object overrride(Set<ShortcutAction> conflictingActions, Collection<ShortcutAction> sameScope) {
StringBuffer conflictingActionList = new StringBuffer();
for (ShortcutAction sa : conflictingActions) {
conflictingActionList.append("<li>'").append (sa.getDisplayName()).append ("'</li>"); //NOI18N
}
JPanel innerPane = new JPanel();
innerPane.add(new JLabel(NbBundle.getMessage(ButtonCellEditor.class,
sameScope.isEmpty() ? "Override_Shortcut2" : "Override_Shortcut",
conflictingActionList))); //NOI18N
DialogDescriptor descriptor = new DialogDescriptor(
innerPane,
NbBundle.getMessage(ButtonCellEditor.class, "Conflicting_Shortcut_Dialog"),
true,
sameScope.isEmpty() ?
DialogDescriptor.YES_NO_CANCEL_OPTION :
DialogDescriptor.YES_NO_OPTION,
null,
null); //NOI18N
DialogDisplayer.getDefault().notify(descriptor);
Object o = descriptor.getValue();
if (!sameScope.isEmpty() && o == DialogDescriptor.NO_OPTION) {
return DialogDescriptor.CANCEL_OPTION;
} else {
return o;
}
}
示例5: ConfirmDialog
/** Creates a new instance of ConfirmDialog */
public ConfirmDialog(String text, String title) {
super (text,title,true,
DialogDescriptor.YES_NO_OPTION,
DialogDescriptor.NO_OPTION,
DialogDescriptor.BOTTOM_ALIGN,
null,
null);
}
示例6: getDialogDisplayerConstant
private int getDialogDisplayerConstant() {
switch (this) {
case OK_CANCEL:
return DialogDescriptor.OK_CANCEL_OPTION;
case YES_NO:
return DialogDescriptor.YES_NO_OPTION;
case YES_NO_CANCEL:
return DialogDescriptor.YES_NO_CANCEL_OPTION;
case CLOSE:
return -1;
default:
throw new AssertionError();
}
}