Search in sources :

Example 1 with JToolbarBuilder

use of org.freeplane.core.ui.menubuilders.menu.JToolbarBuilder 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));
}
Also used : RecursiveMenuStructureProcessor(org.freeplane.core.ui.menubuilders.generic.RecursiveMenuStructureProcessor) FreeplaneActions(org.freeplane.features.mode.FreeplaneActions) IUserInputListenerFactory(org.freeplane.core.ui.IUserInputListenerFactory) BuilderDestroyerPair(org.freeplane.core.ui.menubuilders.generic.BuilderDestroyerPair) JToolbarBuilder(org.freeplane.core.ui.menubuilders.menu.JToolbarBuilder) JToolbarComponentBuilder(org.freeplane.core.ui.menubuilders.menu.JToolbarComponentBuilder) JToolBar(javax.swing.JToolBar) Before(org.junit.Before)

Aggregations

JToolBar (javax.swing.JToolBar)1 IUserInputListenerFactory (org.freeplane.core.ui.IUserInputListenerFactory)1 BuilderDestroyerPair (org.freeplane.core.ui.menubuilders.generic.BuilderDestroyerPair)1 RecursiveMenuStructureProcessor (org.freeplane.core.ui.menubuilders.generic.RecursiveMenuStructureProcessor)1 JToolbarBuilder (org.freeplane.core.ui.menubuilders.menu.JToolbarBuilder)1 JToolbarComponentBuilder (org.freeplane.core.ui.menubuilders.menu.JToolbarComponentBuilder)1 FreeplaneActions (org.freeplane.features.mode.FreeplaneActions)1 Before (org.junit.Before)1