use of org.freeplane.core.ui.menubuilders.action.AcceleratebleActionProvider in project freeplane by freeplane.
the class JMenuRadioGroupBuilderTest method setup.
@Before
public void setup() {
actionEntry = new Entry();
action = Mockito.mock(AFreeplaneAction.class);
actionEntry.setName("action");
new EntryAccessor().setAction(actionEntry, action);
menuEntry = new Entry();
menuEntry.setName("menu");
groupEntry = new Entry();
menu = new JMenu();
popupListener = mock(EntryPopupListener.class);
resourceAccessorMock = mock(ResourceAccessor.class);
when(resourceAccessorMock.getRawText(anyString())).thenReturn("");
when(resourceAccessorMock.getRawText("menu")).thenReturn("menu");
accelerators = mock(IAcceleratorMap.class);
acceleratebleActionProvider = new AcceleratebleActionProvider() {
@Override
protected boolean isApplet() {
return false;
}
};
radioGroupBuilder = new JMenuRadioGroupBuilder(popupListener, accelerators, acceleratebleActionProvider, resourceAccessorMock);
}
use of org.freeplane.core.ui.menubuilders.action.AcceleratebleActionProvider in project freeplane by freeplane.
the class JMenuItemBuilderTest method setup.
@Before
public void setup() {
actionEntry = new Entry();
action = Mockito.mock(AFreeplaneAction.class);
actionEntry.setName("action");
when(action.getKey()).thenReturn("action");
when(action.getRawText()).thenReturn("action");
new EntryAccessor().setAction(actionEntry, action);
menuEntry = new Entry();
menuEntry.setName("menu");
groupEntry = new Entry();
menu = new JMenu();
popupListener = mock(EntryPopupListener.class);
resourceAccessorMock = mock(ResourceAccessor.class);
when(resourceAccessorMock.getRawText(anyString())).thenReturn("");
when(resourceAccessorMock.getRawText("menu")).thenReturn("menu");
accelerators = mock(IAcceleratorMap.class);
acceleratebleActionProvider = new AcceleratebleActionProvider() {
@Override
protected boolean isApplet() {
return false;
}
};
menuActionGroupBuilder = new JMenuItemBuilder(popupListener, accelerators, acceleratebleActionProvider, resourceAccessorMock);
}
Aggregations