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


Java DialogDescriptor.YES_NO_OPTION属性代码示例

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

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

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

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

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

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


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