public void newAccelerator(final AFreeplaneAction action, final KeyStroke newAccelerator) {
final String shortcutKey = getPropertyKey(action.getKey());
final String oldShortcut = getProperty(shortcutKey);
if (newAccelerator == null || !new KeystrokeValidator(action).isValid(newAccelerator, newAccelerator.getKeyChar())) {
final GrabKeyDialog grabKeyDialog = new GrabKeyDialog(oldShortcut);
final IKeystrokeValidator validator = new KeystrokeValidator(action);
grabKeyDialog.setValidator(validator);
grabKeyDialog.setVisible(true);
if (grabKeyDialog.isOK()) {
final String shortcut = grabKeyDialog.getShortcut();
final KeyStroke accelerator = UITools.getKeyStroke(shortcut);