# HG changeset patch # User padraigob@netbeans.org # Date 1203695047 0 # Node ID 4b8ae4ad2eac5c35ede25bb6ce357bf42f230fc1 # Parent 264b78227c08e19ecc1013b5c8bec4b3d35dbfe0 128147: Fix A11Y issues for Confirm Rollback dialog diff -r 264b78227c08 -r 4b8ae4ad2eac mercurial/src/org/netbeans/modules/mercurial/ui/rollback/RollbackAction.java --- a/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/RollbackAction.java Fri Feb 22 15:21:57 2008 +0000 +++ b/mercurial/src/org/netbeans/modules/mercurial/ui/rollback/RollbackAction.java Fri Feb 22 15:44:07 2008 +0000 @@ -100,12 +100,13 @@ public class RollbackAction extends Cont logger.output( NbBundle.getMessage(StripAction.class, "MSG_ROLLBACK_INFO_SEP", root.getAbsolutePath())); // NOI18N - int response = JOptionPane.showOptionDialog(null, - NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CONFIRM_QUERY"), // NOI18N - NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CONFIRM"), // NOI18N - JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); + NotifyDescriptor descriptor = new NotifyDescriptor.Confirmation(NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CONFIRM_QUERY")); // NOI18N + descriptor.setTitle(NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CONFIRM")); // NOI18N + descriptor.setMessageType(JOptionPane.WARNING_MESSAGE); + descriptor.setOptionType(NotifyDescriptor.YES_NO_OPTION); - if (response == JOptionPane.NO_OPTION) { + Object res = DialogDisplayer.getDefault().notify(descriptor); + if (res == NotifyDescriptor.NO_OPTION) { logger.outputInRed( NbBundle.getMessage(RollbackAction.class, "MSG_ROLLBACK_CANCELED", root.getAbsolutePath())); // NOI18N @@ -124,7 +125,7 @@ public class RollbackAction extends Cont }else{ logger.output(list.get(0)); if (HgCommand.hasHistory(root)) { - response = JOptionPane.showOptionDialog(null, + int response = JOptionPane.showOptionDialog(null, NbBundle.getMessage(RollbackAction.class,"MSG_ROLLBACK_CONFIRM_UPDATE_QUERY") , // NOI18N NbBundle.getMessage(RollbackAction.class,"MSG_ROLLBACK_CONFIRM_UPDATE"), // NOI18N JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,null, null, null);