psdi.webclient.system.controller

Class Hotkeys

  • java.lang.Object
    • psdi.webclient.system.controller.Hotkeys


  • public class Hotkeys
    extends java.lang.Object
    Encapsulates a list of hotkeys that apply to a single application. Because a particular key can have different events depending on the Ctrl and Alt key combinations, a hashmap is used; the key is the javascript keycode and the value is the list of the events for that keycode, with the corresponding ctrl and alt values needed to generate that event. A hotkey event is represented by an array (List) of params as follows: param[0] = javascript keycode for the hotkey param[1] = boolean value of the ctrl key for the hotkey param[2] = boolean value of the alt key for the hotkey param[3] = id of the target for the hotkey event param[4] = method name of the hotkey event
    • Constructor Detail

      • Hotkeys

        public Hotkeys()
    • Method Detail

      • reset

        public void reset()
        Initializes the array of hotkeys to an empty state.
      • addHotkey

        public java.lang.String addHotkey(WebClientSession wcs,
                                          java.lang.String hotkey,
                                          java.lang.String target,
                                          java.lang.String eventname)
        Adds a single hotkey to the hotkeys hashmap
        Parameters:
        hotkey - the combination of the keys that invokes the hotkey, e.g. "CTRL+ALT+L"
        target - the id of the target for the hotkey event
        eventname - the method name for the hotkey event
      • localize

        public java.lang.String localize(WebClientSession wcs,
                                         java.lang.String inkey)
      • getKeycodes

        public java.util.Set getKeycodes()
        Returns:
        Set of all the keycodes
      • getHotkeysForKeycode

        public java.util.List getHotkeysForKeycode(int keycode)
        Parameters:
        keycode -
        Returns:
        list of all hotkeys for the specified keycode
      • getCtrlState

        public boolean getCtrlState(java.lang.String hotkey)
      • getAltState

        public boolean getAltState(java.lang.String hotkey)
      • getAccessKey

        public char getAccessKey(java.lang.String hotkey)