本文整理汇总了Java中org.openide.DialogDescriptor.YES_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.YES_OPTION属性的具体用法?Java DialogDescriptor.YES_OPTION怎么用?Java DialogDescriptor.YES_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openide.DialogDescriptor
的用法示例。
在下文中一共展示了DialogDescriptor.YES_OPTION属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
示例2: 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;
}
}
示例3: showTestDialog
/** Opens modal dialog with OK, Cancel, Yes, No, Close and Help buttons.
* @param testDialogTitle title of test dialog
*/
protected void showTestDialog(String testDialogTitle) {
Object[] options = new Object[]{
DialogDescriptor.OK_OPTION,
DialogDescriptor.CANCEL_OPTION,
DialogDescriptor.YES_OPTION,
DialogDescriptor.NO_OPTION,
DialogDescriptor.CLOSED_OPTION
};
label = new TestLabel(TEST_DIALOG_LABEL);
DialogDescriptor dd = new DialogDescriptor(label, testDialogTitle, false,
options, null, DialogDescriptor.BOTTOM_ALIGN, null, label);
dd.setHelpCtx(new HelpCtx("org.netbeans.api.javahelp.MASTER_ID"));
DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
}
示例4: confirmShellStatusValiation
@Override
public boolean confirmShellStatusValiation(String title, String header, String footer, Shell shell) {
final ShellValidationStatusPanel errorPanel = new ShellValidationStatusPanel(header, footer, shell);
final JButton noButton = new JButton("No"); // NOI18N
errorPanel.setActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
noButton.setEnabled(!errorPanel.isRememberDecision());
}
});
DialogDescriptor dd = new DialogDescriptor(errorPanel,
title,
true,
new Object[]{DialogDescriptor.YES_OPTION, noButton},
noButton,
DialogDescriptor.DEFAULT_ALIGN, null, null);
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
try {
dialog.setVisible(true);
} catch (Throwable th) {
if (!(th.getCause() instanceof InterruptedException)) {
throw new RuntimeException(th);
}
dd.setValue(DialogDescriptor.CANCEL_OPTION);
} finally {
dialog.dispose();
}
Object response = dd.getValue();
if (response == DialogDescriptor.YES_OPTION && errorPanel.isRememberDecision()) {
NbPreferences.forModule(WindowsSupport.class).put(shell.toString(), "yes"); // NOI18N
}
return response == DialogDescriptor.YES_OPTION;
}