|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
public abstract class WInteractWidget
An abstract widget that can receive user-interface interaction.
This abstract widget provides access to event signals that correspond to user-interface interaction through mouse or keyboard.
When JavaScript is disabled, only the clicked() event will propagate (but without event details information).
Styling through CSS is not applicable.
| Constructor Summary | |
|---|---|
WInteractWidget()
Create an InteractWidget with optional parent. |
|
WInteractWidget(WContainerWidget parent)
Create an InteractWidget with optional parent. |
|
| Method Summary | |
|---|---|
EventSignal1<WMouseEvent> |
clicked()
Event signal emitted when a mouse key was clicked on this widget. |
EventSignal1<WMouseEvent> |
doubleClicked()
Event signal emitted when a mouse key was double clicked on this widget. |
EventSignal |
enterPressed()
Event signal emitted when enter was pressed. |
EventSignal |
escapePressed()
Event signal emitted when escape was pressed. |
EventSignal1<WGestureEvent> |
gestureChanged()
Event signal emitted when a gesture is changed. |
EventSignal1<WGestureEvent> |
gestureEnded()
Event signal emitted when a gesture is ended. |
EventSignal1<WGestureEvent> |
gestureStarted()
Event signal emitted when a gesture is started. |
boolean |
isEnabled()
Returns whether the widget is enabled. |
EventSignal1<WKeyEvent> |
keyPressed()
Event signal emitted when a "character" was entered. |
EventSignal1<WKeyEvent> |
keyWentDown()
Event signal emitted when a keyboard key is pushed down. |
EventSignal1<WKeyEvent> |
keyWentUp()
Event signal emitted when a keyboard key is released. |
void |
load()
Loads content just before the widget is used. |
EventSignal1<WMouseEvent> |
mouseDragged()
Event signal emitted when the mouse is dragged over this widget. |
EventSignal1<WMouseEvent> |
mouseMoved()
Event signal emitted when the mouse moved over this widget. |
EventSignal1<WMouseEvent> |
mouseWentDown()
Event signal emitted when a mouse key was pushed down on this widget. |
EventSignal1<WMouseEvent> |
mouseWentOut()
Event signal emitted when the mouse went out of this widget. |
EventSignal1<WMouseEvent> |
mouseWentOver()
Event signal emitted when the mouse entered this widget. |
EventSignal1<WMouseEvent> |
mouseWentUp()
Event signal emitted when a mouse key was released on this widget. |
EventSignal1<WMouseEvent> |
mouseWheel()
Event signal emitted when the mouse scroll wheel was used. |
protected void |
propagateSetEnabled(boolean enabled)
Propagates that a widget was enabled or disabled through children. |
void |
remove()
Destructor. |
void |
setDraggable(java.lang.String mimeType)
Configure dragging for drag and drop. |
void |
setDraggable(java.lang.String mimeType,
WWidget dragWidget)
Configure dragging for drag and drop. |
void |
setDraggable(java.lang.String mimeType,
WWidget dragWidget,
boolean isDragWidgetOnly)
Configure dragging for drag and drop. |
void |
setDraggable(java.lang.String mimeType,
WWidget dragWidget,
boolean isDragWidgetOnly,
WObject sourceObject)
Configure dragging for drag and drop. |
EventSignal1<WTouchEvent> |
touchEnded()
Event signal emitted when a finger is removed from the screen. |
EventSignal1<WTouchEvent> |
touchMoved()
Event signal emitted when a finger, which is already placed on the screen, is moved across the screen. |
EventSignal1<WTouchEvent> |
touchStarted()
Event signal emitted when a finger is placed on the screen. |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WInteractWidget(WContainerWidget parent)
public WInteractWidget()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void remove()
WWidgetDeletes a widget and all children (recursively). If the widget is contained in another widget, it is removed first.
remove in class WWebWidgetWContainerWidget.removeWidget(WWidget widget)public EventSignal1<WKeyEvent> keyWentDown()
The keyWentDown signal is the first signal emitted when a key is pressed
(before the keyPressed signal). Unlike
keyPressed() however it is also
emitted for modifier keys (such as "shift",
"control", ...) or keyboard navigation keys that do not have a
corresponding character.
Form widgets (like WLineEdit) will receive key events when
focussed. Other widgets will receive key events when they contain
(directly or indirectly) a form widget that has focus.
To capture a key down event when no element has focus, see
WApplication#globalKeyWentDown()
keyPressed(),
keyWentUp()public EventSignal1<WKeyEvent> keyPressed()
The keyPressed signal is emitted when a key is pressed, and a character
is entered. Unlike keyWentDown(),
it is emitted only for key presses that result in a character being
entered, and thus not for modifier keys or keyboard navigation keys.
Form widgets (like WLineEdit) will receive key events when
focussed. Other widgets will receive key events when they contain
(directly or indirectly) a form widget that has focus.
To capture a key press when no element has focus, see
WApplication#globalKeyPressed()
keyWentDown()public EventSignal1<WKeyEvent> keyWentUp()
This is the counter-part of the keyWentDown() event. Every key-down has its corresponding key-up.
Form widgets (like WLineEdit) will receive key events when
focussed. Other widgets will receive key events when they contain
(directly or indirectly) a form widget that has focus.
To capture a key up event when no element has focus, see
WApplication#globalKeyWentUp()
keyWentDown()public EventSignal enterPressed()
This signal is emitted when the Enter or Return key was pressed.
Form widgets (like WLineEdit) will receive key events when
focussed. Other widgets will receive key events when they contain
(directly or indirectly) a form widget that has focus.
To capture an enter press when no element has focus, see
WApplication#globalEnterPressed()
keyPressed(),
Key.Key_Enterpublic EventSignal escapePressed()
This signal is emitted when the Escape key was pressed.
Form widgets (like WLineEdit) will receive key events when
focussed. Other widgets will receive key events when they contain
(directly or indirectly) a form widget that has focus.
To capture an escape press when no element has focus, see
WApplication#globalEscapePressed()
keyPressed(),
Key.Key_Escapepublic EventSignal1<WMouseEvent> clicked()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the event details contain invalid information.
public EventSignal1<WMouseEvent> doubleClicked()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentDown()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentUp()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentOut()
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentOver()
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseMoved()
The mouse event contains information on the button(s) currently pressed. If multiple buttons are currently pressed, only the button with smallest enum value is returned.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseDragged()
The mouse event contains information on the button(s) currently pressed. If multiple buttons are currently pressed, only the button with smallest enum value is returned.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWheel()
The event details contains information such as the
wheel delta, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WTouchEvent> touchStarted()
The event details contains information such as the
touches,
target touches and
changed touches.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WTouchEvent> touchEnded()
The event details contains information such as the
touches,
target touches and
changed touches.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WTouchEvent> touchMoved()
The event details contains information such as the
touches,
target touches and
changed touches.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WGestureEvent> gestureStarted()
The event details contains information about the
scale and the
rotation.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WGestureEvent> gestureChanged()
The event details contains information about the
scale and the
rotation.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WGestureEvent> gestureEnded()
The event details contains information about the
scale and the
rotation.
Note: When JavaScript is disabled, the signal will never fire.
public void setDraggable(java.lang.String mimeType,
WWidget dragWidget,
boolean isDragWidgetOnly,
WObject sourceObject)
Enable drag&drop for this widget. The mimeType is used to find a suitable drop target, which must accept dropping of this mimetype.
By default, the entire widget is dragged. One may specify another widget
to be dragged (for example the parent as dragWidget) or a
dragWidget whose function is only to represent the drag
visually (when isDragWidgetOnly = true).
The widget to be identified as source in the dropEvent may be given explicitly, and will default to this widget otherwise.
Note: When JavaScript is disabled, drag&drop does not work.
WWidget.dropEvent(WDropEvent event),
WWidget.acceptDrops(String mimeType, String hoverStyleClass),
WDropEventpublic final void setDraggable(java.lang.String mimeType)
Calls
setDraggable(mimeType, (WWidget)null, false, (WObject)null)
public final void setDraggable(java.lang.String mimeType,
WWidget dragWidget)
Calls
setDraggable(mimeType, dragWidget, false, (WObject)null)
public final void setDraggable(java.lang.String mimeType,
WWidget dragWidget,
boolean isDragWidgetOnly)
Calls
setDraggable(mimeType, dragWidget, isDragWidgetOnly, (WObject)null)
public void load()
WWidgetWhen the widget is inserted in the widget hierarchy, this method is called. Widgets that get inserted in the widget hierarchy will be rendered. Visible widgets are rendered immediately, and invisible widgets in the back-ground (or not for a plain HTML session). This method is called when the widget is directly or indirectly inserted into the widget tree.
The default implementation simply propagates the load signal to its children. You may want to override this method to delay loading of resource-intensive contents.
During the life-time of a widget, this method may be called multiple times, so you should make sure that you do a deferred initializiation only once.
load in class WWebWidgetpublic boolean isEnabled()
WWidget
A widget is enabled if it is not disabled, and none of its ancestors are
disabled. This method returns whether the widget is rendered as enabled,
while isDisabled() returns whether a widget
has been explicitly disabled.
Note that a widget may be at the same time not enabled, and not disabled, in case one of its ancestors was disabled.
isEnabled in class WWebWidgetWWidget.isDisabled()protected void propagateSetEnabled(boolean enabled)
WWidget
When enabling or disabling a widget, you usually also want to disable
contained children. This method is called by
setDisabled() to propagate
its state to all children.
You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children.
propagateSetEnabled in class WWebWidget
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||