com.vaadin.ui
Class Window.CloseShortcut

java.lang.Object
  extended by com.vaadin.event.Action
      extended by com.vaadin.event.ShortcutAction
          extended by com.vaadin.event.ShortcutListener
              extended by com.vaadin.ui.Window.CloseShortcut
All Implemented Interfaces:
Action.Listener, Serializable
Enclosing class:
Window

public static class Window.CloseShortcut
extends ShortcutListener

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:
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
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.ModifierKeys.
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)
Creates a keyboard shortcut for closing the given window using the shorthand notation defined in ShortcutAction.

Parameters:
window - to be closed when the shortcut is invoked
shorthandCaption - the caption with shortcut keycode and modifiers indicated

Window.CloseShortcut

public Window.CloseShortcut(Window window,
                            int keyCode,
                            int... modifiers)
Creates a keyboard shortcut for closing the given window using the given ShortcutAction.KeyCode and ShortcutAction.ModifierKeys.

Parameters:
window - to be closed when the shortcut is invoked
keyCode - KeyCode to react to
modifiers - optional modifiers for shortcut

Window.CloseShortcut

public Window.CloseShortcut(Window window,
                            int keyCode)
Creates a keyboard shortcut for closing the given window using the given ShortcutAction.KeyCode.

Parameters:
window - to be closed when the shortcut is invoked
keyCode - KeyCode to react to
Method Detail

handleAction

public void handleAction(Object sender,
                         Object target)
Specified by:
handleAction in interface Action.Listener
Specified by:
handleAction in class ShortcutListener


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.