use of org.freeplane.core.ui.menubuilders.generic.Entry 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);
}
use of org.freeplane.core.ui.menubuilders.generic.Entry 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);
}
use of org.freeplane.core.ui.menubuilders.generic.Entry 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);
}
use of org.freeplane.core.ui.menubuilders.generic.Entry 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);
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class JMenuItemBuilderTest method createsGroupWithAction.
@Test
public void createsGroupWithAction() {
Entry parentMenuEntry = new Entry();
final JMenu parentMenu = new JMenu();
new EntryAccessor().setComponent(parentMenuEntry, parentMenu);
parentMenuEntry.addChild(groupEntry);
groupEntry.addChild(actionEntry);
new EntryAccessor().setAction(groupEntry, action);
menuActionGroupBuilder.visit(groupEntry);
final JMenuItem menuItem = getFirstSubMenuItem(groupEntry);
assertThatMenuItemHasCorrectAction(menuItem);
}
Aggregations