use of org.freeplane.core.ui.menubuilders.generic.RecursiveMenuStructureProcessor 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.RecursiveMenuStructureProcessor in project freeplane by freeplane.
the class MenuBuilderIntegrationTest method setup.
@Before
public void setup() {
freeplaneActions = mock(FreeplaneActions.class);
recursiveMenuStructureBuilder = new RecursiveMenuStructureProcessor();
recursiveMenuStructureBuilder.setDefaultBuilderPair(EntryVisitor.EMTPY, EntryVisitor.EMTPY);
final IUserInputListenerFactory userInputListenerFactory = mock(IUserInputListenerFactory.class);
toolbar = new JToolBar();
when(userInputListenerFactory.getToolBar("/main_toolbar")).thenReturn(toolbar);
recursiveMenuStructureBuilder.addBuilder("toolbar", new JToolbarBuilder(userInputListenerFactory));
recursiveMenuStructureBuilder.setSubtreeDefaultBuilderPair("toolbar", "toolbar.action");
recursiveMenuStructureBuilder.addBuilderPair("toolbar.action", new BuilderDestroyerPair(new JToolbarComponentBuilder(), null));
}
Aggregations