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


Java DialogDescriptor.NO_OPTION属性代码示例

本文整理汇总了Java中org.openide.DialogDescriptor.NO_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.NO_OPTION属性的具体用法?Java DialogDescriptor.NO_OPTION怎么用?Java DialogDescriptor.NO_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.openide.DialogDescriptor的用法示例。


在下文中一共展示了DialogDescriptor.NO_OPTION属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

public void open(JComponent progressComponent, String title) {
    holder.add(progressComponent, BorderLayout.CENTER);
    try {
        DialogDescriptor dd = new DialogDescriptor(
            this,
            title,
            true,
            new Object[0],
            DialogDescriptor.NO_OPTION,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null
            );
        dialog = DialogDisplayer.getDefault().createDialog(dd);
        dialog.setVisible(true);
    } finally {
        if (dialog != null) {
            dialog.dispose();
        }
    }
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ProgressPanel.java

示例2: open

public void open(JComponent progressComponent) {
    holder.add(progressComponent, BorderLayout.CENTER);
    DialogDescriptor dd = new DialogDescriptor(
            this,
            NbBundle.getMessage(ProgressPanel.class, "MSG_PleaseWait"),
            true,
            new Object[0],
            DialogDescriptor.NO_OPTION,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null
            );
    dialog = DialogDisplayer.getDefault().createDialog(dd);
    if (dialog instanceof JDialog) {
        ((JDialog)dialog).setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    }
    dialog.setResizable(false);
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ProgressPanel.java

示例3: 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

示例4: 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

示例5: 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

示例6: open

public void open(JComponent progressComponent) {
    holder.add(progressComponent, BorderLayout.CENTER);

    DialogDescriptor dd = new DialogDescriptor(
            this,
            NbBundle.getMessage(ProgressPanel.class, "MSG_PleaseWait"),
            true,
            new Object[0],
            DialogDescriptor.NO_OPTION,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null,
            true);
    dialog = DialogDisplayer.getDefault().createDialog(dd);
    if (dialog instanceof JDialog) {
        JDialog jDialog = ((JDialog)dialog);
        jDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
        JRootPane rootPane = jDialog.getRootPane();
        rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel"); // NOI18N
        rootPane.getActionMap().put("cancel", new AbstractAction() { // NOI18N
            public void actionPerformed(ActionEvent event) {
                if (cancelButton.isEnabled()) {
                    cancelButton.doClick();
                }
            }
        });
    }
    dialog.setResizable(false);
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:ProgressPanel.java

示例7: open

public void open(JComponent progressComponent) {
    holder.add(progressComponent, BorderLayout.CENTER);

    DialogDescriptor dd = new DialogDescriptor(
            this,
            NbBundle.getMessage (ProgressPanel.class, "MSG_PleaseWait"),
            true,
            new Object[0],
            DialogDescriptor.NO_OPTION,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null,
            true);
    dialog = DialogDisplayer.getDefault().createDialog(dd);
    if (dialog instanceof JDialog) {
        JDialog jDialog = ((JDialog)dialog);
        jDialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
        JRootPane rootPane = jDialog.getRootPane();
        rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel"); // NOI18N
        rootPane.getActionMap().put("cancel", new AbstractAction() { // NOI18N
            public void actionPerformed(ActionEvent event) {
                if (cancelButton.isEnabled()) {
                    cancelButton.doClick();
                }
            }
        });
    }
    dialog.setResizable(false);
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:ProgressPanel.java


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