本文整理汇总了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();
}
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}