Search in sources :

Example 1 with SubtreeProcessor

use of org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor in project freeplane by freeplane.

the class SubtreeProcessorTest method doesNotDestroyEntriesWithoutDelay.

@Test
public void doesNotDestroyEntriesWithoutDelay() throws Exception {
    final SubtreeProcessor childProcessor = new SubtreeProcessor();
    final PhaseProcessor processor = mock(PhaseProcessor.class);
    when(processor.forChildren(Mockito.<Entry>any(), Mockito.<Entry>any())).thenReturn(processor);
    childProcessor.setProcessor(processor);
    final Entry entry = new Entry();
    final Entry child = new Entry();
    entry.addChild(child);
    childProcessor.childEntriesHidden(entry);
    verify(processor, never()).destroy(child);
}
Also used : Entry(org.freeplane.core.ui.menubuilders.generic.Entry) PhaseProcessor(org.freeplane.core.ui.menubuilders.generic.PhaseProcessor) SubtreeProcessor(org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor) Test(org.junit.Test)

Example 2 with SubtreeProcessor

use of org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor in project freeplane by freeplane.

the class SubtreeProcessorTest method destroysEntriesWithDelay.

@Test
public void destroysEntriesWithDelay() throws Exception {
    final SubtreeProcessor childProcessor = new SubtreeProcessor();
    final PhaseProcessor processor = mock(PhaseProcessor.class);
    when(processor.forChildren(Mockito.<Entry>any(), Mockito.<Entry>any())).thenReturn(processor);
    childProcessor.setProcessor(processor);
    final Entry entry = new Entry();
    entry.setAttribute(RecursiveMenuStructureProcessor.PROCESS_ON_POPUP, true);
    final Entry child = new Entry();
    entry.addChild(child);
    childProcessor.childEntriesHidden(entry);
    verify(processor).destroy(child);
}
Also used : Entry(org.freeplane.core.ui.menubuilders.generic.Entry) PhaseProcessor(org.freeplane.core.ui.menubuilders.generic.PhaseProcessor) SubtreeProcessor(org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor) Test(org.junit.Test)

Example 3 with SubtreeProcessor

use of org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor in project freeplane by freeplane.

the class SubtreeProcessorTest method buildsEntriesWithDelay.

@Test
public void buildsEntriesWithDelay() throws Exception {
    final SubtreeProcessor childProcessor = new SubtreeProcessor();
    final PhaseProcessor processor = mock(PhaseProcessor.class);
    when(processor.forChildren(Mockito.<Entry>any(), Mockito.<Entry>any())).thenReturn(processor);
    childProcessor.setProcessor(processor);
    final Entry entry = new Entry();
    entry.setAttribute(RecursiveMenuStructureProcessor.PROCESS_ON_POPUP, true);
    childProcessor.childEntriesWillBecomeVisible(entry);
    verify(processor).buildChildren(entry);
}
Also used : Entry(org.freeplane.core.ui.menubuilders.generic.Entry) PhaseProcessor(org.freeplane.core.ui.menubuilders.generic.PhaseProcessor) SubtreeProcessor(org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor) Test(org.junit.Test)

Example 4 with SubtreeProcessor

use of org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor in project freeplane by freeplane.

the class SubtreeProcessorTest method doesNotBuildEntriesWithoutDelay.

@Test
public void doesNotBuildEntriesWithoutDelay() throws Exception {
    final SubtreeProcessor childProcessor = new SubtreeProcessor();
    final PhaseProcessor processor = mock(PhaseProcessor.class);
    when(processor.forChildren(Mockito.<Entry>any(), Mockito.<Entry>any())).thenReturn(processor);
    childProcessor.setProcessor(processor);
    final Entry entry = new Entry();
    final Entry child = new Entry();
    entry.addChild(child);
    childProcessor.childEntriesWillBecomeVisible(entry);
    verify(processor, never()).build(child);
}
Also used : Entry(org.freeplane.core.ui.menubuilders.generic.Entry) PhaseProcessor(org.freeplane.core.ui.menubuilders.generic.PhaseProcessor) SubtreeProcessor(org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor) Test(org.junit.Test)

Aggregations

Entry (org.freeplane.core.ui.menubuilders.generic.Entry)4 PhaseProcessor (org.freeplane.core.ui.menubuilders.generic.PhaseProcessor)4 SubtreeProcessor (org.freeplane.core.ui.menubuilders.generic.SubtreeProcessor)4 Test (org.junit.Test)4