@Override
	public void visit(Entry target) {
		final EntryAccessor entryAccessor = new EntryAccessor();
		final Component component = (Component) entryAccessor.removeComponent(target);
		if (component != null) {
			if(component instanceof AbstractButton)
				((AbstractButton)component).setAction(null);
			removeMenuComponent(component);
			ActionEnabler actionEnabler = target.removeAttribute(ActionEnabler.class);
			if(actionEnabler != null){
				final AFreeplaneAction action = entryAccessor.getAction(target);
				action.removePropertyChangeListener(actionEnabler);
			}
		}
	}
@Test
	public void removesExtraSubmenusFromParents() throws Exception {
		final JComponentRemover componentRemover = JComponentRemover.INSTANCE;
		final Entry entry = new Entry();
		JMenu parent = new JMenu();
		JComponent entryComponent = new JMenu();
		final MenuSplitter menuSplitter = new MenuSplitter(1);
		menuSplitter.addMenuComponent(parent, new JMenu());
		menuSplitter.addMenuComponent(parent, entryComponent);
		new EntryAccessor().setComponent(entry, entryComponent);
		componentRemover.visit(entry);
		assertThat(parent.getPopupMenu().getComponentCount(), equalTo(1));
	}