Home > wiquery-hotkeys

wiquery-hotkeys

Wiquery-hotkeys is a project mainly written in JAVA and JAVASCRIPT, based on the MIT license.

Plugin wiQuery to use the HotKeys in your Wicket application

Bind the plugin http://github.com/tzuryby/jquery.hotkeys to wiQuery

Example of use: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

WiQuery application

Some hotkeys example

Shortcut on the page

If you done Ctrl+S, the following code will be executed:

function(){ alert('Ctrl+S done'); }

Shortcut on a component

If you done Shift+F8, the following code will be executed:

function(){ alert('Shift+F8 done'); }

package org.odlabs.wiquery.plugins.hotkeys;

import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.WebPage;

/**

  • Homepage */ public class HomePage extends WebPage {

    private static final long serialVersionUID = 1L;

    /**

    • Constructor that is invoked when page is invoked without a session.
    • @param parameters
    • Page parameters */ public HomePage(final PageParameters parameters) { super();

      add(new HotkeysBehavior( JsScopeHotKeys.quickScope("alert('Ctrl+S done');"), HotkeysBehavior.KeysEnum.S, HotkeysBehavior.CombinaisonKeysEnum.Ctrl) );

      WebMarkupContainer component = new WebMarkupContainer("component"); component.add(new HotkeysBehavior( JsScopeHotKeys.quickScope("alert('Shift+F8 done');"), HotkeysBehavior.KeysEnum.F8, HotkeysBehavior.CombinaisonKeysEnum.Shift) ); component.add(new HotkeysBehavior( JsScopeHotKeys.quickScope("alert('Ctrl+S done on component');"), HotkeysBehavior.KeysEnum.S, HotkeysBehavior.CombinaisonKeysEnum.Ctrl) ); add(component); } }

Previous:avlaccumulator