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; }
private static boolean commitAfterMerge (boolean locallyModifiedExcluded, File repository) { // XXX consider usage of repository to determine if there are any non-included files which have to be committed, too // and thus removing the option HgModuleConfig.getDefault().getConfirmCommitAfterMerge() if (locallyModifiedExcluded || HgModuleConfig.getDefault().getConfirmCommitAfterMerge()) { // ask before commit? NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_QUERY")); // NOI18N descriptor.setTitle(NbBundle.getMessage(CommitAction.class, "MSG_COMMIT_AFTER_MERGE_TITLE")); // NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION); Object res = DialogDisplayer.getDefault().notify(descriptor); return res == NotifyDescriptor.YES_OPTION; } return true; }
descriptor.setTitle(NbBundle.getMessage(CreateRefreshAction.class, "MSG_LONG_COMMAND_TITLE")); //NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
public void actionPerformed(ActionEvent event) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation( NbBundle.getMessage(DependencyNode.class, "MSG_Remove_Dependency", art.getGroupId() + ":" + art.getArtifactId()), NbBundle.getMessage(DependencyNode.class, "TIT_Remove_Dependency")); //NOI18N nd.setOptionType(NotifyDescriptor.YES_NO_OPTION); Object ret = DialogDisplayer.getDefault().notify(nd); if (ret != NotifyDescriptor.YES_OPTION) { nd.setOptionType(NotifyDescriptor.YES_NO_OPTION); ret = DialogDisplayer.getDefault().notify(nd); if (ret != NotifyDescriptor.YES_OPTION) {
if (warnPrevResult) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation(org.openide.util.NbBundle.getMessage(BasicSettingsPanel.class, "MSG_AlreadyLaunched", new Object[]{})); nd.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); if (DialogDisplayer.getDefault().notify(nd) != NotifyDescriptor.OK_OPTION) { return null;
@Override public void actionPerformed(ActionEvent e) { String state = e.getActionCommand(); if (state.equals(JFileChooser.APPROVE_SELECTION)) { VCSFileProxy destination = VCSFileProxySupport.getSelectedFile(chooser); destination = getTargetFile(destination); if (destination.exists()) { NotifyDescriptor nd = new NotifyDescriptor.Confirmation(NbBundle.getMessage(ExportDiffSupport.class, "BK3005", destination.getPath())); nd.setOptionType(NotifyDescriptor.YES_NO_OPTION); DialogDisplayer.getDefault().notify(nd); if (nd.getValue().equals(NotifyDescriptor.OK_OPTION) == false) { return; } } preferences.put("ExportDiff.saveFolder", destination.getParentFile().getPath()); // NOI18N panel.setOutputFileText(destination.getPath()); } else { dd.setValue(null); } if(dialog != null) { dialog.dispose(); } } });
descriptor.setTitle(NbBundle.getMessage(UpdateAction.class, "MSG_UPDATE_CONFIRM")); // NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
descriptor.setTitle(NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CONFIRM")); // NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
descriptor.setTitle(NbBundle.getMessage(CommitAction.class, "MSG_LONG_COMMAND_TITLE")); //NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);
NotifyDescriptor.QUESTION_MESSAGE ); nd.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); JButton yes = new JButton(NbBundle.getMessage(ServerInstance.class, "MSG_AnotherServerStopYes")); JButton no = new JButton(NbBundle.getMessage(ServerInstance.class, "MSG_AnotherServerStopNo"));
descriptor.setTitle(NbBundle.getMessage(DeleteLocalAction.class, "CTL_DeleteLocal_Title")); // NOI18N descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION);