com.vaadin.client.ui
Class FocusUtil

java.lang.Object
  extended by com.vaadin.client.ui.FocusUtil

public class FocusUtil
extends java.lang.Object

A helper class used to make it easier for Widgets to implement Focusable.

Since:
7.0.3
Version:
@VERSION@
Author:
Vaadin Ltd

Constructor Summary
FocusUtil()
           
 
Method Summary
static int getTabIndex(Widget focusable)
          Gets the widget's position in the tab index.
static void setAccessKey(Widget focusable, char key)
          Sets the access key property
static void setFocus(Widget focusable, boolean focus)
          Explicitly focus/unfocus the given widget.
static void setTabIndex(Widget focusable, int tabIndex)
          Sets the widget's position in the tab index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FocusUtil

public FocusUtil()
Method Detail

setAccessKey

public static void setAccessKey(Widget focusable,
                                char key)
Sets the access key property

Parameters:
focusable - The widget for which we want to set the access key.
key - The access key to set

setFocus

public static void setFocus(Widget focusable,
                            boolean focus)
Explicitly focus/unfocus the given widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events.

Parameters:
focusable - the widget to focus/unfocus
focused - whether this widget should take focus or release it

setTabIndex

public static void setTabIndex(Widget focusable,
                               int tabIndex)
Sets the widget's position in the tab index. If more than one widget has the same tab index, each such widget will receive focus in an arbitrary order. Setting the tab index to -1 will cause the widget to be removed from the tab order.

Parameters:
focusable - The widget
tabIndex - the widget's tab index

getTabIndex

public static int getTabIndex(Widget focusable)
Gets the widget's position in the tab index.

Parameters:
focusable - The widget
Returns:
the widget's tab index


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