We use cookies to serve our customers and website visitors in the best possible way. Cookies are used for the proper functioning of the website and for improving the user experience, monitoring visitor traffic and marketing purposes. By continuing to browse the site, you agree to our use of cookies. You can read more about cookies here.
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:
Enclosing class:
- extends ShortcutListener
public static class Window.CloseShortcut
A ShortcutListener
specifically made to define a keyboard
shortcut that closes the window.
// within the window using helper
subWindow.setCloseShortcut(KeyCode.ESCAPE, null);
// or globally
getWindow().addAction(new Window.CloseShortcut(subWindow, KeyCode.ESCAPE));
See Also:
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 | |
---|---|
protected Window |
window
|
Fields inherited from class com.vaadin.event.ShortcutAction |
---|
SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT |
Constructor Summary | |
---|---|
Window.CloseShortcut(Window window,
int keyCode)
Creates a keyboard shortcut for closing the given window using the given ShortcutAction.KeyCode . |
|
Window.CloseShortcut(Window window,
int keyCode,
int... modifiers)
Creates a keyboard shortcut for closing the given window using the given ShortcutAction.KeyCode and ShortcutAction.ModifierKey s. |
|
Window.CloseShortcut(Window window,
String shorthandCaption)
Creates a keyboard shortcut for closing the given window using the shorthand notation defined in ShortcutAction . |
Method Summary | |
---|---|
void |
handleAction(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, setIcon |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
window
protected Window window
Constructor Detail |
---|
Window.CloseShortcut
public Window.CloseShortcut(Window window,
String shorthandCaption)
- Parameters:
window
- to be closed when the shortcut is invokedshorthandCaption
- the caption with shortcut keycode and modifiers indicated
Creates a keyboard shortcut for closing the given window using the
shorthand notation defined in ShortcutAction
.
Window.CloseShortcut
public Window.CloseShortcut(Window window,
int keyCode,
int... modifiers)
- Parameters:
window
- to be closed when the shortcut is invokedkeyCode
- KeyCode to react tomodifiers
- optional modifiers for shortcut
Creates a keyboard shortcut for closing the given window using the
given ShortcutAction.KeyCode
and ShortcutAction.ModifierKey
s.
Window.CloseShortcut
public Window.CloseShortcut(Window window,
int keyCode)
- Parameters:
window
- to be closed when the shortcut is invokedkeyCode
- KeyCode to react to
Creates a keyboard shortcut for closing the given window using the
given ShortcutAction.KeyCode
.
Method Detail |
---|
handleAction
public void handleAction(Object sender,
Object target)
- Specified by:
handleAction
in interfaceAction.Listener
- Specified by:
handleAction
in classShortcutListener