org.eclipse.swt.widgets
Class Display

java.lang.Object
  |
  +--org.eclipse.swt.graphics.Device
        |
        +--org.eclipse.swt.widgets.Display
All Implemented Interfaces:
Drawable

public class Display
extends Device

Unsafe:


Field Summary
(package private)  boolean accelKeyHit
           
(package private)  Menu[] bars
           
(package private)  Object data
           
(package private) static Display Default
           
(package private) static Display[] Displays
           
(package private)  Runnable[] disposeList
           
(package private)  Event[] eventQueue
           
(package private)  EventTable eventTable
           
(package private)  EventTable filterTable
           
(package private)  int hHook
           
(package private)  org.eclipse.swt.internal.win32.MSG hookMsg
           
(package private)  int hwndMessage
           
(package private)  ImageList[] imageList
           
(package private)  byte[] keyboard
           
(package private)  String[] keys
           
(package private) static int[][] KeyTable
           
(package private)  int lastAscii
           
(package private)  int lastKey
           
(package private)  int lastMouse
           
(package private)  boolean lastNull
           
(package private)  boolean lastVirtual
           
(package private)  boolean lockActiveWindow
           
(package private)  int lpCustColors
           
(package private)  org.eclipse.swt.internal.Callback messageCallback
           
(package private)  int messageProc
           
(package private)  boolean mnemonicKeyHit
           
(package private)  Shell[] modalWidgets
           
 org.eclipse.swt.internal.win32.MSG msg
          Suppressed: the handle to the OS message queue (Warning: This field is platform dependent)
(package private)  org.eclipse.swt.internal.Callback msgFilterCallback
           
(package private)  int msgFilterProc
           
(package private) static String PACKAGE_PREFIX
           
(package private)  Menu[] popups
           
(package private)  int processId
           
(package private)  Synchronizer synchronizer
           
(package private)  int[] systemFonts
           
(package private)  Thread thread
           
(package private)  int threadId
           
(package private)  int timerCount
           
(package private)  int[] timerIds
           
(package private)  Runnable[] timerList
           
(package private)  ImageList[] toolDisabledImageList
           
(package private)  ImageList[] toolHotImageList
           
(package private)  ImageList[] toolImageList
           
(package private) static boolean TrimEnabled
           
(package private)  Object[] values
           
(package private)  org.eclipse.swt.internal.Callback windowCallback
           
(package private)  org.eclipse.swt.internal.win32.TCHAR windowClass
           
(package private) static int WindowClassCount
           
(package private) static String WindowName
           
(package private)  int windowProc
           
 
Fields inherited from class org.eclipse.swt.graphics.Device
CurrentDevice, DEBUG, DeviceFinder, hPalette
 
Constructor Summary
Display()
          Enabled: Constructs a new instance of this class.
Display(DeviceData data)
          Suppressed:
 
Method Summary
(package private)  void addBar(Menu menu)
           
(package private)  void addFilter(int eventType, Listener listener)
          Adds the listener to the collection of listeners who will be notifed when an event of the given type occurs anywhere in SWT.
 void addListener(int eventType, Listener listener)
          Suppressed: Adds the listener to the collection of listeners who will be notifed when an event of the given type occurs.
(package private)  void addPopup(Menu menu)
           
(package private)  int asciiKey(int key)
           
 void asyncExec(Runnable runnable)
          Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
 void beep()
          Enabled: Causes the system hardware to emit a short sound (if it supports this capability).
protected  void checkDevice()
          Throws an SWTException if the receiver can not be accessed by the caller.
(package private) static void checkDisplay(Thread thread)
           
protected  void checkSubclass()
          Checks that this class can be subclassed.
(package private)  void clearModal(Shell shell)
           
 void close()
          Enabled: Requests that the connection between SWT and the underlying operating system be closed.
(package private)  int controlKey(int key)
           
protected  void create(DeviceData data)
          Creates the device in the operating system.
(package private)  void createDisplay(DeviceData data)
           
(package private) static void deregister(Display display)
           
protected  void destroy()
          Destroys the device in the operating system and releases the device's handle.
(package private)  void destroyDisplay()
           
 void disposeExec(Runnable runnable)
          Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread just before the receiver is disposed.
(package private)  void drawMenuBars()
           
(package private)  void error(int code)
          Does whatever display specific cleanup is required, and then uses the code in SWTError.error to handle the error.
(package private)  boolean filterEvent(Event event)
           
(package private)  boolean filterMessage(org.eclipse.swt.internal.win32.MSG msg)
           
(package private)  boolean filters(int eventType)
           
(package private)  Control findControl(int handle)
           
static Display findDisplay(Thread thread)
          Suppressed: Returns the display which the given thread is the user-interface thread for, or null if the given thread is not a user-interface thread for any display.
 Widget findWidget(int handle)
          Suppressed: Given the operating system handle for a widget, returns the instance of the Widget subclass which represents it in the currently running application, if such exists, or null if no matching widget can be found.
 Shell getActiveShell()
          Enabled: Returns the currently active Shell, or null if no shell belonging to the currently running application is active.
 Rectangle getBounds()
          Suppressed: Returns a rectangle describing the receiver's size and location.
 Rectangle getClientArea()
          Suppressed: Returns a rectangle which describes the area of the receiver which is capable of displaying data.
static Display getCurrent()
          Enabled: Returns the display which the currently running thread is the user-interface thread for, or null if the currently running thread is not a user-interface thread for any display.
 Control getCursorControl()
          Enabled: Returns the control which the on-screen pointer is currently over top of, or null if it is not currently over one of the controls built by the currently running application.
 Point getCursorLocation()
          Enabled: Returns the location of the on-screen pointer relative to the top left corner of the screen.
 Object getData()
          Suppressed: Returns the application defined, display specific data associated with the receiver, or null if it has not been set.
 Object getData(String key)
          Suppressed: Returns the application defined property of the receiver with the specified name, or null if it has not been set.
static Display getDefault()
          Enabled: Returns the default display.
 int getDismissalAlignment()
          Suppressed: Returns the button dismissal alignment, one of LEFT or RIGHT.
 int getDoubleClickTime()
          Suppressed: Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.
 Control getFocusControl()
          Enabled: Returns the control which currently has keyboard focus, or null if keyboard events are not currently going to any of the controls built by the currently running application.
 int getIconDepth()
          Suppressed: Returns the maximum allowed depth of icons on this display.
(package private)  ImageList getImageList(Point size)
           
(package private)  int getLastEventTime()
           
(package private)  Shell getModalShell()
           
 Shell[] getShells()
          Enabled: Returns an array containing all shells which have not been disposed and have the receiver as their display.
 Thread getSyncThread()
          Suppressed: Returns the thread that has invoked syncExec or null if no such runnable is currently being invoked by the user-interface thread.
 Color getSystemColor(int id)
          Enabled: Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT.
 Font getSystemFont()
          Enabled: Returns a reasonable font for applications to use.
 Thread getThread()
          Suppressed: Returns the user-interface thread for the receiver.
(package private)  ImageList getToolDisabledImageList(Point size)
           
(package private)  ImageList getToolHotImageList(Point size)
           
(package private)  ImageList getToolImageList(Point size)
           
protected  void init()
          Initializes any internal resources needed by the device.
 void internal_dispose_GC(int hDC, GCData data)
          Suppressed: Invokes platform specific functionality to dispose a GC handle.
 int internal_new_GC(GCData data)
          Suppressed: Invokes platform specific functionality to allocate a new GC handle.
(package private) static boolean isValidClass(Class clazz)
           
(package private)  boolean isValidThread()
           
(package private)  boolean isVirtualKey(int key)
           
(package private)  boolean isWakeMessage(org.eclipse.swt.internal.win32.MSG msg)
           
(package private)  int messageProc(int hwnd, int msg, int wParam, int lParam)
           
(package private)  int msgFilterProc(int code, int wParam, int lParam)
           
(package private)  int numpadKey(int key)
           
(package private)  void postEvent(Event event)
           
 boolean readAndDispatch()
          Enabled: Reads an event from the operating system's event queue, dispatches it appropriately, and returns true if there is potentially more work to do, or false if the caller can sleep until another event is placed on the event queue.
(package private) static void register(Display display)
           
protected  void release()
          Releases any internal resources back to the operating system and clears all fields except the device handle.
(package private)  void releaseDisplay()
           
(package private)  void releaseImageList(ImageList list)
           
(package private)  void releaseToolDisabledImageList(ImageList list)
           
(package private)  void releaseToolHotImageList(ImageList list)
           
(package private)  void releaseToolImageList(ImageList list)
           
(package private)  void removeBar(Menu menu)
           
(package private)  void removeFilter(int eventType, Listener listener)
          Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs anywhere in SWT.
 void removeListener(int eventType, Listener listener)
          Suppressed: Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs.
(package private)  void removePopup(Menu menu)
           
(package private)  boolean runAsyncMessages()
           
(package private)  boolean runDeferredEvents()
           
(package private)  boolean runPopups()
           
(package private)  boolean runTimer(int id)
           
(package private)  void sendEvent(int eventType, Event event)
           
static void setAppName(String name)
          Suppressed: On platforms which support it, sets the application name to be the argument.
 void setCursorLocation(int x, int y)
          Suppressed: Sets the location of the on-screen pointer relative to the top left corner of the screen.
 void setCursorLocation(Point point)
          Suppressed: Sets the location of the on-screen pointer relative to the top left corner of the screen.
 void setData(Object data)
          Suppressed: Sets the application defined, display specific data associated with the receiver, to the argument.
 void setData(String key, Object value)
          Suppressed: Sets the application defined property of the receiver with the specified name to the given argument.
(package private) static void setDevice(Device device)
           
(package private)  void setModalShell(Shell shell)
           
 void setSynchronizer(Synchronizer synchronizer)
          Suppressed: Sets the synchronizer used by the display to be the argument, which can not be null.
(package private)  int shiftedKey(int key)
           
 boolean sleep()
          Enabled: Causes the user-interface thread to sleep (that is, to be put in a state where it does not consume CPU cycles) until an event is received or it is otherwise awakened.
 void syncExec(Runnable runnable)
          Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
(package private)  int systemFont()
           
 void timerExec(int milliseconds, Runnable runnable)
          Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed.
(package private)  boolean translateAccelerator(org.eclipse.swt.internal.win32.MSG msg, Control control)
           
(package private) static int translateKey(int key)
           
(package private)  boolean translateMnemonic(org.eclipse.swt.internal.win32.MSG msg, Control control)
           
(package private)  boolean translateTraversal(org.eclipse.swt.internal.win32.MSG msg, Control control)
           
(package private) static int untranslateKey(int key)
           
 void update()
          Suppressed: Forces all outstanding paint requests for the display to be processed before this method returns.
(package private)  void updateFont()
           
 void wake()
          Suppressed: If the receiver's user-interface thread was sleep'ing, causes it to be awakened and start running again.
(package private)  int windowProc(int hwnd, int msg, int wParam, int lParam)
           
(package private) static String withCrLf(String string)
           
 
Methods inherited from class org.eclipse.swt.graphics.Device
dispose, getDepth, getDeviceData, getDPI, getFontList, getWarnings, isDisposed, setWarnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msg

public org.eclipse.swt.internal.win32.MSG msg
Suppressed: the handle to the OS message queue (Warning: This field is platform dependent)


eventQueue

Event[] eventQueue

windowCallback

org.eclipse.swt.internal.Callback windowCallback

windowProc

int windowProc

threadId

int threadId

processId

int processId

windowClass

org.eclipse.swt.internal.win32.TCHAR windowClass

WindowClassCount

static int WindowClassCount

WindowName

static final String WindowName

eventTable

EventTable eventTable

filterTable

EventTable filterTable

msgFilterCallback

org.eclipse.swt.internal.Callback msgFilterCallback

msgFilterProc

int msgFilterProc

hHook

int hHook

hookMsg

org.eclipse.swt.internal.win32.MSG hookMsg

synchronizer

Synchronizer synchronizer

thread

Thread thread

disposeList

Runnable[] disposeList

timerCount

int timerCount

timerIds

int[] timerIds

timerList

Runnable[] timerList

lockActiveWindow

boolean lockActiveWindow

lastVirtual

boolean lastVirtual

lastNull

boolean lastNull

lastKey

int lastKey

lastAscii

int lastAscii

lastMouse

int lastMouse

keyboard

byte[] keyboard

accelKeyHit

boolean accelKeyHit

mnemonicKeyHit

boolean mnemonicKeyHit

hwndMessage

int hwndMessage

messageProc

int messageProc

messageCallback

org.eclipse.swt.internal.Callback messageCallback

systemFonts

int[] systemFonts

imageList

ImageList[] imageList

toolImageList

ImageList[] toolImageList

toolHotImageList

ImageList[] toolHotImageList

toolDisabledImageList

ImageList[] toolDisabledImageList

lpCustColors

int lpCustColors

data

Object data

keys

String[] keys

values

Object[] values

bars

Menu[] bars

popups

Menu[] popups

KeyTable

static final int[][] KeyTable

Default

static Display Default

Displays

static Display[] Displays

modalWidgets

Shell[] modalWidgets

TrimEnabled

static boolean TrimEnabled

PACKAGE_PREFIX

static final String PACKAGE_PREFIX
Constructor Detail

Display

public Display()
Enabled: Constructs a new instance of this class.

Note: The resulting display is marked as the current display. If this is the first display which has been constructed since the application started, it is also marked as the default display.

See Also:
getCurrent(), getDefault(), Widget.checkSubclass(), Shell

Display

public Display(DeviceData data)
Suppressed:

Method Detail

setDevice

static void setDevice(Device device)

asciiKey

int asciiKey(int key)

addFilter

void addFilter(int eventType,
               Listener listener)
Adds the listener to the collection of listeners who will be notifed when an event of the given type occurs anywhere in SWT. When the event does occur, the listener is notified by sending it the handleEvent() message.

Parameters:
eventType - the type of event to listen for
listener - the listener which should be notified when the event occurs
Since:
2.1
See Also:
Listener, removeFilter(int, org.eclipse.swt.widgets.Listener), removeListener(int, org.eclipse.swt.widgets.Listener)

addListener

public void addListener(int eventType,
                        Listener listener)
Suppressed: Adds the listener to the collection of listeners who will be notifed when an event of the given type occurs. When the event does occur in the display, the listener is notified by sending it the handleEvent() message.

Parameters:
eventType - the type of event to listen for
listener - the listener which should be notified when the event occurs
Since:
2.0
See Also:
Listener, removeListener(int, org.eclipse.swt.widgets.Listener)

addBar

void addBar(Menu menu)

addPopup

void addPopup(Menu menu)

asyncExec

public void asyncExec(Runnable runnable)
Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The caller of this method continues to run in parallel, and is not notified when the runnable has completed.

Parameters:
runnable - code to run on the user-interface thread.
See Also:
syncExec(java.lang.Runnable)

beep

public void beep()
Enabled: Causes the system hardware to emit a short sound (if it supports this capability).


checkSubclass

protected void checkSubclass()
Checks that this class can be subclassed.

IMPORTANT: See the comment in Widget.checkSubclass().

See Also:
Widget.checkSubclass()

checkDevice

protected void checkDevice()
Description copied from class: Device
Throws an SWTException if the receiver can not be accessed by the caller. This may include both checks on the state of the receiver and more generally on the entire execution context. This method should be called by device implementors to enforce the standard SWT invariants.

Currently, it is an error to invoke any method (other than isDisposed() and dispose()) on a device that has had its dispose() method called.

In future releases of SWT, there may be more or fewer error checks and exceptions may be thrown for different reasons.

Overrides:
checkDevice in class Device

checkDisplay

static void checkDisplay(Thread thread)

clearModal

void clearModal(Shell shell)

controlKey

int controlKey(int key)

close

public void close()
Enabled: Requests that the connection between SWT and the underlying operating system be closed.

Since:
2.0
See Also:
Device.dispose()

create

protected void create(DeviceData data)
Creates the device in the operating system. If the device does not have a handle, this method may do nothing depending on the device.

This method is called before init.

Overrides:
create in class Device
Parameters:
data - the DeviceData which describes the receiver
See Also:
init()

createDisplay

void createDisplay(DeviceData data)

deregister

static void deregister(Display display)

destroy

protected void destroy()
Destroys the device in the operating system and releases the device's handle. If the device does not have a handle, this method may do nothing depending on the device.

This method is called after release.

Overrides:
destroy in class Device
See Also:
Device.dispose(), release()

destroyDisplay

void destroyDisplay()

disposeExec

public void disposeExec(Runnable runnable)
Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread just before the receiver is disposed.

Parameters:
runnable - code to run at dispose time.

drawMenuBars

void drawMenuBars()

error

void error(int code)
Does whatever display specific cleanup is required, and then uses the code in SWTError.error to handle the error.

Parameters:
code - the descriptive error code
See Also:
SWTError#error

filterEvent

boolean filterEvent(Event event)

filters

boolean filters(int eventType)

filterMessage

boolean filterMessage(org.eclipse.swt.internal.win32.MSG msg)

findWidget

public Widget findWidget(int handle)
Suppressed: Given the operating system handle for a widget, returns the instance of the Widget subclass which represents it in the currently running application, if such exists, or null if no matching widget can be found.

Parameters:
handle - the handle for the widget
Returns:
the SWT widget that the handle represents

findControl

Control findControl(int handle)

findDisplay

public static Display findDisplay(Thread thread)
Suppressed: Returns the display which the given thread is the user-interface thread for, or null if the given thread is not a user-interface thread for any display.

Parameters:
thread - the user-interface thread
Returns:
the display for the given thread

getActiveShell

public Shell getActiveShell()
Enabled: Returns the currently active Shell, or null if no shell belonging to the currently running application is active.

Returns:
the active shell or null

getBounds

public Rectangle getBounds()
Suppressed: Returns a rectangle describing the receiver's size and location.

Overrides:
getBounds in class Device
Returns:
the bounding rectangle

getCurrent

public static Display getCurrent()
Enabled: Returns the display which the currently running thread is the user-interface thread for, or null if the currently running thread is not a user-interface thread for any display.

Returns:
the current display

getClientArea

public Rectangle getClientArea()
Suppressed: Returns a rectangle which describes the area of the receiver which is capable of displaying data.

Overrides:
getClientArea in class Device
Returns:
the client area
See Also:
getBounds()

getCursorControl

public Control getCursorControl()
Enabled: Returns the control which the on-screen pointer is currently over top of, or null if it is not currently over one of the controls built by the currently running application.

Returns:
the control under the cursor

getCursorLocation

public Point getCursorLocation()
Enabled: Returns the location of the on-screen pointer relative to the top left corner of the screen.

Returns:
the cursor location

getDefault

public static Display getDefault()
Enabled: Returns the default display. One is created (making the thread that invokes this method its user-interface thread) if it did not already exist.

Returns:
the default display

isValidClass

static boolean isValidClass(Class clazz)

getData

public Object getData(String key)
Suppressed: Returns the application defined property of the receiver with the specified name, or null if it has not been set.

Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the display is disposed of, it is the application's responsibility provide a disposeExec() handler which does so.

Parameters:
key - the name of the property
Returns:
the value of the property or null if it has not been set
See Also:
setData(java.lang.String, java.lang.Object), disposeExec(java.lang.Runnable)

getData

public Object getData()
Suppressed: Returns the application defined, display specific data associated with the receiver, or null if it has not been set. The display specific data is a single, unnamed field that is stored with every display.

Applications may put arbitrary objects in this field. If the object stored in the display specific data needs to be notified when the display is disposed of, it is the application's responsibility provide a disposeExec() handler which does so.

Returns:
the display specific data
See Also:
setData(java.lang.String, java.lang.Object), disposeExec(java.lang.Runnable)

getDismissalAlignment

public int getDismissalAlignment()
Suppressed: Returns the button dismissal alignment, one of LEFT or RIGHT. The button dismissal alignment is the ordering that should be used when positioning the default dismissal button for a dialog. For example, in a dialog that contains an OK and CANCEL button, on platforms where the button dismissal alignment is LEFT, the button ordering should be OK/CANCEL. When button dismissal alignment is RIGHT, the button ordering should be CANCEL/OK.

Returns:
the button dismissal order
Since:
2.1

getDoubleClickTime

public int getDoubleClickTime()
Suppressed: Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.

Returns:
the double click time

getFocusControl

public Control getFocusControl()
Enabled: Returns the control which currently has keyboard focus, or null if keyboard events are not currently going to any of the controls built by the currently running application.

Returns:
the control under the cursor

getIconDepth

public int getIconDepth()
Suppressed: Returns the maximum allowed depth of icons on this display. On some platforms, this may be different than the actual depth of the display.

Returns:
the maximum icon depth

getImageList

ImageList getImageList(Point size)

getToolImageList

ImageList getToolImageList(Point size)

getToolHotImageList

ImageList getToolHotImageList(Point size)

getToolDisabledImageList

ImageList getToolDisabledImageList(Point size)

getModalShell

Shell getModalShell()

getLastEventTime

int getLastEventTime()

getShells

public Shell[] getShells()
Enabled: Returns an array containing all shells which have not been disposed and have the receiver as their display.

Returns:
the receiver's shells

getSyncThread

public Thread getSyncThread()
Suppressed: Returns the thread that has invoked syncExec or null if no such runnable is currently being invoked by the user-interface thread.

Note: If a runnable invoked by asyncExec is currently running, this method will return null.

Returns:
the receiver's sync-interface thread

getSystemColor

public Color getSystemColor(int id)
Enabled: Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT. Any value other than one of the SWT color constants which is passed in will result in the color black. This color should not be free'd because it was allocated by the system, not the application.

Overrides:
getSystemColor in class Device
Parameters:
id - the color constant
Returns:
the matching color
See Also:
SWT

getSystemFont

public Font getSystemFont()
Enabled: Returns a reasonable font for applications to use. On some platforms, this will match the "default font" or "system font" if such can be found. This font should not be free'd because it was allocated by the system, not the application.

Typically, applications which want the default look should simply not set the font on the widgets they create. Widgets are always created with the correct default font for the class of user-interface component they represent.

Overrides:
getSystemFont in class Device
Returns:
a font

getThread

public Thread getThread()
Suppressed: Returns the user-interface thread for the receiver.

Returns:
the receiver's user-interface thread

internal_new_GC

public int internal_new_GC(GCData data)
Suppressed: Invokes platform specific functionality to allocate a new GC handle.

IMPORTANT: This method is not part of the public API for Display. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.

Specified by:
internal_new_GC in interface Drawable
Specified by:
internal_new_GC in class Device
Parameters:
data - the platform specific GC data
Returns:
the platform specific GC handle

init

protected void init()
Initializes any internal resources needed by the device.

This method is called after create.

Overrides:
init in class Device
See Also:
create(org.eclipse.swt.graphics.DeviceData)

internal_dispose_GC

public void internal_dispose_GC(int hDC,
                                GCData data)
Suppressed: Invokes platform specific functionality to dispose a GC handle.

IMPORTANT: This method is not part of the public API for Display. It is marked public only so that it can be shared within the packages provided by SWT. It is not available on all platforms, and should never be called from application code.

Specified by:
internal_dispose_GC in interface Drawable
Specified by:
internal_dispose_GC in class Device
Parameters:
data - the platform specific GC data

isWakeMessage

boolean isWakeMessage(org.eclipse.swt.internal.win32.MSG msg)

isValidThread

boolean isValidThread()

isVirtualKey

boolean isVirtualKey(int key)

messageProc

int messageProc(int hwnd,
                int msg,
                int wParam,
                int lParam)

msgFilterProc

int msgFilterProc(int code,
                  int wParam,
                  int lParam)

numpadKey

int numpadKey(int key)

postEvent

void postEvent(Event event)

readAndDispatch

public boolean readAndDispatch()
Enabled: Reads an event from the operating system's event queue, dispatches it appropriately, and returns true if there is potentially more work to do, or false if the caller can sleep until another event is placed on the event queue.

In addition to checking the system event queue, this method also checks if any inter-thread messages (created by syncExec() or asyncExec()) are waiting to be processed, and if so handles them before returning.

Returns:
false if the caller can sleep upon return from this method
See Also:
sleep(), wake()

register

static void register(Display display)

release

protected void release()
Releases any internal resources back to the operating system and clears all fields except the device handle.

Disposes all shells which are currently open on the display. After this method has been invoked, all related related shells will answer true when sent the message isDisposed().

When a device is destroyed, resources that were acquired on behalf of the programmer need to be returned to the operating system. For example, if the device allocated a font to be used as the system font, this font would be freed in release. Also,to assist the garbage collector and minimize the amount of memory that is not reclaimed when the programmer keeps a reference to a disposed device, all fields except the handle are zero'd. The handle is needed by destroy.

This method is called before destroy.

Overrides:
release in class Device
See Also:
Device.dispose(), destroy()

releaseDisplay

void releaseDisplay()

releaseImageList

void releaseImageList(ImageList list)

releaseToolImageList

void releaseToolImageList(ImageList list)

releaseToolHotImageList

void releaseToolHotImageList(ImageList list)

releaseToolDisabledImageList

void releaseToolDisabledImageList(ImageList list)

removeFilter

void removeFilter(int eventType,
                  Listener listener)
Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs anywhere in SWT.

Parameters:
eventType - the type of event to listen for
listener - the listener which should no longer be notified when the event occurs
Since:
2.1
See Also:
Listener, addFilter(int, org.eclipse.swt.widgets.Listener), addListener(int, org.eclipse.swt.widgets.Listener)

removeListener

public void removeListener(int eventType,
                           Listener listener)
Suppressed: Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs.

Parameters:
eventType - the type of event to listen for
listener - the listener which should no longer be notified when the event occurs
Since:
2.0
See Also:
Listener, addListener(int, org.eclipse.swt.widgets.Listener)

removeBar

void removeBar(Menu menu)

removePopup

void removePopup(Menu menu)

runAsyncMessages

boolean runAsyncMessages()

runDeferredEvents

boolean runDeferredEvents()

runPopups

boolean runPopups()

runTimer

boolean runTimer(int id)

sendEvent

void sendEvent(int eventType,
               Event event)

setCursorLocation

public void setCursorLocation(int x,
                              int y)
Suppressed: Sets the location of the on-screen pointer relative to the top left corner of the screen. Note: It is typically considered bad practice for a program to move the on-screen pointer location.

Parameters:
x - the new x coordinate for the cursor
y - the new y coordinate for the cursor
Since:
2.1

setCursorLocation

public void setCursorLocation(Point point)
Suppressed: Sets the location of the on-screen pointer relative to the top left corner of the screen. Note: It is typically considered bad practice for a program to move the on-screen pointer location.

Parameters:
point - new position
Since:
2.0

setData

public void setData(String key,
                    Object value)
Suppressed: Sets the application defined property of the receiver with the specified name to the given argument.

Applications may have associated arbitrary objects with the receiver in this fashion. If the objects stored in the properties need to be notified when the display is disposed of, it is the application's responsibility provide a disposeExec() handler which does so.

Parameters:
key - the name of the property
value - the new value for the property
See Also:
setData(java.lang.String, java.lang.Object), disposeExec(java.lang.Runnable)

setData

public void setData(Object data)
Suppressed: Sets the application defined, display specific data associated with the receiver, to the argument. The display specific data is a single, unnamed field that is stored with every display.

Applications may put arbitrary objects in this field. If the object stored in the display specific data needs to be notified when the display is disposed of, it is the application's responsibility provide a disposeExec() handler which does so.

Parameters:
data - the new display specific data
See Also:
getData(java.lang.String), disposeExec(java.lang.Runnable)

setAppName

public static void setAppName(String name)
Suppressed: On platforms which support it, sets the application name to be the argument. On Motif, for example, this can be used to set the name used for resource lookup.

Parameters:
name - the new app name

setModalShell

void setModalShell(Shell shell)

setSynchronizer

public void setSynchronizer(Synchronizer synchronizer)
Suppressed: Sets the synchronizer used by the display to be the argument, which can not be null.

Parameters:
synchronizer - the new synchronizer for the display (must not be null)

shiftedKey

int shiftedKey(int key)

sleep

public boolean sleep()
Enabled: Causes the user-interface thread to sleep (that is, to be put in a state where it does not consume CPU cycles) until an event is received or it is otherwise awakened.

Returns:
true if an event requiring dispatching was placed on the queue.
See Also:
wake()

syncExec

public void syncExec(Runnable runnable)
Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity. The thread which calls this method is suspended until the runnable completes.

Parameters:
runnable - code to run on the user-interface thread.
See Also:
asyncExec(java.lang.Runnable)

systemFont

int systemFont()

timerExec

public void timerExec(int milliseconds,
                      Runnable runnable)
Suppressed: Causes the run() method of the runnable to be invoked by the user-interface thread after the specified number of milliseconds have elapsed. If milliseconds is less than zero, the runnable is not executed.

Parameters:
milliseconds - the delay before running the runnable
runnable - code to run on the user-interface thread
See Also:
asyncExec(java.lang.Runnable)

translateAccelerator

boolean translateAccelerator(org.eclipse.swt.internal.win32.MSG msg,
                             Control control)

translateKey

static int translateKey(int key)

translateMnemonic

boolean translateMnemonic(org.eclipse.swt.internal.win32.MSG msg,
                          Control control)

translateTraversal

boolean translateTraversal(org.eclipse.swt.internal.win32.MSG msg,
                           Control control)

untranslateKey

static int untranslateKey(int key)

update

public void update()
Suppressed: Forces all outstanding paint requests for the display to be processed before this method returns.

See Also:
Control.update()

updateFont

void updateFont()

wake

public void wake()
Suppressed: If the receiver's user-interface thread was sleep'ing, causes it to be awakened and start running again. Note that this method may be called from any thread.

See Also:
sleep()

windowProc

int windowProc(int hwnd,
               int msg,
               int wParam,
               int lParam)

withCrLf

static String withCrLf(String string)


comments?