@Override
	public void acceleratorChanged(AFreeplaneAction action, KeyStroke oldStroke, KeyStroke newStroke) {
		for (Entry entry : entries.entries(action)) {
			Object component = new EntryAccessor().getComponent(entry);
			if (component instanceof JMenu)
				component = ((JMenu) component).getPopupMenu().getComponent(0);
			if (component instanceof JMenuItem)
				((JMenuItem) component).setAccelerator(newStroke);
		}
	}
@Test
	public void setsKeystroke() throws Exception {
		final EntriesForAction entriesForAction = new EntriesForAction();
		final MenuAcceleratorChangeListener menuAcceleratorChangeListener = new MenuAcceleratorChangeListener(entriesForAction);
		final AFreeplaneAction action = mock(AFreeplaneAction.class);
		Entry actionEntry = new Entry();
		final JMenuItem menu = new JMenuItem();
		new EntryAccessor().setComponent(actionEntry, menu);
		entriesForAction.registerEntry(action, actionEntry);

		final KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0);
		menuAcceleratorChangeListener.acceleratorChanged(action, null, keyStroke);
		assertThat(menu.getAccelerator(), equalTo(keyStroke));
	}