Note
For a given event, only the fields which are appropriate will be filled in. The contents of the fields which are not used by the event are unspecified.
Listener, org.eclipse.swt.events.TypedEvent , SWT Example: ControlExample, Listeners, Sample code and further information
| Modifier and Type | Field and Description |
|---|---|
| public int | 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. |
| public char | character
depending on the event, the character represented by the key that was typed. |
| public int | count
depending on the event type, the number of following paint events that are pending which may always be zero on some platforms, or the number of lines or pages to scroll using the mouse wheel, or the number of times the mouse has been clicked |
| public Object | data
a field for application use |
| public int | detail
the event specific detail field, as defined by the detail constants
in class |
| public Display | display
the display where the event occurred |
| public boolean | doit
depending on the event, a flag indicating whether the operation should be allowed. |
| public int | end
depending on the event, the range of text being modified. |
| public GC | gc
the graphics context to use when painting that is configured to use the colors, font and damaged region of the control. |
| public int | height
the height of the bounding rectangle of the region that requires painting |
| public int | index
the index of the item where the event occurred |
| public Widget | item
the item that the event occurred in (can be null) |
| public int | keyCode
character that is good for keyboard shortcut comparison. |
| public int | keyLocation
depending on the event, the location of key specified by the keyCode or character. |
| public double | magnification
The change in magnification. |
| public double | rotation
The number of degrees rotated on the track pad. |
| public int[] | segments
Bidi segment offsets |
| public char[] | segmentsChars
Characters to be applied on the segment boundaries |
| public int | start
depending on the event, the range of text being modified. |
| public int | stateMask
depending on the event, the state of the keyboard modifier keys and mouse masks at the time the event was generated. |
| public String | text
depending on the event, the new text that will be inserted. |
| public int | time
the time that the event occurred. |
| public Touch[] | touches
An array of the touch states for the current touch event. |
| public int | type
the type of event, as defined by the event type constants
in class |
| public Widget | widget
the widget that issued the event |
| public int | width
the width of the bounding rectangle of the region that requires painting |
| public int | x
depending on the event type, the x offset of the bounding rectangle of the region that requires painting or the widget-relative, x coordinate of the pointer at the time the mouse button was pressed or released |
| public int | xDirection
If nonzero, a positive value indicates a swipe to the right, and a negative value indicates a swipe to the left. |
| public int | y
depending on the event type, the y offset of the bounding rectangle of the region that requires painting or the widget-relative, y coordinate of the pointer at the time the mouse button was pressed or released |
| public int | yDirection
If nonzero, a positive value indicates a swipe in the up direction, and a negative value indicates a swipe in the down direction. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Rectangle | |
| pack-priv Rectangle | |
| pack-priv Point | |
| pack-priv Point | |
| public void | |
| pack-priv void | |
| pack-priv void | |
| public String | Returns: a string representation of the eventOverrides java. |
| button | back to summary |
|---|---|
| public int 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 | back to summary |
|---|---|
| public char 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 example, when the user types Ctrl+A, the character value is 0x01 (ASCII SOH). It is important that applications do not attempt to modify the character value based on a stateMask (such as SWT.CTRL) or the resulting character will not be correct. | |
| count | back to summary |
|---|---|
| public int count depending on the event type, the number of following paint events that are pending which may always be zero on some platforms, or the number of lines or pages to scroll using the mouse wheel, or the number of times the mouse has been clicked | |
| data | back to summary |
|---|---|
| public Object data a field for application use | |
| detail | back to summary |
|---|---|
| public int detail the event specific detail field, as defined by the detail constants
in class
| |
| display | back to summary |
|---|---|
| public Display display the display where the event occurred
| |
| doit | back to summary |
|---|---|
| public boolean doit depending on the event, a flag indicating whether the operation should be allowed. Setting this field to false will cancel the operation. | |
| end | back to summary |
|---|---|
| public int end depending on the event, the range of text being modified. Setting these fields only has effect during ImeComposition events. | |
| gc | back to summary |
|---|---|
| public GC gc the graphics context to use when painting that is configured to use the colors, font and damaged region of the control. It is valid only during the paint and must not be disposed | |
| height | back to summary |
|---|---|
| public int height the height of the bounding rectangle of the region that requires painting | |
| index | back to summary |
|---|---|
| public int index the index of the item where the event occurred
| |
| item | back to summary |
|---|---|
| public Widget item the item that the event occurred in (can be null) | |
| keyCode | back to summary | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public int keyCode character that is good for keyboard shortcut comparison. Unlike
How it is done differs per platform, and on many platforms, SWT resorts to various magic. To understand the problem, consider the following questions about the well known Ctrl+C shortcut:
Widget#setKeyState per
platform.
| |||||||||||||||||||||||||||||||||
| keyLocation | back to summary |
|---|---|
| public int keyLocation depending on the event, the location of key specified by the
keyCode or character. The possible values for this field are
The location field can be used to differentiate key events that have the same key code and character but are generated by different keys in the keyboard. For example, a key down event with the key code equals to SWT.SHIFT can be generated by the left and the right shift keys in the keyboard. The location field can only be used to determine the location of the key code or character in the current event. It does not include information about the location of modifiers in state mask.
| |
| magnification | back to summary |
|---|---|
| public double magnification The change in magnification. This value should be added to the current scaling of an item to get the new scale factor.
| |
| rotation | back to summary |
|---|---|
| public double rotation The number of degrees rotated on the track pad.
| |
| segments | back to summary |
|---|---|
| public int[] segments Bidi segment offsets
| |
| segmentsChars | back to summary |
|---|---|
| public char[] segmentsChars Characters to be applied on the segment boundaries
| |
| start | back to summary |
|---|---|
| public int start depending on the event, the range of text being modified. Setting these fields only has effect during ImeComposition events. | |
| stateMask | back to summary |
|---|---|
| public int stateMask depending on the event, the state of the keyboard modifier keys and mouse masks at the time the event was generated. | |
| text | back to summary |
|---|---|
| public String 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. | |
| time | back to summary |
|---|---|
| public int time the time that the event occurred. Note This field is an unsigned integer and should be AND'ed with 0xFFFFFFFFL so that it can be treated as a signed long. | |
| touches | back to summary |
|---|---|
| public Touch[] touches An array of the touch states for the current touch event.
| |
| type | back to summary |
|---|---|
| public int type the type of event, as defined by the event type constants
in class
| |
| widget | back to summary |
|---|---|
| public Widget widget the widget that issued the event | |
| width | back to summary |
|---|---|
| public int width the width of the bounding rectangle of the region that requires painting | |
| x | back to summary |
|---|---|
| public int x depending on the event type, the x offset of the bounding rectangle of the region that requires painting or the widget-relative, x coordinate of the pointer at the time the mouse button was pressed or released | |
| xDirection | back to summary |
|---|---|
| public int xDirection If nonzero, a positive value indicates a swipe to the right, and a negative value indicates a swipe to the left.
| |
| y | back to summary |
|---|---|
| public int y depending on the event type, the y offset of the bounding rectangle of the region that requires painting or the widget-relative, y coordinate of the pointer at the time the mouse button was pressed or released | |
| yDirection | back to summary |
|---|---|
| public int yDirection If nonzero, a positive value indicates a swipe in the up direction, and a negative value indicates a swipe in the down direction.
| |
| Event | back to summary |
|---|---|
| public Event() | |
| getBounds | back to summary |
|---|---|
| public Rectangle getBounds() Gets the bounds.
| |
| getBoundsInPixels | back to summary |
|---|---|
| pack-priv Rectangle getBoundsInPixels() | |
| getLocation | back to summary |
|---|---|
| pack-priv Point getLocation() | |
| getLocationInPixels | back to summary |
|---|---|
| pack-priv Point getLocationInPixels() | |
| setBounds | back to summary |
|---|---|
| public void setBounds(Rectangle rect) Sets the bounds.
| |
| setBoundsInPixels | back to summary |
|---|---|
| pack-priv void setBoundsInPixels(Rectangle rect) | |
| setLocationInPixels | back to summary |
|---|---|
| pack-priv void setLocationInPixels(int x, int y) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string containing a concise, human-readable description of the receiver. | |