@Override
	public void visit(Entry entry) {
		Component component = componentProvider.createComponent(entry);
		if(component != null){
			final EntryAccessor entryAccessor = new EntryAccessor();
			entryAccessor.setComponent(entry, component);
			final AFreeplaneAction action = entryAccessor.getAction(entry);
			if (action != null) {
				final ActionEnabler actionEnabler = new ActionEnabler(component);
				action.addPropertyChangeListener(actionEnabler);
				entry.setAttribute(actionEnabler.getClass(), actionEnabler);
			}
			final JToolBar container = (JToolBar) new EntryAccessor().getAncestorComponent(entry);
			GridBagConstraints constraints = layoutConstraintsForEntry(entry, component);
			container.add(component, constraints);
		}
	}
@Test
	public void createsToolbarButtonWithSelectableAction() {
		Entry actionEntry = new Entry();
		final AFreeplaneAction action = Mockito.mock(AFreeplaneAction.class);
		when(action.isSelectable()).thenReturn(true);
		new EntryAccessor().setAction(actionEntry, action);

		Entry toolbarEntry = new Entry();
		final FreeplaneToolBar toolbar = new FreeplaneToolBar("toolbar", SwingConstants.HORIZONTAL);
		new EntryAccessor().setComponent(toolbarEntry, toolbar);
		toolbarEntry.addChild(actionEntry);

		final JToolbarComponentBuilder toolbarActionGroupBuilder = new JToolbarComponentBuilder(resourceAccessorMock);
		toolbarActionGroupBuilder.visit(actionEntry);

		JAutoToggleButton button = (JAutoToggleButton)new EntryAccessor().getComponent(actionEntry);

		assertThat(button.getAction(), CoreMatchers.<Action>equalTo(action));
		assertThat(button.getParent(), CoreMatchers.equalTo((Container)toolbar));
	}