Package com.vaadin.ui
Class Window.CloseShortcut
- java.lang.Object
-
- com.vaadin.event.Action
-
- com.vaadin.event.ShortcutAction
-
- com.vaadin.event.ShortcutListener
-
- com.vaadin.ui.Window.CloseShortcut
-
- All Implemented Interfaces:
Action.Listener,Serializable
- Enclosing class:
- Window
public static class Window.CloseShortcut extends ShortcutListener
AShortcutListenerspecifically made to define a keyboard shortcut that closes the window.// within the window using helper window.setCloseShortcut(KeyCode.ESCAPE, null); // or globally getUI().addAction(new Window.CloseShortcut(window, KeyCode.ESCAPE));- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.event.ShortcutAction
ShortcutAction.KeyCode, ShortcutAction.ModifierKey
-
Nested classes/interfaces inherited from class com.vaadin.event.Action
Action.Container, Action.Handler, Action.Listener, Action.Notifier, Action.ShortcutNotifier
-
-
Field Summary
Fields Modifier and Type Field Description protected Windowwindow-
Fields inherited from class com.vaadin.event.ShortcutAction
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT
-
-
Constructor Summary
Constructors Constructor Description CloseShortcut(Window window, int keyCode)Creates a keyboard shortcut for closing the given window using the givenShortcutAction.KeyCode.CloseShortcut(Window window, int keyCode, int... modifiers)Creates a keyboard shortcut for closing the given window using the givenShortcutAction.KeyCodeandShortcutAction.ModifierKeys.CloseShortcut(Window window, String shorthandCaption)Creates a keyboard shortcut for closing the given window using the shorthand notation defined inShortcutAction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(int keyCode, int... modifiers)voidhandleAction(Object sender, Object target)-
Methods inherited from class com.vaadin.event.ShortcutAction
getKeyCode, getModifiers
-
Methods inherited from class com.vaadin.event.Action
getCaption, getIcon, setCaption, setCaption, setIcon
-
-
-
-
Field Detail
-
window
protected Window window
-
-
Constructor Detail
-
CloseShortcut
public CloseShortcut(Window window, String shorthandCaption)
Creates a keyboard shortcut for closing the given window using the shorthand notation defined inShortcutAction.- Parameters:
window- to be closed when the shortcut is invokedshorthandCaption- the caption with shortcut keycode and modifiers indicated
-
CloseShortcut
public CloseShortcut(Window window, int keyCode, int... modifiers)
Creates a keyboard shortcut for closing the given window using the givenShortcutAction.KeyCodeandShortcutAction.ModifierKeys.- Parameters:
window- to be closed when the shortcut is invokedkeyCode- KeyCode to react tomodifiers- optional modifiers for shortcut
-
CloseShortcut
public CloseShortcut(Window window, int keyCode)
Creates a keyboard shortcut for closing the given window using the givenShortcutAction.KeyCode.- Parameters:
window- to be closed when the shortcut is invokedkeyCode- KeyCode to react to
-
-
Method Detail
-
handleAction
public void handleAction(Object sender, Object target)
- Specified by:
handleActionin interfaceAction.Listener- Specified by:
handleActionin classShortcutListener
-
equals
public boolean equals(int keyCode, int... modifiers)
-
-