Package com.vaadin.event

Examples of com.vaadin.event.ShortcutAction$KeyCode


                log.log(action.getCaption() + " pressed in window");
            }

            @Override
            public Action[] getActions(Object target, Object sender) {
                ShortcutAction enter = new ShortcutAction("enter",
                        ShortcutAction.KeyCode.ENTER, null);
                ShortcutAction space = new ShortcutAction("space",
                        ShortcutAction.KeyCode.SPACEBAR, null);
                return new Action[] { enter, space };
            }
        });
View Full Code Here


                getMainWindow().getCaption() + " - Added handler");
        Handler actionHandler = new Handler() {

            @Override
            public Action[] getActions(Object target, Object sender) {
                return new Action[] { new ShortcutAction("Ctrl+Left",
                        ShortcutAction.KeyCode.ARROW_LEFT,
                        new int[] { ModifierKey.CTRL }) };
            }

            @Override
View Full Code Here

    public void addAnother() {
        Handler actionHandler = new Handler() {

            @Override
            public Action[] getActions(Object target, Object sender) {
                return new Action[] { new ShortcutAction("Ctrl+Right",
                        ShortcutAction.KeyCode.ARROW_RIGHT,
                        new int[] { ModifierKey.CTRL }) };
            }

            @Override
View Full Code Here

                getMainWindow().addWindow(win);
                layout.addComponent(new Label("SPACE notifies, ESC closes."));

                win.addActionHandler(new Action.Handler() {

                    ShortcutAction esc = new ShortcutAction("Close",
                            ShortcutAction.KeyCode.ESCAPE, null);
                    ShortcutAction spc = new ShortcutAction("Space",
                            ShortcutAction.KeyCode.SPACEBAR, null);

                    @Override
                    public Action[] getActions(Object target, Object sender) {
                        return new Action[] { esc, spc };
View Full Code Here

        w.addComponent(help);

        w.addActionHandler(new Handler() {

            final ShortcutAction a1 = new ShortcutAction("action", KeyCode.X,
                    new int[] { ModifierKey.CTRL });
            final ShortcutAction a2 = new ShortcutAction("action", KeyCode.C,
                    new int[] { ModifierKey.CTRL });

            Action[] actions = new Action[] { a1, a2 };

            @Override
View Full Code Here

            }
        });

        window.addActionHandler(new Handler() {

            private Action[] s = new Action[] { new ShortcutAction("^Save") };

            @Override
            public Action[] getActions(Object target, Object sender) {
                return s;
            }
View Full Code Here

        panel.setCaption(panel.getCaption() + " - Added handler");
        Handler actionHandler = new Handler() {

            @Override
            public Action[] getActions(Object target, Object sender) {
                return new Action[] { new ShortcutAction("Ctrl+Left",
                        ShortcutAction.KeyCode.ARROW_LEFT,
                        new int[] { ModifierKey.CTRL }) };
            }

            @Override
View Full Code Here

    public void addAnother() {
        Handler actionHandler = new Handler() {

            @Override
            public Action[] getActions(Object target, Object sender) {
                return new Action[] { new ShortcutAction("Ctrl+Right",
                        ShortcutAction.KeyCode.ARROW_RIGHT,
                        new int[] { ModifierKey.CTRL }) };
            }

            @Override
View Full Code Here

        final TextField testField = new TextField();
        testField.setInputPrompt("Enter a value");

        getMainWindow().addActionHandler(new Action.Handler() {

            final Action enter = new ShortcutAction("enter",
                    ShortcutAction.KeyCode.ENTER, null);

            @Override
            public Action[] getActions(Object target, Object sender) {
                return new Action[] { enter };
View Full Code Here

    }

    private void addActionHandler(Table table) {
        table.addActionHandler(new Handler() {

            Action tabNext = new ShortcutAction("Shift",
                    ShortcutAction.KeyCode.TAB, null);
            Action tabPrev = new ShortcutAction("Shift+Tab",
                    ShortcutAction.KeyCode.TAB,
                    new int[] { ShortcutAction.ModifierKey.SHIFT });
            Action curDown = new ShortcutAction("Down",
                    ShortcutAction.KeyCode.ARROW_DOWN, null);
            Action curUp = new ShortcutAction("Up",
                    ShortcutAction.KeyCode.ARROW_UP, null);
            Action enter = new ShortcutAction("Enter",
                    ShortcutAction.KeyCode.ENTER, null);
            Action add = new ShortcutAction("Add Below",
                    ShortcutAction.KeyCode.A, null);
            Action delete = new ShortcutAction("Delete",
                    ShortcutAction.KeyCode.DELETE, null);

            @Override
            public void handleAction(Action action, Object sender, Object target) {
                System.out.println(action.getCaption());
View Full Code Here

TOP

Related Classes of com.vaadin.event.ShortcutAction$KeyCode

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.