use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class UserInputListenerFactory method rebuildMenuOnMapChange.
private void rebuildMenuOnMapChange(final Entry entry) {
Entry menuEntry;
for (//
menuEntry = entry.getParent(); //
menuEntry.getName().isEmpty(); menuEntry = menuEntry.getParent()) ;
mapMenuEntries.put(menuEntry, null);
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class MenuBuilderIntegrationTest method createsEmptyToolbarComponent.
@Test
public void createsEmptyToolbarComponent() {
String content = "<FreeplaneUIEntries>" + "<Entry name='home' builder='toolbar'/>" + "</FreeplaneUIEntries>";
Entry builtMenuStructure = buildJMenu(content);
assertThat(new EntryAccessor().getComponent(builtMenuStructure.getChild(0)), CoreMatchers.<Object>is(toolbar));
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class MenuBuilderIntegrationTest method buildJMenu.
private Entry buildJMenu(String content) {
final Entry buildMenuStructure = XmlEntryStructureBuilder.buildMenuStructure(content);
final RecursiveMenuStructureProcessor actionBuilder = new RecursiveMenuStructureProcessor();
actionBuilder.setDefaultBuilder(new ActionFinder(freeplaneActions));
new PhaseProcessor().withPhase(ACTIONS, actionBuilder).withPhase(UI, recursiveMenuStructureBuilder).build(buildMenuStructure);
return buildMenuStructure;
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class XmlEntryStructureBuilderTest method givenXmlWithChildEntryWithOneBuilder_createsStructureWithChildEntry.
@Test
public void givenXmlWithChildEntryWithOneBuilder_createsStructureWithChildEntry() {
String xmlWithoutContent = "<FreeplaneUIEntries><Entry builder='builder'/></FreeplaneUIEntries>";
Entry builtMenuStructure = XmlEntryStructureBuilder.buildMenuStructure(xmlWithoutContent);
Entry menuStructureWithChildEntry = new Entry();
final Entry childEntry = new Entry();
childEntry.setBuilders(asList("builder"));
menuStructureWithChildEntry.addChild(childEntry);
assertThat(builtMenuStructure, equalTo(menuStructureWithChildEntry));
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class XmlEntryStructureBuilderTest method givenXmlWithChildEntryWithName_createsStructureWithNamedChildEntry.
@Test
public void givenXmlWithChildEntryWithName_createsStructureWithNamedChildEntry() {
String xmlWithoutContent = "<FreeplaneUIEntries><Entry name='entry'/></FreeplaneUIEntries>";
Entry builtMenuStructure = XmlEntryStructureBuilder.buildMenuStructure(xmlWithoutContent);
Entry menuStructureWithChildEntry = new Entry();
final Entry childEntry = new Entry();
childEntry.setName("entry");
menuStructureWithChildEntry.addChild(childEntry);
assertThat(builtMenuStructure, equalTo(menuStructureWithChildEntry));
}
Aggregations