Examples of HotkeyRunnable


Examples of com.alee.managers.hotkey.HotkeyRunnable

        container = new WebPanel ();
        container.setLayout ( new ComponentPanelLayout () );
        add ( container, BorderLayout.CENTER );

        // Previous action hotkeys
        final HotkeyRunnable prevAction = new HotkeyRunnable ()
        {
            @Override
            public void run ( final KeyEvent e )
            {
                if ( upDownHotkeysAllowed && Hotkey.UP.isTriggered ( e ) || leftRightHotkeysAllowed && Hotkey.LEFT.isTriggered ( e ) )
                {
                    final int index = getFocusedElementIndex ();
                    if ( index == -1 )
                    {
                        focusElement ( getElementCount () - 1 );
                    }
                    else
                    {
                        focusElement ( index > 0 ? index - 1 : getElementCount () - 1 );
                    }
                }
            }
        };
        HotkeyManager.registerHotkey ( this, this, Hotkey.UP, prevAction );
        HotkeyManager.registerHotkey ( this, this, Hotkey.LEFT, prevAction );

        // Next action hotkeys
        final HotkeyRunnable nextAction = new HotkeyRunnable ()
        {
            @Override
            public void run ( final KeyEvent e )
            {
                if ( upDownHotkeysAllowed && Hotkey.DOWN.isTriggered ( e ) || leftRightHotkeysAllowed && Hotkey.RIGHT.isTriggered ( e ) )
View Full Code Here

Examples of com.alee.managers.hotkey.HotkeyRunnable

                                final WebPopup licensePopup = new WebPopup ();
                                final WebTextArea textArea = new WebTextArea ( license );
                                textArea.setEditable ( false );
                                licensePopup.add ( new WebScrollPane ( textArea, false ) );
                                licensePopup.showPopupAsModal ( fileLink, true, true );
                                HotkeyManager.registerHotkey ( textArea, Hotkey.ESCAPE, new HotkeyRunnable ()
                                {
                                    @Override
                                    public void run ( final KeyEvent e )
                                    {
                                        licensePopup.hidePopup ();
View Full Code Here

Examples of com.alee.managers.hotkey.HotkeyRunnable

    {
        // L&F
        WebLookAndFeel.install ();

        // Orientation change listener
        HotkeyManager.registerHotkey ( Hotkey.ALT_R, new HotkeyRunnable ()
        {
            @Override
            public void run ( final KeyEvent e )
            {
                WebLookAndFeel.changeOrientation ();
            }
        } );

        // Language change listener
        HotkeyManager.registerHotkey ( Hotkey.ALT_L, new HotkeyRunnable ()
        {
            @Override
            public void run ( final KeyEvent e )
            {
                final String current = LanguageManager.getLanguage ();
View Full Code Here

Examples of com.alee.managers.hotkey.HotkeyRunnable

                                g2d.drawRect ( bounds.x, bounds.y - 1, bounds.width - 1, bounds.height );
                            }
                        } );
                        window.add ( info, BorderLayout.SOUTH );

                        HotkeyManager.registerHotkey ( screen, Hotkey.ESCAPE, new HotkeyRunnable ()
                        {
                            @Override
                            public void run ( final KeyEvent e )
                            {
                                if ( window != null )
View Full Code Here

Examples of com.alee.managers.hotkey.HotkeyRunnable

        // Customizing tabbed pane
        updateTabbedPaneCustomizer ( documentPane );

        // Some hotkeys
        HotkeyManager.registerHotkey ( tabbedPane, tabbedPane, Hotkey.CTRL_W, new HotkeyRunnable ()
        {
            @Override
            public void run ( final KeyEvent e )
            {
                closeSelected ();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.