use of org.freeplane.core.ui.menubuilders.generic.BuildPhaseListener in project freeplane by freeplane.
the class MenuBuilderAcceptanceTest method setup.
@BeforeClass
public static void setup() {
final IUserInputListenerFactory userInputListenerFactory = mock(IUserInputListenerFactory.class);
when(userInputListenerFactory.getToolBar("/main_toolbar")).thenReturn(new JToolBar());
when(userInputListenerFactory.getNodePopupMenu()).thenReturn(new JPopupMenu());
when(userInputListenerFactory.getMapPopup()).thenReturn(new JPopupMenu());
when(userInputListenerFactory.getMenuBar()).thenReturn(TestMenuBarFactory.createFreeplaneMenuBar());
final PhaseProcessor buildProcessor = new MenuBuildProcessFactory(userInputListenerFactory, Controller.getCurrentModeController(), new FreeplaneResourceAccessor(), mock(IAcceleratorMap.class), new EntriesForAction(), Collections.<BuildPhaseListener>emptyList()).getBuildProcessor();
final String menuResource = "/xml/mindmapmodemenu.xml";
final InputStream resource = MenuBuilderAcceptanceTest.class.getResourceAsStream(menuResource);
final BufferedReader reader = new BufferedReader(new InputStreamReader(resource));
menuStructure = XmlEntryStructureBuilder.buildMenuStructure(reader);
buildProcessor.build(menuStructure);
}
Aggregations