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


Java DialogDescriptor.YES_OPTION属性代码示例

本文整理汇总了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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ImportConfirmationPanel.java

示例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;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:ExportConfirmationPanel.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:NbDialogOperatorTest.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:NativeExecutionUserNotificationImpl.java


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