|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Event
public class Event
Instances of this class provide a description of a particular event which occurred within SWT. The SWT untyped listener API uses these instances for all event dispatching.
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
,
TypedEvent
,
SWT Example: ControlExample, Listeners,
Sample code and further informationField Summary | |
---|---|
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. |
char |
character
depending on the event, the character represented by the key that was typed. |
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 |
Object |
data
a field for application use |
int |
detail
the event specific detail field, as defined by the detail constants in class SWT |
Display |
display
the display where the event occurred |
boolean |
doit
depending on the event, a flag indicating whether the operation should be allowed. |
int |
end
depending on the event, the range of text being modified. |
GC |
gc
the graphics context to use when painting that is configured to use the colors, font and damaged region of the control. |
int |
height
the height of the bounding rectangle of the region that requires painting |
int |
index
the index of the item where the event occurred |
Widget |
item
the item that the event occurred in (can be null) |
int |
keyCode
depending on the event, the key code of the key that was typed, as defined by the key code constants in class SWT . |
int |
keyLocation
depending on the event, the location of key specified by the keyCode or character. |
int |
start
depending on the event, the range of text being modified. |
int |
stateMask
depending on the event, the state of the keyboard modifier keys and mouse masks at the time the event was generated. |
String |
text
depending on the event, the new text that will be inserted. |
int |
time
the time that the event occurred. |
int |
type
the type of event, as defined by the event type constants in class SWT |
Widget |
widget
the widget that issued the event |
int |
width
the width of the bounding rectangle of the region that requires painting |
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 |
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 |
Constructor Summary | |
---|---|
Event()
|
Method Summary | |
---|---|
Rectangle |
getBounds()
Gets the bounds. |
void |
setBounds(Rectangle rect)
Sets the bounds. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Display display
public Widget widget
public int type
SWT
SWT
public int detail
SWT
SWT
public Widget item
public int index
public GC gc
public int x
public int y
public int width
public int height
public int count
public int time
public int button
public char character
public int keyCode
SWT
.
When the character field of the event is ambiguous, this field
contains the unaffected value of the original character. For
example, typing Ctrl+M or Enter both result in the character '\r'
but the keyCode field will also contain '\r' when Enter was typed
and 'm' when Ctrl+M was typed.
SWT
public int keyLocation
SWT.LEFT
, SWT.RIGHT
, SWT.KEYPAD
,
or SWT.NONE
representing the main keyboard area.
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.
SWT.LEFT
,
SWT.RIGHT
,
SWT.KEYPAD
public int stateMask
SWT.MODIFIER_MASK
,
SWT.BUTTON_MASK
public int start
public int end
public String text
public boolean doit
public Object data
Constructor Detail |
---|
public Event()
Method Detail |
---|
public Rectangle getBounds()
public void setBounds(Rectangle rect)
rect
- the new rectanglepublic String toString()
toString
in class Object
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.