Class FocusPanel
A simple panel that makes its contents focusable, and adds the ability to
catch mouse and keyboard events.
Constructors
Methods
Constructor Detail
FocusPanel
public FocusPanel()
FocusPanel
public
FocusPanel(
Widget child)
Parameters
- child
-
Method Detail
addClickListener
Adds a listener interface to receive click events.
Parameters
- listener
- the listener interface to add
addFocusListener
Adds a listener interface to receive mouse events.
Parameters
- listener
- the listener interface to add
addKeyboardListener
Adds a listener interface to receive keyboard events.
Parameters
- listener
- the listener interface to add
addMouseListener
Adds a listener interface to receive mouse events.
Parameters
- listener
- the listener interface to add
addMouseWheelListener
Adds a listener interface to receive mouse events.
Parameters
- listener
- the listener interface to add
getTabIndex
public int getTabIndex()
Gets the widget's position in the tab index.
Return Value
the widget's tab index
onBrowserEvent
public void
onBrowserEvent(
Event event)
Parameters
- event
-
removeClickListener
Removes a previously added listener interface.
Parameters
- listener
- the listener interface to remove
removeFocusListener
Removes a previously added listener interface.
Parameters
- listener
- the listener interface to remove
removeKeyboardListener
Removes a previously added listener interface.
Parameters
- listener
- the listener interface to remove
removeMouseListener
Removes a previously added listener interface.
Parameters
- listener
- the listener interface to remove
removeMouseWheelListener
Removes a previously added listener interface.
Parameters
- listener
- the listener interface to remove
setAccessKey
public void setAccessKey(char key)
Sets the widget's 'access key'. This key is used (in conjunction with a
browser-specific modifier key) to automatically focus the widget.
Parameters
- key
- the widget's access key
setFocus
public void setFocus(boolean focused)
Explicitly focus/unfocus this widget. Only one widget can have focus at a
time, and the widget that does will receive all keyboard events.
Parameters
- focused
- whether this widget should take focus or release it
setTabIndex
public void setTabIndex(int index)
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 this widget to
be removed from the tab order.
Parameters
- index
- the widget's tab index