public class FocusUtil extends Object
Widget
s to implement
Focusable
.Constructor and Description |
---|
FocusUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
focusOnFirstFocusableElement(com.google.gwt.dom.client.Element parent)
Focus on the first focusable child Element of a parent Element.
|
static void |
focusOnLastFocusableElement(com.google.gwt.dom.client.Element parent)
Focus on the last focusable child Element of a parent Element.
|
static com.google.gwt.dom.client.Element[] |
getFocusableChildren(com.google.gwt.dom.client.Element parent)
Get all the child elements of a parent that are focusable.
|
static int |
getTabIndex(com.google.gwt.user.client.ui.Widget focusable)
Gets the widget's position in the tab index.
|
static void |
setAccessKey(com.google.gwt.user.client.ui.Widget focusable,
char key)
Sets the access key property
|
static void |
setFocus(com.google.gwt.user.client.ui.Widget focusable,
boolean focus)
Explicitly focus/unfocus the given widget.
|
static void |
setTabIndex(com.google.gwt.user.client.ui.Widget focusable,
int tabIndex)
Sets the widget's position in the tab index.
|
public static void setAccessKey(com.google.gwt.user.client.ui.Widget focusable, char key)
focusable
- The widget for which we want to set the access key.key
- The access key to setpublic static void setFocus(com.google.gwt.user.client.ui.Widget focusable, boolean focus)
focusable
- the widget to focus/unfocusfocused
- whether this widget should take focus or release itpublic static void setTabIndex(com.google.gwt.user.client.ui.Widget focusable, int tabIndex)
-1
will cause the widget to
be removed from the tab order.focusable
- The widgettabIndex
- the widget's tab indexpublic static int getTabIndex(com.google.gwt.user.client.ui.Widget focusable)
focusable
- The widgetpublic static com.google.gwt.dom.client.Element[] getFocusableChildren(com.google.gwt.dom.client.Element parent)
parent
- The parent element whose children to search.public static void focusOnFirstFocusableElement(com.google.gwt.dom.client.Element parent)
parent
- The parent element to scan for a focusable child.public static void focusOnLastFocusableElement(com.google.gwt.dom.client.Element parent)
parent
- The parent element to scan for a focusable child.Copyright © 2019 Vaadin Ltd. All rights reserved.