Search in sources :

Example 1 with MenuBuildProcessFactory

use of org.freeplane.core.ui.menubuilders.menu.MenuBuildProcessFactory 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);
}
Also used : BuildPhaseListener(org.freeplane.core.ui.menubuilders.generic.BuildPhaseListener) InputStreamReader(java.io.InputStreamReader) IUserInputListenerFactory(org.freeplane.core.ui.IUserInputListenerFactory) EntriesForAction(org.freeplane.core.ui.menubuilders.action.EntriesForAction) InputStream(java.io.InputStream) PhaseProcessor(org.freeplane.core.ui.menubuilders.generic.PhaseProcessor) BufferedReader(java.io.BufferedReader) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) MenuBuildProcessFactory(org.freeplane.core.ui.menubuilders.menu.MenuBuildProcessFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

BufferedReader (java.io.BufferedReader)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 JPopupMenu (javax.swing.JPopupMenu)1 JToolBar (javax.swing.JToolBar)1 IUserInputListenerFactory (org.freeplane.core.ui.IUserInputListenerFactory)1 EntriesForAction (org.freeplane.core.ui.menubuilders.action.EntriesForAction)1 BuildPhaseListener (org.freeplane.core.ui.menubuilders.generic.BuildPhaseListener)1 PhaseProcessor (org.freeplane.core.ui.menubuilders.generic.PhaseProcessor)1 MenuBuildProcessFactory (org.freeplane.core.ui.menubuilders.menu.MenuBuildProcessFactory)1 BeforeClass (org.junit.BeforeClass)1