Index

## Global Objects

- rap
- SWT

## Types

- $
- Button
- Canvas
- Client
- Combo
- Composite
- Control
- Event
- Label
- ProgressBar
- RemoteObject
- Scale
- ScrolledComposite
- Slider
- Spinner
- Text
- Widget

# Type Event

RWT Scripting analoge to org.eclipse.swt.widgets.Event

Field Summary
Field Attributes | Field Name and Description
--- | ---
| button the button that was pressed or released; 1 for the first button, 2 for the second button, and 3 for the third button, etc.
| character depending on the event, the character represented by the key that was typed.
| doit depending on the event, a flag indicating whether the operation should be allowed.
| gc the graphics context to use when painting.
| keyCode depending on the event, the key code of the key that was typed, as defined by the key code constants in class `SWT`.
| start depending on the event, the range of text being modified.
| stateMask depending on the event, the state of the keyboard modifier keys and mouse masks at the time the event was generated.
| text depending on the event, the new text that will be inserted.
| type the type of event, as defined by the event type constants in the SWT object.
| widget an object representing the widget that issued the event.
| x x coordinate of the pointer at the time of the event Set for MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.
| y y coordinate of the pointer at the time of the event Set for MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.

Type Detail
<private> Event(eventType, originalTarget, originalEvent)
Objects of this type are given to the handleEvent function (JavaScript) of org.eclipse.rap.rwt.scripting.ClientListener (Java) instances.

Parameters:
eventType
originalTarget
originalEvent

Since:
  2.2

See:
  SWT

Field Detail
button
the button that was pressed or released; 1 for the first button, 2 for the second button, and 3 for the third button, etc. Set for MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.

character
depending on the event, the character represented by the key that was typed. This is the final character that results after all modifiers have been applied. For non-printable keys (like arrow-keys) this field is not set. Changing its value has no effect. Set for KeyDown, KeyUp and Verify.

doit
depending on the event, a flag indicating whether the operation should be allowed. Setting this field to false will cancel the operation. Effective on KeyDown, KeyUp and Verify.

gc
the graphics context to use when painting.

It supports a subset of the HTML5 Canvas API.

Fields:

- strokeStyle
- fillStyle
- lineWidth
- lineJoin
- lineCap
- miterLimit
- globalAlpha

Methods:

- save
- restore
- beginPath
- closePath
- clearRect (Limitation: in IE 7/8 arguments are ignored, the entire canvas is cleared)
- stroke
- fill
- moveTo
- lineTo
- quadraticCurveTo
- bezierCurveTo
- rect
- arc
- drawImage
- createLinearGradient (Limitations: In IE 7/8, the gradient can be only be drawn either vertically or horizontally. Calls to "addColorStop" must be in the order of the offsets and can not overwrite previous colorsStops)

More methods are supported on modern browser, but for IE 7/8 these are all. Set on Paint.

keyCode
depending on the event, the key code of the key that was typed, as defined by the key code constants in class `SWT`. When the character field of the event is ambiguous, this field contains the unaffected value of the original character. For example, typing Shift+M or M result in different characters ( 'M' and 'm' ), but the same keyCode (109, character code for 'm').

start
depending on the event, the range of text being modified. Setting these fields has no effect. Set for Verify.

stateMask
depending on the event, the state of the keyboard modifier keys and mouse masks at the time the event was generated. Set for KeyDown, KeyUp, MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.

text
depending on the event, the new text that will be inserted. Setting this field will change the text that is about to be inserted or deleted. Set for Verify.

type
the type of event, as defined by the event type constants in the SWT object.

widget
an object representing the widget that issued the event.

See:
  rap.getObject

x
x coordinate of the pointer at the time of the event Set for MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.

y
y coordinate of the pointer at the time of the event Set for MouseDown, MouseUp, MouseMove, MouseEvnet, MouseExit and MouseDoubleClick.

Copyright (c) EclipseSource and others 2013, 2021. All rights reserved.