Package com.jbstrap.ui
Interface HandleHotKey<T extends Component<?>>
- Type Parameters:
T
- The component type
- All Known Implementing Classes:
ActivityStream
,Badge
,Button
,CodeViewer
,ColorPicker
,ComboboxItem
,DatePicker
,DateRangePicker
,DropDownButton
,DropDownButton.DropDownMenuItem
,DualListBox
,FileItem
,FileMiniature
,Form
,Image
,IntegerItem
,Link
,ListGrid
,ListItem
,LoadButton
,ModalWindow
,NavBarItem
,NumberItem
,PasswordItem
,RadioButtonItem
,SelectorItem
,StaticTextItem
,SwitchItem
,Table
,TabPage
,TextFilter
,TextItem
,Treeview
,TreeviewNode
public interface HandleHotKey<T extends Component<?>>
Hot key compatible components.
Components that implement this interface can use hot keys. If the user presses the specified key, or key combination, a previously specified event handler will be executed, or if no handler was defined, the click handler will be used.
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault T
addHotKey
(int hotKey) Adds the specified hot key to the component.default T
addHotKey
(int hotKey, HotKeyEventHandler handler) Adds the specified hot key to the component.default T
removeHotKey
(int hotKey) Removes the specified hot key from the componentdefault T
Removes every hot key from the component
-
Method Details
-
addHotKey
Adds the specified hot key to the component. If the user presses the hot key, the component's Click event handler will be fired. If the hot key was assigned to an input field, the field will gain focus.- Parameters:
hotKey
- The button combination, that will be assigned to the component. This button combination can be specified, by using theKey
class' constants. If the hot key is a combination of two buttons, then the values must be added. For example, the CTRL+S combination is specified asKEY.CTRL + KEY.KEY_S
- Returns:
- The component
-
addHotKey
Adds the specified hot key to the component. If the user presses the hot key, the specified event handler will be fired- Parameters:
hotKey
- The button combination, that will be assigned to the component. This button combination can be specified, by using theKey
class' constants. If the hot key is a combination of two buttons, then the values must be added. For example, the CTRL+S combination is specified asKEY.CTRL + KEY.KEY_S
handler
- TheHotKeyEventHandler
implementation- Returns:
- The component
- See Also:
-
removeHotKey
Removes the specified hot key from the component- Parameters:
hotKey
- The button combination assigned to the component. This button combination can be specified, by using theKey
class' constants. If the hot key is a combination of two buttons, then the values must be added. For example, the CTRL+S combination is specified asKEY.CTRL + KEY.KEY_S
- Returns:
- The component
-
removeHotKeys
Removes every hot key from the component- Returns:
- The component
-