public void run() { NotifyDescriptor nd = new NotifyDescriptor.Confirmation( ex.getLocalizedMessage(), NotifyDescriptor.YES_NO_OPTION ); nd.setOptions(new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION }); isModalDialog = true; Object res = DialogDisplayer.getDefault().notify(nd); isModalDialog = false; if (NotifyDescriptor.OK_OPTION.equals(res)) { isConfirmed = true; } else { isConfirmed = false; } } }
private static boolean showModifiedMessage (String title) { String message = NbBundle.getMessage(AppClientProjectProperties.class,"TXT_Regenerate"); JButton regenerateButton = new JButton (NbBundle.getMessage(AppClientProjectProperties.class,"CTL_RegenerateButton")); regenerateButton.setDefaultCapable(true); regenerateButton.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(AppClientProjectProperties.class,"AD_RegenerateButton")); NotifyDescriptor d = new NotifyDescriptor.Message (message, NotifyDescriptor.WARNING_MESSAGE); d.setTitle(title); d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); d.setOptions(new Object[] {regenerateButton, NotifyDescriptor.CANCEL_OPTION}); return DialogDisplayer.getDefault().notify(d) == regenerateButton; }
protected static boolean showModifiedMessage(String title) { String message = NbBundle.getMessage(SharedRubyProjectProperties.class, "TXT_Regenerate"); JButton regenerateButton = new JButton(NbBundle.getMessage(SharedRubyProjectProperties.class, "CTL_RegenerateButton")); regenerateButton.setDefaultCapable(true); regenerateButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(SharedRubyProjectProperties.class, "AD_RegenerateButton")); NotifyDescriptor d = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE); d.setTitle(title); d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); d.setOptions(new Object[]{regenerateButton, NotifyDescriptor.CANCEL_OPTION}); return DialogDisplayer.getDefault().notify(d) == regenerateButton; }
e.getLocalizedMessage(), NotifyDescriptor.YES_NO_OPTION ); nd.setOptions(new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });
nd.setOptions(new Object[]{NotifyDescriptor.YES_OPTION, NotifyDescriptor.CANCEL_OPTION}); if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.YES_OPTION) { return null;
JButton no = new JButton(NbBundle.getMessage(ServerInstance.class, "MSG_AnotherServerStopNo")); yes.setDefaultCapable(true); nd.setOptions(new Object[] { yes, no }); Object option = DialogDisplayer.getDefault().notify(nd); if (option != yes) { //user pressed No
JButton accept = new JButton(junitlib_confirm_accept()); accept.setDefaultCapable(true); nd.setOptions(new Object[] {accept, NotifyDescriptor.CANCEL_OPTION}); if (DialogDisplayer.getDefault().notify(nd) == accept) { try {
e.getLocalizedMessage (), NotifyDescriptor.YES_NO_OPTION ); nd.setOptions (new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });
e.getLocalizedMessage (), NotifyDescriptor.YES_NO_OPTION ); nd.setOptions (new Object[] { NotifyDescriptor.YES_OPTION, NotifyDescriptor.NO_OPTION });