static void setNewAcceleratorOnNextClick(KeyStroke accelerator) {
   if (AccelerateableAction.isNewAcceleratorOnNextClickEnabled()) {
     return;
   }
   acceleratorForNextClickedAction = accelerator;
   String title = TextUtils.getText("SetAccelerator.dialogTitle");
   String text = TextUtils.getText(SET_ACCELERATOR_ON_NEXT_CLICK_ACTION);
   if (accelerator != null)
     text =
         TextUtils.format("SetAccelerator.keystrokeDetected", toString(accelerator)) + "\n" + text;
   final Frame frame = Controller.getCurrentController().getViewController().getFrame();
   setAcceleratorOnNextClickActionDialog = UITools.createCancelDialog(frame, title, text);
   getAcceleratorOnNextClickActionDialog()
       .addComponentListener(
           new ComponentAdapter() {
             @Override
             public void componentHidden(final ComponentEvent e) {
               setAcceleratorOnNextClickActionDialog = null;
               acceleratorForNextClickedAction = null;
             }
           });
   getAcceleratorOnNextClickActionDialog().setVisible(true);
 }