Search in sources :

Example 1 with AcceleratebleActionProvider

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);
}
Also used : ResourceAccessor(org.freeplane.core.ui.menubuilders.generic.ResourceAccessor) IAcceleratorMap(org.freeplane.core.ui.menubuilders.action.IAcceleratorMap) AcceleratebleActionProvider(org.freeplane.core.ui.menubuilders.action.AcceleratebleActionProvider) Entry(org.freeplane.core.ui.menubuilders.generic.Entry) AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) EntryAccessor(org.freeplane.core.ui.menubuilders.generic.EntryAccessor) JMenu(javax.swing.JMenu) EntryPopupListener(org.freeplane.core.ui.menubuilders.generic.EntryPopupListener) Before(org.junit.Before)

Example 2 with AcceleratebleActionProvider

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);
}
Also used : ResourceAccessor(org.freeplane.core.ui.menubuilders.generic.ResourceAccessor) IAcceleratorMap(org.freeplane.core.ui.menubuilders.action.IAcceleratorMap) AcceleratebleActionProvider(org.freeplane.core.ui.menubuilders.action.AcceleratebleActionProvider) Entry(org.freeplane.core.ui.menubuilders.generic.Entry) AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) EntryAccessor(org.freeplane.core.ui.menubuilders.generic.EntryAccessor) JMenu(javax.swing.JMenu) EntryPopupListener(org.freeplane.core.ui.menubuilders.generic.EntryPopupListener) Before(org.junit.Before)

Aggregations

JMenu (javax.swing.JMenu)2 AFreeplaneAction (org.freeplane.core.ui.AFreeplaneAction)2 AcceleratebleActionProvider (org.freeplane.core.ui.menubuilders.action.AcceleratebleActionProvider)2 IAcceleratorMap (org.freeplane.core.ui.menubuilders.action.IAcceleratorMap)2 Entry (org.freeplane.core.ui.menubuilders.generic.Entry)2 EntryAccessor (org.freeplane.core.ui.menubuilders.generic.EntryAccessor)2 EntryPopupListener (org.freeplane.core.ui.menubuilders.generic.EntryPopupListener)2 ResourceAccessor (org.freeplane.core.ui.menubuilders.generic.ResourceAccessor)2 Before (org.junit.Before)2