|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.FocusWidget
Abstract base class for most widgets that can receive keyboard focus.
Field Summary | |
protected static com.google.gwt.user.client.ui.impl.FocusImpl |
impl
FocusImpl contains browser specific focus code for focusable
widgets. |
Constructor Summary | |
protected |
FocusWidget(Element elem)
Creates a new focus component that wraps the specified browser element. |
Method Summary | |
void |
addClickListener(ClickListener listener)
Adds a listener interface to receive click events. |
void |
addFocusListener(FocusListener listener)
Adds a listener interface to receive mouse events. |
void |
addKeyboardListener(KeyboardListener listener)
Adds a listener interface to receive keyboard events. |
int |
getTabIndex()
Gets the widget's position in the tab index. |
boolean |
isEnabled()
Gets whether this widget is enabled. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
void |
removeClickListener(ClickListener listener)
Removes a previously added listener interface. |
void |
removeFocusListener(FocusListener listener)
Removes a previously added listener interface. |
void |
removeKeyboardListener(KeyboardListener listener)
Removes a previously added listener interface. |
void |
setAccessKey(char key)
Sets the widget's 'access key'. |
void |
setEnabled(boolean enabled)
Sets whether this widget is enabled. |
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget. |
void |
setTabIndex(int index)
Sets the widget's position in the tab index. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
getParent, isAttached, onAttach, onDetach, onLoad, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final com.google.gwt.user.client.ui.impl.FocusImpl impl
FocusImpl
contains browser specific focus code for focusable
widgets. This FocusImpl
instance is intentionally _not_ rebound, as the
base implementation works on all browsers for truly focusable widgets. The
special cases are only needed for things that aren't naturally focusable on
some browsers, such as DIVs.
Constructor Detail |
protected FocusWidget(Element elem)
elem
- the element to be wrappedMethod Detail |
public void addClickListener(ClickListener listener)
SourcesClickEvents
addClickListener
in interface SourcesClickEvents
listener
- the listener interface to addpublic void addFocusListener(FocusListener listener)
SourcesFocusEvents
addFocusListener
in interface SourcesFocusEvents
listener
- the listener interface to addpublic void addKeyboardListener(KeyboardListener listener)
SourcesKeyboardEvents
addKeyboardListener
in interface SourcesKeyboardEvents
listener
- the listener interface to addpublic int getTabIndex()
HasFocus
getTabIndex
in interface HasFocus
public boolean isEnabled()
true
if the widget is enabledpublic void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
public void removeClickListener(ClickListener listener)
SourcesClickEvents
removeClickListener
in interface SourcesClickEvents
listener
- the listener interface to removepublic void removeFocusListener(FocusListener listener)
SourcesFocusEvents
removeFocusListener
in interface SourcesFocusEvents
listener
- the listener interface to removepublic void removeKeyboardListener(KeyboardListener listener)
SourcesKeyboardEvents
removeKeyboardListener
in interface SourcesKeyboardEvents
listener
- the listener interface to removepublic void setAccessKey(char key)
HasFocus
setAccessKey
in interface HasFocus
key
- the widget's access keypublic void setEnabled(boolean enabled)
enabled
- true
to enable the widget, false
to disable itpublic void setFocus(boolean focused)
HasFocus
setFocus
in interface HasFocus
focused
- whether this widget should take focus or release itpublic void setTabIndex(int index)
HasFocus
-1
will cause this
widget to be removed from the tab order.
setTabIndex
in interface HasFocus
index
- the widget's tab index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |