@Override
    public Component createComponent(Entry entry) {
		final Object existingComponent = entryAccessor.getComponent(entry);
		if (existingComponent != null)
			return (Component) existingComponent;
		final AFreeplaneAction action = entryAccessor.getAction(entry);
		final JComponent component;
		if(action != null){
		    AbstractButton actionComponent;
			if (action.isSelectable()) {
				actionComponent = new JAutoToggleButton(action);
				IconReplacer.replaceByImageIcon(entry, actionComponent, entryAccessor);
			}
			else if(entry.builders().contains("bigIcon")) {
				actionComponent = new JBigButton(action);
				Icon icon = actionComponent.getIcon();
				Icon scaledIcon = IconFactory.getInstance().getScaledIcon(icon, new Quantity<LengthUnit>(icon.getIconHeight() * 2, LengthUnit.px));
				actionComponent.setIcon(FreeplaneIconFactory.toImageIcon(scaledIcon));
			}
			else {
				actionComponent = new JButton(action);
				IconReplacer.replaceByImageIcon(entry, actionComponent, entryAccessor);
			}


			component = actionComponent;
			component.setName(action.getKey());
		}
		else if(entry.builders().contains("separator")){
			component = new Separator();
		}
		else if(entry.builders().contains("panel")){
			component = new JUnitPanel();
		}
		else if(entry.builders().contains("dropdownMenu")){
			String textKey = (String) entry.getAttribute("text");
			String text = textKey != null ? TextUtils.getText(textKey) +  "..."  :  "...";
			String iconKey = (String) entry.getAttribute("icon");
			Icon icon = ResourceController.getResourceController().getIcon(iconKey != null ? iconKey : "arrowDown.icon");
			String tooltipKey = (String) entry.getAttribute("tooltip");
			JButtonWithDropdownMenu buttonWithMenu = new JButtonWithDropdownMenu(text, icon);
			IconReplacer.replaceByScaledImageIcon(buttonWithMenu);
			if(textKey != null)
				TranslatedElement.TEXT.setKey(buttonWithMenu, textKey);
			TranslatedElementFactory.createTooltip(buttonWithMenu, tooltipKey);
			entry.children()
			.stream()
			.map(entryAccessor::getAction)
			.filter(x -> x != null)
			.forEach(buttonWithMenu::addMenuAction);
			component = buttonWithMenu;
		}
		else
			component = null;
	    return component;
	}
@Test
	public void testName() throws Exception {
		ResourceAccessor resourceAccessorMock = mock(ResourceAccessor.class);
		final ToolbarComponentProvider toolbarComponentProvider = new ToolbarComponentProvider(resourceAccessorMock);
		final Entry entry = new Entry();
		final EntryAccessor entryAccessor = new EntryAccessor();
		final Component testComponent = new JPanel();
		entryAccessor.setComponent(entry, testComponent);
		assertThat(toolbarComponentProvider.createComponent(entry), equalTo(testComponent));
	}