Package com.google.gwt.user.client.ui
Class FocusPanel
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.FocusPanel
-
- All Implemented Interfaces:
HasAllDragAndDropHandlers,HasAllFocusHandlers,HasAllGestureHandlers,HasAllKeyHandlers,HasAllMouseHandlers,HasAllTouchHandlers,HasBlurHandlers,HasClickHandlers,HasDoubleClickHandlers,HasDragEndHandlers,HasDragEnterHandlers,HasDragHandlers,HasDragLeaveHandlers,HasDragOverHandlers,HasDragStartHandlers,HasDropHandlers,HasFocusHandlers,HasGestureChangeHandlers,HasGestureEndHandlers,HasGestureStartHandlers,HasKeyDownHandlers,HasKeyPressHandlers,HasKeyUpHandlers,HasMouseDownHandlers,HasMouseMoveHandlers,HasMouseOutHandlers,HasMouseOverHandlers,HasMouseUpHandlers,HasMouseWheelHandlers,HasTouchCancelHandlers,HasTouchEndHandlers,HasTouchMoveHandlers,HasTouchStartHandlers,HasAttachHandlers,HasHandlers,EventListener,AcceptsOneWidget,Focusable,HasFocus,HasOneWidget,HasVisibility,HasWidgets,HasWidgets.ForIsWidget,IsWidget,SourcesClickEvents,SourcesFocusEvents,SourcesKeyboardEvents,SourcesMouseEvents,SourcesMouseWheelEvents,java.lang.Iterable<Widget>
public class FocusPanel extends SimplePanel implements HasFocus, SourcesClickEvents, SourcesMouseEvents, SourcesMouseWheelEvents, HasAllDragAndDropHandlers, HasAllMouseHandlers, HasClickHandlers, HasDoubleClickHandlers, HasAllKeyHandlers, HasAllFocusHandlers, HasAllGestureHandlers, HasAllTouchHandlers
A simple panel that makes its contents focusable, and adds the ability to catch mouse and keyboard events.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static com.google.gwt.user.client.ui.impl.FocusImplimpl-
Fields inherited from class com.google.gwt.user.client.ui.SimplePanel
widget
-
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
-
-
Constructor Summary
Constructors Constructor Description FocusPanel()FocusPanel(Widget child)
-
Method Summary
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
-
-
-
Constructor Detail
-
FocusPanel
public FocusPanel()
-
FocusPanel
public FocusPanel(Widget child)
-
-
Method Detail
-
addBlurHandler
public HandlerRegistration addBlurHandler(BlurHandler handler)
Description copied from interface:HasBlurHandlersAdds aBlurEventhandler.- Specified by:
addBlurHandlerin interfaceHasBlurHandlers- Parameters:
handler- the blur handler- Returns:
HandlerRegistrationused to remove this handler
-
addClickHandler
public HandlerRegistration addClickHandler(ClickHandler handler)
Description copied from interface:HasClickHandlersAdds aClickEventhandler.- Specified by:
addClickHandlerin interfaceHasClickHandlers- Parameters:
handler- the click handler- Returns:
HandlerRegistrationused to remove this handler
-
addClickListener
@Deprecated public void addClickListener(ClickListener listener)
Deprecated.Description copied from interface:SourcesClickEventsAdds a listener interface to receive click events.- Specified by:
addClickListenerin interfaceSourcesClickEvents- Parameters:
listener- the listener interface to add
-
addDoubleClickHandler
public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Description copied from interface:HasDoubleClickHandlersAdds aDoubleClickEventhandler.- Specified by:
addDoubleClickHandlerin interfaceHasDoubleClickHandlers- Parameters:
handler- the double click handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragEndHandler
public HandlerRegistration addDragEndHandler(DragEndHandler handler)
Description copied from interface:HasDragEndHandlersAdds aDragEndEventhandler.- Specified by:
addDragEndHandlerin interfaceHasDragEndHandlers- Parameters:
handler- the drag end handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragEnterHandler
public HandlerRegistration addDragEnterHandler(DragEnterHandler handler)
Description copied from interface:HasDragEnterHandlersAdds aDragEnterEventhandler.- Specified by:
addDragEnterHandlerin interfaceHasDragEnterHandlers- Parameters:
handler- the drag end handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragHandler
public HandlerRegistration addDragHandler(DragHandler handler)
Description copied from interface:HasDragHandlersAdds aDragEventhandler.- Specified by:
addDragHandlerin interfaceHasDragHandlers- Parameters:
handler- the drag handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragLeaveHandler
public HandlerRegistration addDragLeaveHandler(DragLeaveHandler handler)
Description copied from interface:HasDragLeaveHandlersAdds aDragLeaveEventhandler.- Specified by:
addDragLeaveHandlerin interfaceHasDragLeaveHandlers- Parameters:
handler- the drag leave handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragOverHandler
public HandlerRegistration addDragOverHandler(DragOverHandler handler)
Description copied from interface:HasDragOverHandlersAdds aDragOverEventhandler.- Specified by:
addDragOverHandlerin interfaceHasDragOverHandlers- Parameters:
handler- the drag over handler- Returns:
HandlerRegistrationused to remove this handler
-
addDragStartHandler
public HandlerRegistration addDragStartHandler(DragStartHandler handler)
Description copied from interface:HasDragStartHandlersAdds aDragStartEventhandler.- Specified by:
addDragStartHandlerin interfaceHasDragStartHandlers- Parameters:
handler- the drag start handler- Returns:
HandlerRegistrationused to remove this handler
-
addDropHandler
public HandlerRegistration addDropHandler(DropHandler handler)
Description copied from interface:HasDropHandlersAdds aDropEventhandler.- Specified by:
addDropHandlerin interfaceHasDropHandlers- Parameters:
handler- the drop handler- Returns:
HandlerRegistrationused to remove this handler
-
addFocusHandler
public HandlerRegistration addFocusHandler(FocusHandler handler)
Description copied from interface:HasFocusHandlersAdds aFocusEventhandler.- Specified by:
addFocusHandlerin interfaceHasFocusHandlers- Parameters:
handler- the focus handler- Returns:
HandlerRegistrationused to remove this handler
-
addFocusListener
@Deprecated public void addFocusListener(FocusListener listener)
Deprecated.Description copied from interface:SourcesFocusEventsAdds a listener interface to receive focus events.- Specified by:
addFocusListenerin interfaceSourcesFocusEvents- Parameters:
listener- the listener interface to add
-
addGestureChangeHandler
public HandlerRegistration addGestureChangeHandler(GestureChangeHandler handler)
Description copied from interface:HasGestureChangeHandlersAdds aGestureChangeEventhandler.- Specified by:
addGestureChangeHandlerin interfaceHasGestureChangeHandlers- Parameters:
handler- the gesture change handler- Returns:
HandlerRegistrationused to remove this handler
-
addGestureEndHandler
public HandlerRegistration addGestureEndHandler(GestureEndHandler handler)
Description copied from interface:HasGestureEndHandlersAdds aGestureEndEventhandler.- Specified by:
addGestureEndHandlerin interfaceHasGestureEndHandlers- Parameters:
handler- the gesture end handler- Returns:
HandlerRegistrationused to remove this handler
-
addGestureStartHandler
public HandlerRegistration addGestureStartHandler(GestureStartHandler handler)
Description copied from interface:HasGestureStartHandlersAdds aGestureStartEventhandler.- Specified by:
addGestureStartHandlerin interfaceHasGestureStartHandlers- Parameters:
handler- the gesture start handler- Returns:
HandlerRegistrationused to remove this handler
-
addKeyboardListener
@Deprecated public void addKeyboardListener(KeyboardListener listener)
Deprecated.Description copied from interface:SourcesKeyboardEventsAdds a listener interface to receive keyboard events.- Specified by:
addKeyboardListenerin interfaceSourcesKeyboardEvents- Parameters:
listener- the listener interface to add
-
addKeyDownHandler
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
Description copied from interface:HasKeyDownHandlersAdds aKeyDownEventhandler.- Specified by:
addKeyDownHandlerin interfaceHasKeyDownHandlers- Parameters:
handler- the key down handler- Returns:
HandlerRegistrationused to remove this handler
-
addKeyPressHandler
public HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
Description copied from interface:HasKeyPressHandlersAdds aKeyPressEventhandler.- Specified by:
addKeyPressHandlerin interfaceHasKeyPressHandlers- Parameters:
handler- the key press handler- Returns:
HandlerRegistrationused to remove this handler
-
addKeyUpHandler
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
Description copied from interface:HasKeyUpHandlersAdds aKeyUpEventhandler.- Specified by:
addKeyUpHandlerin interfaceHasKeyUpHandlers- Parameters:
handler- the key up handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseDownHandler
public HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
Description copied from interface:HasMouseDownHandlersAdds aMouseDownEventhandler.- Specified by:
addMouseDownHandlerin interfaceHasMouseDownHandlers- Parameters:
handler- the mouse down handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseListener
@Deprecated public void addMouseListener(MouseListener listener)
Deprecated.UseaddMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler),addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler),addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler),addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler)andaddMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)insteadDescription copied from interface:SourcesMouseEventsAdds a listener interface to receive mouse events.- Specified by:
addMouseListenerin interfaceSourcesMouseEvents- Parameters:
listener- the listener interface to add
-
addMouseMoveHandler
public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
Description copied from interface:HasMouseMoveHandlersAdds aMouseMoveEventhandler.- Specified by:
addMouseMoveHandlerin interfaceHasMouseMoveHandlers- Parameters:
handler- the mouse move handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseOutHandler
public HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
Description copied from interface:HasMouseOutHandlersAdds aMouseOutEventhandler.- Specified by:
addMouseOutHandlerin interfaceHasMouseOutHandlers- Parameters:
handler- the mouse out handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseOverHandler
public HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
Description copied from interface:HasMouseOverHandlersAdds aMouseOverEventhandler.- Specified by:
addMouseOverHandlerin interfaceHasMouseOverHandlers- Parameters:
handler- the mouse over handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseUpHandler
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
Description copied from interface:HasMouseUpHandlersAdds aMouseUpEventhandler.- Specified by:
addMouseUpHandlerin interfaceHasMouseUpHandlers- Parameters:
handler- the mouse up handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseWheelHandler
public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
Description copied from interface:HasMouseWheelHandlersAdds aMouseWheelEventhandler.- Specified by:
addMouseWheelHandlerin interfaceHasMouseWheelHandlers- Parameters:
handler- the mouse wheel handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseWheelListener
@Deprecated public void addMouseWheelListener(MouseWheelListener listener)
Deprecated.Description copied from interface:SourcesMouseWheelEventsAdds a listener interface to receive mouse events.- Specified by:
addMouseWheelListenerin interfaceSourcesMouseWheelEvents- Parameters:
listener- the listener interface to add
-
addTouchCancelHandler
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler)
Description copied from interface:HasTouchCancelHandlersAdds aTouchCancelEventhandler.- Specified by:
addTouchCancelHandlerin interfaceHasTouchCancelHandlers- Parameters:
handler- the touch cancel handler- Returns:
HandlerRegistrationused to remove this handler
-
addTouchEndHandler
public HandlerRegistration addTouchEndHandler(TouchEndHandler handler)
Description copied from interface:HasTouchEndHandlersAdds aTouchEndEventhandler.- Specified by:
addTouchEndHandlerin interfaceHasTouchEndHandlers- Parameters:
handler- the touch end handler- Returns:
HandlerRegistrationused to remove this handler
-
addTouchMoveHandler
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler)
Description copied from interface:HasTouchMoveHandlersAdds aTouchMoveEventhandler.- Specified by:
addTouchMoveHandlerin interfaceHasTouchMoveHandlers- Parameters:
handler- the touch move handler- Returns:
HandlerRegistrationused to remove this handler
-
addTouchStartHandler
public HandlerRegistration addTouchStartHandler(TouchStartHandler handler)
Description copied from interface:HasTouchStartHandlersAdds aTouchStartEventhandler.- Specified by:
addTouchStartHandlerin interfaceHasTouchStartHandlers- Parameters:
handler- the touch start handler- Returns:
HandlerRegistrationused to remove this handler
-
getTabIndex
public int getTabIndex()
Description copied from interface:FocusableGets the widget's position in the tab index.- Specified by:
getTabIndexin interfaceFocusable- Returns:
- the widget's tab index
-
removeClickListener
@Deprecated public void removeClickListener(ClickListener listener)
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned byaddClickHandler(com.google.gwt.event.dom.client.ClickHandler)insteadDescription copied from interface:SourcesClickEventsRemoves a previously added listener interface.- Specified by:
removeClickListenerin interfaceSourcesClickEvents- Parameters:
listener- the listener interface to remove
-
removeFocusListener
@Deprecated public void removeFocusListener(FocusListener listener)
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned byaddFocusHandler(com.google.gwt.event.dom.client.FocusHandler)insteadDescription copied from interface:SourcesFocusEventsRemoves a previously added listener interface.- Specified by:
removeFocusListenerin interfaceSourcesFocusEvents- Parameters:
listener- the listener interface to remove
-
removeKeyboardListener
@Deprecated public void removeKeyboardListener(KeyboardListener listener)
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadDescription copied from interface:SourcesKeyboardEventsRemoves a previously added listener interface.- Specified by:
removeKeyboardListenerin interfaceSourcesKeyboardEvents- Parameters:
listener- the listener interface to remove
-
removeMouseListener
@Deprecated public void removeMouseListener(MouseListener listener)
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadDescription copied from interface:SourcesMouseEventsRemoves a previously added listener interface.- Specified by:
removeMouseListenerin interfaceSourcesMouseEvents- Parameters:
listener- the listener interface to remove
-
removeMouseWheelListener
@Deprecated public void removeMouseWheelListener(MouseWheelListener listener)
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned byaddMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler)insteadDescription copied from interface:SourcesMouseWheelEventsRemoves a previously added listener interface.- Specified by:
removeMouseWheelListenerin interfaceSourcesMouseWheelEvents- Parameters:
listener- the listener interface to remove
-
setAccessKey
public void setAccessKey(char key)
Description copied from interface:FocusableSets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.- Specified by:
setAccessKeyin interfaceFocusable- Parameters:
key- the widget's access key
-
setFocus
public void setFocus(boolean focused)
Description copied from interface:FocusableExplicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events. NOTE: Most browsers fire FocusEvents asynchronously. Especially within GWT tests, you'll need to make your test asynchronous to properly do verifications. SeeGWTTestCase#delayTestFinishfor more information on how to do this.
-
setTabIndex
public void setTabIndex(int index)
Description copied from interface:FocusableSets 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-1will cause this widget to be removed from the tab order.- Specified by:
setTabIndexin interfaceFocusable- Parameters:
index- the widget's tab index
-
-