Package org.zanata.webtrans.client.keys

Examples of org.zanata.webtrans.client.keys.Keys


        List<KeyShortcut> shortcuts = keyShortcutCaptor.getAllValues();

        // testing keys
        KeyShortcut docListKey = shortcuts.get(0);
        assertThat(docListKey.getAllKeys(),
                Matchers.contains(new Keys(Keys.ALT_KEY, 'L')));
        assertThat(docListKey.getDescription(), Matchers.equalTo("doc list"));
        assertThat(docListKey.getContext(),
                Matchers.equalTo(ShortcutContext.Application));

        KeyShortcut editorKey = shortcuts.get(1);
        assertThat(editorKey.getAllKeys(),
                Matchers.contains(new Keys(Keys.ALT_KEY, 'O')));
        assertThat(editorKey.getDescription(), Matchers.equalTo("editor"));
        assertThat(editorKey.getContext(),
                Matchers.equalTo(ShortcutContext.Application));

        KeyShortcut searchKey = shortcuts.get(2);
        assertThat(searchKey.getAllKeys(),
                Matchers.contains(new Keys(Keys.ALT_KEY, 'P')));
        assertThat(searchKey.getDescription(),
                Matchers.equalTo("project wide search"));
        assertThat(searchKey.getContext(),
                Matchers.equalTo(ShortcutContext.Application));
    }
View Full Code Here


        verify(keyShortcutPresenter).register(keyShortcutCaptor.capture());

        // key is 'enter', context is Chat, description is publish chat
        KeyShortcut keyShortcut = keyShortcutCaptor.getValue();
        assertThat(keyShortcut.getAllKeys(), Matchers.hasSize(1));
        Keys keys = keyShortcut.getAllKeys().iterator().next();
        assertThat(keys.getModifiers(), Matchers.equalTo(Keys.NO_MODIFIER));
        assertThat(keys.getKeyCode(), Matchers.equalTo(KeyCodes.KEY_ENTER));
        assertThat(keyShortcut.getDescription(),
                Matchers.equalTo("publish chat"));
        assertThat(keyShortcut.getContext(),
                Matchers.equalTo(ShortcutContext.Chat));
View Full Code Here

                keyShortcutCaptor.capture());
        List<KeyShortcut> shortcuts = keyShortcutCaptor.getAllValues();

        // test keys
        KeyShortcut prevKey = shortcuts.get(0);
        assertThat(prevKey.getAllKeys(), Matchers.equalTo(Keys.setOf(new Keys(
                Keys.ALT_KEY, KeyCodes.KEY_UP), new Keys(Keys.ALT_KEY, 'J'))));
        assertThat(prevKey.getDescription(), Matchers.equalTo("previous row"));
        assertThat(prevKey.getContext(),
                Matchers.equalTo(ShortcutContext.Navigation));
        assertThat(prevKey.getKeyEvent(),
                Matchers.equalTo(KeyShortcut.KeyEvent.KEY_DOWN));

        KeyShortcut nextKey = shortcuts.get(1);
        assertThat(nextKey.getAllKeys(), Matchers.equalTo(Keys.setOf(new Keys(
                Keys.ALT_KEY, KeyCodes.KEY_DOWN), new Keys(Keys.ALT_KEY, 'K'))));
        assertThat(nextKey.getDescription(), Matchers.equalTo("next row"));
        assertThat(nextKey.getContext(),
                Matchers.equalTo(ShortcutContext.Navigation));
        assertThat(nextKey.getKeyEvent(),
                Matchers.equalTo(KeyShortcut.KeyEvent.KEY_DOWN));

        KeyShortcut enterKey = shortcuts.get(2);
        assertThat(enterKey.getAllKeys(), Matchers.contains(new Keys(
                Keys.NO_MODIFIER, KeyCodes.KEY_ENTER)));
        assertThat(enterKey.getDescription(), Matchers.equalTo("open editor"));
        assertThat(enterKey.getContext(),
                Matchers.equalTo(ShortcutContext.Navigation));
        assertThat(enterKey.getKeyEvent(),
View Full Code Here

        spyPresenter.onBind();

        verify(keyShortcutPresenter).register(keyShortcutCaptor.capture());
        KeyShortcut keyShortcut = keyShortcutCaptor.getValue();
        assertThat(keyShortcut.getAllKeys(),
                Matchers.containsInAnyOrder(new Keys(Keys.NO_MODIFIER,
                        KeyCodes.KEY_ENTER)));
        assertThat(keyShortcut.getContext(),
                Matchers.equalTo(ShortcutContext.Glossary));
        assertThat(keyShortcut.getDescription(),
                Matchers.equalTo("search glossary"));
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.client.keys.Keys

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.