Package io.jmix.flowui.kit.component
Class KeyCombination
java.lang.Object
io.jmix.flowui.kit.component.KeyCombination
Stores information about key, modifiers and additional settings that describe shortcut combinations.
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.vaadin.flow.component.Keyprotected static final Stringprotected final com.vaadin.flow.component.KeyModifier[]protected com.vaadin.flow.component.Component[]protected boolean - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKeyCombination(com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers)  - 
Method Summary
Modifier and TypeMethodDescriptionstatic KeyCombinationcreate(com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers) Creates a newKeyCombinationinstance from passedKeyand modifiers.static KeyCombinationCreates a newKeyCombinationinstance from a string representation.static KeyCombinationCreates a newKeyCombinationinstance from a string representation.booleanformat()com.vaadin.flow.component.KeygetKey()com.vaadin.flow.component.KeyModifier[]com.vaadin.flow.component.Component[]inthashCode()booleanvoidsetResetFocusOnActiveElement(boolean resetFocusOnActiveElement) Reset the focus for active focused element.toString()static com.vaadin.flow.component.KeyParses a newKeyfrom a string representation. 
- 
Field Details
- 
KEY_FIELD_PREFIX
- See Also:
 
 - 
key
protected final com.vaadin.flow.component.Key key - 
keyModifiers
protected final com.vaadin.flow.component.KeyModifier[] keyModifiers - 
listenOnComponents
protected com.vaadin.flow.component.Component[] listenOnComponents - 
resetFocusOnActiveElement
protected boolean resetFocusOnActiveElement 
 - 
 - 
Constructor Details
- 
KeyCombination
protected KeyCombination(com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers)  
 - 
 - 
Method Details
- 
getKey
public com.vaadin.flow.component.Key getKey()- Returns:
 - keyboard key
 
 - 
getKeyModifiers
@Nullable public com.vaadin.flow.component.KeyModifier[] getKeyModifiers()- Returns:
 - modifier keys
 
 - 
getListenOnComponents
@Nullable public com.vaadin.flow.component.Component[] getListenOnComponents()- Returns:
 - components onto which the shortcut listeners are bound
 
 - 
isResetFocusOnActiveElement
public boolean isResetFocusOnActiveElement()- Returns:
 trueif the focus should be reset for the active focused element,falseotherwise
 - 
setResetFocusOnActiveElement
public void setResetFocusOnActiveElement(boolean resetFocusOnActiveElement) Reset the focus for active focused element. Lose focus (i.e., it’s blurred) and receive focus again before a shortcut is triggered for this key combination. This ensures any pending input value change events for that focused element are submitted before a shortcut is activated.
The resetFocusOnActiveElement isfalseby default.- Parameters:
 resetFocusOnActiveElement- whether to reset focus
 - 
create
public static KeyCombination create(com.vaadin.flow.component.Key key, com.vaadin.flow.component.KeyModifier... keyModifiers) Creates a newKeyCombinationinstance from passedKeyand modifiers.- Parameters:
 key- primary Key used to trigger the shortcutkeyModifiers-KeyModifiersthat need to be pressed along with thekeyfor the shortcut to trigger- Returns:
 - new instance
 
 - 
create
Creates a newKeyCombinationinstance from a string representation.- Parameters:
 keyString- string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.- Returns:
 - new instance
 
 - 
create
@Nullable public static KeyCombination create(@Nullable String keyString, com.vaadin.flow.component.Component... listenOnComponents) Creates a newKeyCombinationinstance from a string representation.- Parameters:
 keyString- string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.listenOnComponents-Componentsonto which the shortcut listeners are bound. Must not benull. Must not containnull. Must not have duplicate components. Must beFocusable, or its nested components must beFocusable. For components that do not support focus, theKeyCombinationwill only fire if its nested components have focus.- Returns:
 - new instance
 
 - 
valueOf
Parses a newKeyfrom a string representation.- Parameters:
 keyString- a string representingKeyobject, e.g. "Alt", "L"- Returns:
 - a 
Keyrepresenting passed string 
 - 
format
- Returns:
 - a string representation of this 
KeyCombination, e.g.Alt+L 
 - 
equals
 - 
hashCode
public int hashCode() - 
toString
 
 -