| org.eclipse.swt.widgets.Display
Display | public class Display extends Device (Code) | | Instances of this class are responsible for managing the
connection between SWT and the underlying operating
system. Their most important function is to implement
the SWT event loop in terms of the platform event model.
They also provide various methods for accessing information
about the operating system, and have overall control over
the operating system resources which SWT allocates.
Applications which are built with SWT will almost always
require only a single display. In particular, some platforms
which SWT supports will not allow more than one active
display. In other words, some platforms do not support
creating a new display if one already exists that has not been
sent the dispose() message.
In SWT, the thread which creates a Display
instance is distinguished as the user-interface thread
for that display.
The user-interface thread for a particular display has the
following special attributes:
-
The event loop for that display must be run from the thread.
-
Some SWT API methods (notably, most of the public methods in
Widget and its subclasses), may only be called
from the thread. (To support multi-threaded user-interface
applications, class Display provides inter-thread
communication methods which allow threads other than the
user-interface thread to request that it perform operations
on their behalf.)
-
The thread is not allowed to construct other
Display s until that display has been disposed.
(Note that, this is in addition to the restriction mentioned
above concerning platform support for multiple displays. Thus,
the only way to have multiple simultaneously active displays,
even on platforms which support it, is to have multiple threads.)
Enforcing these attributes allows SWT to be implemented directly
on the underlying operating system's event model. This has
numerous benefits including smaller footprint, better use of
resources, safer memory management, clearer program logic,
better performance, and fewer overall operating system threads
required. The down side however, is that care must be taken
(only) when constructing multi-threaded applications to use the
inter-thread communication mechanisms which this class provides
when required.
All SWT API methods which may only be called from the user-interface
thread are distinguished in their documentation by indicating that
they throw the "ERROR_THREAD_INVALID_ACCESS "
SWT exception.
- Styles:
- (none)
- Events:
- Close, Dispose
IMPORTANT: This class is not intended to be subclassed.
See Also: Display.syncExec See Also: Display.asyncExec See Also: Display.wake See Also: Display.readAndDispatch See Also: Display.sleep See Also: Device.dispose |
Constructor Summary | |
public | Display() Constructs a new instance of this class.
Note: The resulting display is marked as the current
display. | public | Display(DeviceData data) Constructs a new instance of this class using the parameter. |
Method Summary | |
int | accessibilityProc(int nextHandler, int theEvent, int userData) | int | actionProc(int theControl, int partCode) | void | addDisposeWindow(int window) | public void | addFilter(int eventType, Listener listener) Adds the listener to the collection of listeners who will
be notified when an event of the given type occurs anywhere
in a widget. | public void | addListener(int eventType, Listener listener) Adds the listener to the collection of listeners who will
be notified when an event of the given type occurs. | void | addMenu(Menu menu) | void | addPopup(Menu menu) | void | addToDisposeWindow(int control) | void | addWidget(int handle, Widget widget) | int | appearanceProc(int theAppleEvent, int reply, int handlerRefcon) | int | appleEventProc(int nextHandler, int theEvent, int userData) | static byte[] | ascii(String name) | public void | asyncExec(Runnable runnable) Causes the run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. | public void | beep() Causes the system hardware to emit a short sound
(if it supports this capability). | int | caretProc(int id, int clientData) | protected void | checkDevice() | static synchronized void | checkDisplay(Thread thread, boolean multiple) | protected void | checkSubclass() Checks that this class can be subclassed. | void | clearMenuFlags() | public void | close() Requests that the connection between SWT and the underlying
operating system be closed. | int | colorProc(int inControl, int inMessage, int inDrawDepth, int inDrawInColor) | int | commandProc(int nextHandler, int theEvent, int userData) | Rect | computeInset(int control) | int | controlProc(int nextHandler, int theEvent, int userData) | static String | convertToLf(String text) | protected void | create(DeviceData data) Creates the device in the operating system. | void | createDisplay(DeviceData data) | int[] | createImage(int type) | int[] | createImageFromFamily(int family, int type, int maskType, int width, int height) | int | createOverlayWindow() | static synchronized void | deregister(Display display) | protected void | destroy() Destroys the device in the operating system and releases
the device's handle. | void | destroyDisplay() | public void | disposeExec(Runnable runnable) Causes the run() method of the runnable to
be invoked by the user-interface thread just before the
receiver is disposed. | void | disposeWindows() | void | dragDetect(Control control) | int | drawItemProc(int browser, int item, int property, int itemState, int theRect, int gdDepth, int colorDevice) | void | error(int code) | boolean | filterEvent(Event event) | boolean | filters(int eventType) | public static synchronized Display | findDisplay(Thread thread) 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. | public Widget | findWidget(int handle) 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.
IMPORTANT: This method should not be called from
application code. | public Widget | findWidget(int handle, int id) Given the operating system handle for a widget,
and widget-specific id, returns the instance of
the Widget subclass which represents
the handle/id pair in the currently running application,
if such exists, or null if no matching widget can be found.
IMPORTANT: This method should not be called from
application code. | public Shell | getActiveShell() Returns the currently active Shell , or null
if no shell belonging to the currently running application
is active. | public Rectangle | getBounds() Returns a rectangle describing the receiver's size and location. | int | getCaretBlinkTime() | public Rectangle | getClientArea() Returns a rectangle which describes the area of the
receiver which is capable of displaying data. | public static synchronized Display | getCurrent() 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. | public Control | getCursorControl() 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. | public Point | getCursorLocation() Returns the location of the on-screen pointer relative
to the top left corner of the screen. | public Point[] | getCursorSizes() Returns an array containing the recommended cursor sizes. | public Object | getData(String key) 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. | public Object | getData() Returns the application defined, display specific data
associated with the receiver, or null if it has not been
set. | public static synchronized Display | getDefault() Returns the default display. | public int | getDismissalAlignment() 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. | public int | getDoubleClickTime() Returns the longest duration, in milliseconds, between
two mouse button clicks that will be considered a
double click by the underlying operating system. | public Control | getFocusControl() 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. | Control | getFocusControl(int window) | public boolean | getHighContrast() Returns true when the high contrast mode is enabled. | public int | getIconDepth() Returns the maximum allowed depth of icons on this display, in bits per pixel. | public Point[] | getIconSizes() Returns an array containing the recommended icon sizes. | int | getLastEventTime() | Menu | getMenu(int id) | Menu | getMenuBar() | Menu[] | getMenus(Decorations shell) | int | getMessageCount() | public Monitor[] | getMonitors() Returns an array of monitors attached to the device. | public Monitor | getPrimaryMonitor() Returns the primary monitor for that device. | public Shell[] | getShells() Returns a (possibly empty) array containing all shells which have
not been disposed and have the receiver as their display. | public Thread | getSyncThread() Returns the thread that has invoked syncExec
or null if no such runnable is currently being invoked by
the user-interface thread. | public Color | getSystemColor(int id) Returns the matching standard color for the given
constant, which should be one of the color constants
specified in class SWT . | public Cursor | getSystemCursor(int id) Returns the matching standard platform cursor for the given
constant, which should be one of the cursor constants
specified in class SWT . | public Image | getSystemImage(int id) Returns the matching standard platform image for the given
constant, which should be one of the icon constants
specified in class SWT . | public Tray | getSystemTray() Returns the single instance of the system tray or null
when there is no system tray available for the platform. | public Thread | getThread() Returns the user-interface thread for the receiver. | Widget | getWidget(int handle) | int | helpProc(int inControl, int inGlobalMouse, int inRequest, int outContentProvided, int ioHelpContent) | int | hitTestProc(int browser, int item, int property, int theRect, int mouseRect) | protected void | init() Initializes any internal resources needed by the
device. | void | initializeCallbacks() | void | initializeFonts() | void | initializeInsets() | void | initializeWidgetTable() | public void | internal_dispose_GC(int context, GCData data) Invokes platform specific functionality to dispose a GC handle.
IMPORTANT: This method is not part of the public
API for Display . | public int | internal_new_GC(GCData data) Invokes platform specific functionality to allocate a new GC handle.
IMPORTANT: This method is not part of the public
API for Display . | static boolean | isValidClass(Class clazz) | boolean | isValidThread() | int | itemCompareProc(int browser, int itemOne, int itemTwo, int sortProperty) | int | itemDataProc(int browser, int item, int property, int itemData, int setValue) | int | itemNotificationProc(int browser, int item, int message) | int | keyboardProc(int nextHandler, int theEvent, int userData) | public Point | map(Control from, Control to, Point point) Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. | public Point | map(Control from, Control to, int x, int y) Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. | public Rectangle | map(Control from, Control to, Rectangle rectangle) Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. | public Rectangle | map(Control from, Control to, int x, int y, int width, int height) Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. | int | menuProc(int nextHandler, int theEvent, int userData) | int | mouseHoverProc(int id, int handle) | int | mouseProc(int nextHandler, int theEvent, int userData) | public boolean | post(Event event) Generate a low level system event.
post is used to generate low level keyboard
and mouse events. | void | postEvent(Event event) | public boolean | readAndDispatch() 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. | int[] | readImageRef(int path) | static synchronized void | register(Display display) | 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. | void | releaseDisplay() | public void | removeFilter(int eventType, Listener listener) Removes the listener from the collection of listeners who will
be notified when an event of the given type occurs anywhere in
a widget. | public void | removeListener(int eventType, Listener listener) Removes the listener from the collection of listeners who will
be notified when an event of the given type occurs. | void | removeMenu(Menu menu) | void | removePopup(Menu menu) | Widget | removeWidget(int handle) | boolean | runAsyncMessages(boolean all) | boolean | runDeferredEvents() | boolean | runEnterExit() | boolean | runEventLoopTimers() | boolean | runGrabs() | boolean | runPaint() | boolean | runPopups() | boolean | runSettings() | boolean | runTimers() | void | sendEvent(int eventType, Event event) | public static void | setAppName(String name) On platforms which support it, sets the application name
to be the argument. | void | setCurrentCaret(Caret caret) | void | setCursor(int cursor) | public void | setCursorLocation(int x, int y) Sets the location of the on-screen pointer relative to the top left corner
of the screen. | public void | setCursorLocation(Point point) Sets the location of the on-screen pointer relative to the top left corner
of the screen. | public void | setData(String key, Object value) 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. | public void | setData(Object data) 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. | static void | setDevice(Device device) | void | setMenuBar(Menu menu) | public void | setSynchronizer(Synchronizer synchronizer) Sets the synchronizer used by the display to be
the argument, which can not be null. | public boolean | sleep() 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. | public void | syncExec(Runnable runnable) Causes the run() method of the runnable to
be invoked by the user-interface thread at the next
reasonable opportunity. | int | textInputProc(int nextHandler, int theEvent, int userData) | public void | timerExec(int milliseconds, Runnable runnable) Causes the run() method of the runnable to
be invoked by the user-interface thread after the specified
number of milliseconds have elapsed. | int | timerProc(int id, int index) | int | trackingProc(int browser, int itemID, int property, int theRect, int startPt, int modifiers) | static int | translateKey(int key) | static int | untranslateKey(int key) | public void | update() Forces all outstanding paint requests for the display
to be processed before this method returns. | void | updateQuitMenu() | public void | wake() If the receiver's user-interface thread was sleep ing,
causes it to be awakened and start running again. | void | wakeThread() | int | windowProc(int nextHandler, int theEvent, int userData) |
GROW_SIZE | final static int GROW_SIZE(Code) | | |
ID_START | final static int ID_START(Code) | | |
ID_TEMPORARY | final static int ID_TEMPORARY(Code) | | |
KeyTable | static int[][] KeyTable(Code) | | |
SWT0 | final static int SWT0(Code) | | |
WAKE_CLASS | final static int WAKE_CLASS(Code) | | |
WAKE_KIND | final static int WAKE_KIND(Code) | | |
actionCallbackappleEventCallbackcommandCallbackcontrolCallbackaccessibilityCallbackappearanceCallback | Callback actionCallbackappleEventCallbackcommandCallbackcontrolCallbackaccessibilityCallbackappearanceCallback(Code) | | |
actionProcappleEventProccommandProccontrolProcappearanceProcaccessibilityProc | int actionProcappleEventProccommandProccontrolProcappearanceProcaccessibilityProc(Code) | | |
allowTimers | boolean allowTimers(Code) | | |
buttonInsettabFolderNorthInsettabFolderSouthInsetcomboInseteditTextInset | Rect buttonInsettabFolderNorthInsettabFolderSouthInsetcomboInseteditTextInset(Code) | | |
caretCallback | Callback caretCallback(Code) | | |
caretIDcaretProc | int caretIDcaretProc(Code) | | |
clickCountclickCountButton | int clickCountclickCountButton(Code) | | |
currentCaret | Caret currentCaret(Code) | | |
currentControl | Control currentControl(Code) | | |
cursors | Cursor[] cursors(Code) | | |
disposeWindow | int disposeWindow(Code) | | |
disposeWindowList | int[] disposeWindowList(Code) | | |
dockImagedockImageData | int dockImagedockImageData(Code) | | |
dragMouseStart | org.eclipse.swt.internal.carbon.Point dragMouseStart(Code) | | |
draggingmouseMoved | boolean draggingmouseMoved(Code) | | |
drawItemCallbackitemDataCallbackitemNotificationCallbackitemCompareCallback | Callback drawItemCallbackitemDataCallbackitemNotificationCallbackitemCompareCallback(Code) | | |
drawItemProcitemDataProcitemNotificationProcitemCompareProchelpProc | int drawItemProcitemDataProcitemNotificationProcitemCompareProchelpProc(Code) | | |
errorImageinfoImagewarningImage | Image errorImageinfoImagewarningImage(Code) | | |
eventQueue | Event[] eventQueue(Code) | | |
eventTablefilterTable | EventTable eventTablefilterTable(Code) | | |
focusCombo | Combo focusCombo(Code) | | |
focusControl | Control focusControl(Code) | | |
focusEvent | int focusEvent(Code) | | |
grabControlmouseUpControl | Control grabControlmouseUpControl(Code) | | |
grabbing | boolean grabbing(Code) | | |
helpString | int helpString(Code) | | |
highlightColor | RGBColor highlightColor(Code) | | |
hitTestCallbackkeyboardCallbackmenuCallbackmouseHoverCallbackhelpCallback | Callback hitTestCallbackkeyboardCallbackmenuCallbackmouseHoverCallbackhelpCallback(Code) | | |
hitTestProckeyboardProcmenuProcmouseHoverProc | int hitTestProckeyboardProcmenuProcmouseHoverProc(Code) | | |
ignoreFocus | boolean ignoreFocus(Code) | | |
inPaintneedsPaint | boolean inPaintneedsPaint(Code) | | |
indexTableproperty | int[] indexTableproperty(Code) | | |
kchrState | int[] kchrState(Code) | | |
lastHelpXlastHelpY | int lastHelpXlastHelpY(Code) | | |
menuspopups | Menu[] menuspopups(Code) | | |
mouseCallbacktrackingCallbackwindowCallbackcolorCallbacktextInputCallback | Callback mouseCallbacktrackingCallbackwindowCallbackcolorCallbacktextInputCallback(Code) | | |
mouseHoverID | int mouseHoverID(Code) | | |
mouseProctrackingProcwindowProccolorProctextInputProc | int mouseProctrackingProcwindowProccolorProctextInputProc(Code) | | |
noFocusRing | boolean noFocusRing(Code) | | |
queuelastModifiers | int queuelastModifiers(Code) | | |
runSettings | boolean runSettings(Code) | | |
smallFonts | boolean smallFonts(Code) | | |
synchronizer | Synchronizer synchronizer(Code) | | |
timerCallback | Callback timerCallback(Code) | | |
Display | public Display()(Code) | | 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.
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if called from a thread that already created an existing display
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also: Display.getCurrent See Also: Display.getDefault See Also: Widget.checkSubclass See Also: Shell |
Display | public Display(DeviceData data)(Code) | | Constructs a new instance of this class using the parameter.
Parameters: data - the device data |
accessibilityProc | int accessibilityProc(int nextHandler, int theEvent, int userData)(Code) | | |
actionProc | int actionProc(int theControl, int partCode)(Code) | | |
addDisposeWindow | void addDisposeWindow(int window)(Code) | | |
addFilter | public void addFilter(int eventType, Listener listener)(Code) | | Adds the listener to the collection of listeners who will
be notified when an event of the given type occurs anywhere
in a widget. The event type is one of the event constants
defined in class SWT . When the event does occur,
the listener is notified by sending it the handleEvent()
message.
Setting the type of an event to SWT.None from
within the handleEvent() method can be used to
change the event type and stop subsequent Java listeners
from running. Because event filters run before other listeners,
event filters can both block other listeners and set arbitrary
fields within an event. For this reason, event filters are both
powerful and dangerous. They should generally be avoided for
performance, debugging and code maintenance reasons.
Parameters: eventType - the type of event to listen for Parameters: listener - the listener which should be notified when the event occurs exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the listener is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Listener See Also: SWT See Also: Display.removeFilter See Also: Display.removeListener since: 3.0 |
addListener | public void addListener(int eventType, Listener listener)(Code) | | Adds the listener to the collection of listeners who will
be notified when an event of the given type occurs. The event
type is one of the event constants defined in class SWT .
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 Parameters: listener - the listener which should be notified when the event occurs exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the listener is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Listener See Also: SWT See Also: Display.removeListener since: 2.0 |
addMenu | void addMenu(Menu menu)(Code) | | |
addPopup | void addPopup(Menu menu)(Code) | | |
addToDisposeWindow | void addToDisposeWindow(int control)(Code) | | |
appearanceProc | int appearanceProc(int theAppleEvent, int reply, int handlerRefcon)(Code) | | |
appleEventProc | int appleEventProc(int nextHandler, int theEvent, int userData)(Code) | | |
asyncExec | public void asyncExec(Runnable runnable)(Code) | | 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. Specifying null as the
runnable simply wakes the user-interface thread when run.
Note that at the time the runnable is invoked, widgets
that have the receiver as their display may have been
disposed. Therefore, it is necessary to check for this
case inside the runnable before accessing the widget.
Parameters: runnable - code to run on the user-interface thread or null exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.syncExec |
beep | public void beep()(Code) | | Causes the system hardware to emit a short sound
(if it supports this capability).
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
caretProc | int caretProc(int id, int clientData)(Code) | | |
checkDevice | protected void checkDevice()(Code) | | |
checkDisplay | static synchronized void checkDisplay(Thread thread, boolean multiple)(Code) | | |
checkSubclass | protected void checkSubclass()(Code) | | Checks that this class can be subclassed.
IMPORTANT: See the comment in Widget.checkSubclass() .
exception: SWTException - - ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also: Widget.checkSubclass |
clearMenuFlags | void clearMenuFlags()(Code) | | |
close | public void close()(Code) | | Requests that the connection between SWT and the underlying
operating system be closed.
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Device.dispose since: 2.0 |
colorProc | int colorProc(int inControl, int inMessage, int inDrawDepth, int inDrawInColor)(Code) | | |
commandProc | int commandProc(int nextHandler, int theEvent, int userData)(Code) | | |
computeInset | Rect computeInset(int control)(Code) | | |
controlProc | int controlProc(int nextHandler, int theEvent, int userData)(Code) | | |
create | protected void create(DeviceData data)(Code) | | 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 .
Parameters: data - the DeviceData which describes the receiver See Also: Display.init |
createDisplay | void createDisplay(DeviceData data)(Code) | | |
createImage | int[] createImage(int type)(Code) | | |
createImageFromFamily | int[] createImageFromFamily(int family, int type, int maskType, int width, int height)(Code) | | |
createOverlayWindow | int createOverlayWindow()(Code) | | |
deregister | static synchronized void deregister(Display display)(Code) | | |
destroy | protected void destroy()(Code) | | 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 .
See Also: Device.dispose See Also: Display.release |
destroyDisplay | void destroyDisplay()(Code) | | |
disposeExec | public void disposeExec(Runnable runnable)(Code) | | Causes the run() method of the runnable to
be invoked by the user-interface thread just before the
receiver is disposed. Specifying a null runnable
is ignored.
Parameters: runnable - code to run at dispose time. exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
disposeWindows | void disposeWindows()(Code) | | |
dragDetect | void dragDetect(Control control)(Code) | | |
drawItemProc | int drawItemProc(int browser, int item, int property, int itemState, int theRect, int gdDepth, int colorDevice)(Code) | | |
error | void error(int code)(Code) | | |
filterEvent | boolean filterEvent(Event event)(Code) | | |
filters | boolean filters(int eventType)(Code) | | |
findDisplay | public static synchronized Display findDisplay(Thread thread)(Code) | | 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. Specifying
null as the thread will return null
for the display.
Parameters: thread - the user-interface thread the display for the given thread |
findWidget | public Widget findWidget(int handle)(Code) | | 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.
IMPORTANT: This method should not be called from
application code. The arguments are platform-specific.
Parameters: handle - the handle for the widget the SWT widget that the handle represents exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
findWidget | public Widget findWidget(int handle, int id)(Code) | | Given the operating system handle for a widget,
and widget-specific id, returns the instance of
the Widget subclass which represents
the handle/id pair in the currently running application,
if such exists, or null if no matching widget can be found.
IMPORTANT: This method should not be called from
application code. The arguments are platform-specific.
Parameters: handle - the handle for the widget Parameters: id - the id for the subwidget (usually an item) the SWT widget that the handle/id pair represents exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 3.1 |
getActiveShell | public Shell getActiveShell()(Code) | | Returns the currently active Shell , or null
if no shell belonging to the currently running application
is active.
the active shell or null exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getBounds | public Rectangle getBounds()(Code) | | Returns a rectangle describing the receiver's size and location.
the bounding rectangle exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getCaretBlinkTime | int getCaretBlinkTime()(Code) | | |
getClientArea | public Rectangle getClientArea()(Code) | | Returns a rectangle which describes the area of the
receiver which is capable of displaying data.
the client area exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.getBounds |
getCurrent | public static synchronized Display getCurrent()(Code) | | 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.
the current display |
getCursorControl | public Control getCursorControl()(Code) | | 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.
the control under the cursor exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getCursorLocation | public Point getCursorLocation()(Code) | | Returns the location of the on-screen pointer relative
to the top left corner of the screen.
the cursor location exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getCursorSizes | public Point[] getCursorSizes()(Code) | | Returns an array containing the recommended cursor sizes.
the array of cursor sizes exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 3.0 |
getData | public Object getData(String key)(Code) | | 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 to provide a
disposeExec() handler which does so.
Parameters: key - the name of the property the value of the property or null if it has not been set exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the key is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.setData(String,Object) See Also: Display.disposeExec(Runnable) |
getData | public Object getData()(Code) | | 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 to provide a
disposeExec() handler which does so.
the display specific data exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.setData(Object) See Also: Display.disposeExec(Runnable) |
getDefault | public static synchronized Display getDefault()(Code) | | Returns the default display. One is created (making the
thread that invokes this method its user-interface thread)
if it did not already exist.
the default display |
getDismissalAlignment | public int getDismissalAlignment()(Code) | | 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.
the button dismissal order exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1 |
getDoubleClickTime | public int getDoubleClickTime()(Code) | | Returns the longest duration, in milliseconds, between
two mouse button clicks that will be considered a
double click by the underlying operating system.
the double click time exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getFocusControl | public Control getFocusControl()(Code) | | 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.
the control under the cursor exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getFocusControl | Control getFocusControl(int window)(Code) | | |
getHighContrast | public boolean getHighContrast()(Code) | | Returns true when the high contrast mode is enabled.
Otherwise, false is returned.
Note: This operation is a hint and is not supported on
platforms that do not have this concept.
the high contrast mode exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 3.0 |
getIconDepth | public int getIconDepth()(Code) | | Returns the maximum allowed depth of icons on this display, in bits per pixel.
On some platforms, this may be different than the actual depth of the display.
the maximum icon depth exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Device.getDepth |
getIconSizes | public Point[] getIconSizes()(Code) | | Returns an array containing the recommended icon sizes.
the array of icon sizes exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Decorations.setImages(Image[]) since: 3.0 |
getLastEventTime | int getLastEventTime()(Code) | | |
getMenu | Menu getMenu(int id)(Code) | | |
getMenuBar | Menu getMenuBar()(Code) | | |
getMenus | Menu[] getMenus(Decorations shell)(Code) | | |
getMessageCount | int getMessageCount()(Code) | | |
getMonitors | public Monitor[] getMonitors()(Code) | | Returns an array of monitors attached to the device.
the array of monitors since: 3.0 |
getPrimaryMonitor | public Monitor getPrimaryMonitor()(Code) | | Returns the primary monitor for that device.
the primary monitor since: 3.0 |
getShells | public Shell[] getShells()(Code) | | Returns a (possibly empty) array containing all shells which have
not been disposed and have the receiver as their display.
the receiver's shells exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getSyncThread | public Thread getSyncThread()(Code) | | 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.
the receiver's sync-interface thread exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
getSystemColor | public Color getSystemColor(int id)(Code) | | 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.
Parameters: id - the color constant the matching color exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: SWT |
getSystemCursor | public Cursor getSystemCursor(int id)(Code) | | Returns the matching standard platform cursor for the given
constant, which should be one of the cursor constants
specified in class SWT . This cursor should
not be free'd because it was allocated by the system,
not the application. A value of null will
be returned if the supplied constant is not an SWT cursor
constant.
Parameters: id - the SWT cursor constant the corresponding cursor or null exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: SWT.CURSOR_ARROW See Also: SWT.CURSOR_WAIT See Also: SWT.CURSOR_CROSS See Also: SWT.CURSOR_APPSTARTING See Also: SWT.CURSOR_HELP See Also: SWT.CURSOR_SIZEALL See Also: SWT.CURSOR_SIZENESW See Also: SWT.CURSOR_SIZENS See Also: SWT.CURSOR_SIZENWSE See Also: SWT.CURSOR_SIZEWE See Also: SWT.CURSOR_SIZEN See Also: SWT.CURSOR_SIZES See Also: SWT.CURSOR_SIZEE See Also: SWT.CURSOR_SIZEW See Also: SWT.CURSOR_SIZENE See Also: SWT.CURSOR_SIZESE See Also: SWT.CURSOR_SIZESW See Also: SWT.CURSOR_SIZENW See Also: SWT.CURSOR_UPARROW See Also: SWT.CURSOR_IBEAM See Also: SWT.CURSOR_NO See Also: SWT.CURSOR_HAND since: 3.0 |
getSystemImage | public Image getSystemImage(int id)(Code) | | Returns the matching standard platform image for the given
constant, which should be one of the icon constants
specified in class SWT . This image should
not be free'd because it was allocated by the system,
not the application. A value of null will
be returned either if the supplied constant is not an
SWT icon constant or if the platform does not define an
image that corresponds to the constant.
Parameters: id - the SWT icon constant the corresponding image or null exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: SWT.ICON_ERROR See Also: SWT.ICON_INFORMATION See Also: SWT.ICON_QUESTION See Also: SWT.ICON_WARNING See Also: SWT.ICON_WORKING since: 3.0 |
getSystemTray | public Tray getSystemTray()(Code) | | Returns the single instance of the system tray or null
when there is no system tray available for the platform.
the system tray or null exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 3.0 |
getThread | public Thread getThread()(Code) | | Returns the user-interface thread for the receiver.
the receiver's user-interface thread exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
|
helpProc | int helpProc(int inControl, int inGlobalMouse, int inRequest, int outContentProvided, int ioHelpContent)(Code) | | |
hitTestProc | int hitTestProc(int browser, int item, int property, int theRect, int mouseRect)(Code) | | |
init | protected void init()(Code) | | Initializes any internal resources needed by the
device.
This method is called after create .
See Also: Display.create |
initializeCallbacks | void initializeCallbacks()(Code) | | |
initializeFonts | void initializeFonts()(Code) | | |
initializeInsets | void initializeInsets()(Code) | | |
initializeWidgetTable | void initializeWidgetTable()(Code) | | |
internal_dispose_GC | public void internal_dispose_GC(int context, GCData data)(Code) | | 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.
Parameters: hDC - the platform specific GC handle Parameters: data - the platform specific GC data |
internal_new_GC | public int internal_new_GC(GCData data)(Code) | | 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.
Parameters: data - the platform specific GC data the platform specific GC handle exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
exception: SWTError - - ERROR_NO_HANDLES if a handle could not be obtained for gc creation
|
isValidClass | static boolean isValidClass(Class clazz)(Code) | | |
isValidThread | boolean isValidThread()(Code) | | |
itemCompareProc | int itemCompareProc(int browser, int itemOne, int itemTwo, int sortProperty)(Code) | | |
itemDataProc | int itemDataProc(int browser, int item, int property, int itemData, int setValue)(Code) | | |
itemNotificationProc | int itemNotificationProc(int browser, int item, int message)(Code) | | |
keyboardProc | int keyboardProc(int nextHandler, int theEvent, int userData)(Code) | | |
map | public Point map(Control from, Control to, Point point)(Code) | | Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. When one control is mirrored
and the other is not, adding the width and height to a
point that was mapped causes the rectangle to extend
in the wrong direction. Mapping the entire rectangle
instead of just one point causes both the origin and
the corner of the rectangle to be mapped.
Parameters: from - the source Control or null Parameters: to - the destination Control or null Parameters: point - to be mapped point with mapped coordinates exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the point is null
- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1.2 |
map | public Point map(Control from, Control to, int x, int y)(Code) | | Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. When one control is mirrored
and the other is not, adding the width and height to a
point that was mapped causes the rectangle to extend
in the wrong direction. Mapping the entire rectangle
instead of just one point causes both the origin and
the corner of the rectangle to be mapped.
Parameters: from - the source Control or null Parameters: to - the destination Control or null Parameters: x - coordinates to be mapped Parameters: y - coordinates to be mapped point with mapped coordinates exception: IllegalArgumentException - - ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1.2 |
map | public Rectangle map(Control from, Control to, Rectangle rectangle)(Code) | | Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. When one control is mirrored
and the other is not, adding the width and height to a
point that was mapped causes the rectangle to extend
in the wrong direction. Mapping the entire rectangle
instead of just one point causes both the origin and
the corner of the rectangle to be mapped.
Parameters: from - the source Control or null Parameters: to - the destination Control or null Parameters: rectangle - to be mapped rectangle with mapped coordinates exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the rectangle is null
- ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1.2 |
map | public Rectangle map(Control from, Control to, int x, int y, int width, int height)(Code) | | Maps a point from one coordinate system to another.
When the control is null, coordinates are mapped to
the display.
NOTE: On right-to-left platforms where the coordinate
systems are mirrored, special care needs to be taken
when mapping coordinates from one control to another
to ensure the result is correctly mirrored.
Mapping a point that is the origin of a rectangle and
then adding the width and height is not equivalent to
mapping the rectangle. When one control is mirrored
and the other is not, adding the width and height to a
point that was mapped causes the rectangle to extend
in the wrong direction. Mapping the entire rectangle
instead of just one point causes both the origin and
the corner of the rectangle to be mapped.
Parameters: from - the source Control or null Parameters: to - the destination Control or null Parameters: x - coordinates to be mapped Parameters: y - coordinates to be mapped Parameters: width - coordinates to be mapped Parameters: height - coordinates to be mapped rectangle with mapped coordinates exception: IllegalArgumentException - - ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1.2 |
menuProc | int menuProc(int nextHandler, int theEvent, int userData)(Code) | | |
mouseHoverProc | int mouseHoverProc(int id, int handle)(Code) | | |
mouseProc | int mouseProc(int nextHandler, int theEvent, int userData)(Code) | | |
post | public boolean post(Event event)(Code) | | Generate a low level system event.
post is used to generate low level keyboard
and mouse events. The intent is to enable automated UI
testing by simulating the input from the user. Most
SWT applications should never need to call this method.
Note that this operation can fail when the operating system
fails to generate the event for any reason. For example,
this can happen when there is no such key or mouse button
or when the system event queue is full.
Event Types:
KeyDown, KeyUp
The following fields in the Event apply:
- (in) type KeyDown or KeyUp
Either one of:
- (in) character a character that corresponds to a keyboard key
- (in) keyCode the key code of the key that was typed,
as defined by the key code constants in class
SWT
MouseDown, MouseUp
The following fields in the Event apply:
- (in) type MouseDown or MouseUp
- (in) button the button that is pressed or released
MouseMove
The following fields in the Event apply:
- (in) type MouseMove
- (in) x the x coordinate to move the mouse pointer to in screen coordinates
- (in) y the y coordinate to move the mouse pointer to in screen coordinates
Parameters: event - the event to be generated true if the event was generated or false otherwise exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the event is null
exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 3.0 |
postEvent | void postEvent(Event event)(Code) | | |
readAndDispatch | public boolean readAndDispatch()(Code) | | 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.
false if the caller can sleep upon return from this method exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message
See Also: Display.sleep See Also: Display.wake |
readImageRef | int[] readImageRef(int path)(Code) | | |
release | protected void release()(Code) | | 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 .
See Also: Device.dispose See Also: Display.destroy |
releaseDisplay | void releaseDisplay()(Code) | | |
removeFilter | public void removeFilter(int eventType, Listener listener)(Code) | | Removes the listener from the collection of listeners who will
be notified when an event of the given type occurs anywhere in
a widget. The event type is one of the event constants defined
in class SWT .
Parameters: eventType - the type of event to listen for Parameters: listener - the listener which should no longer be notified when the event occurs exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the listener is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
See Also: Listener See Also: SWT See Also: Display.addFilter See Also: Display.addListener since: 3.0 |
removeListener | public void removeListener(int eventType, Listener listener)(Code) | | Removes the listener from the collection of listeners who will
be notified when an event of the given type occurs. The event type
is one of the event constants defined in class SWT .
Parameters: eventType - the type of event to listen for Parameters: listener - the listener which should no longer be notified when the event occurs exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the listener is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Listener See Also: SWT See Also: Display.addListener since: 2.0 |
removeMenu | void removeMenu(Menu menu)(Code) | | |
removePopup | void removePopup(Menu menu)(Code) | | |
runAsyncMessages | boolean runAsyncMessages(boolean all)(Code) | | |
runDeferredEvents | boolean runDeferredEvents()(Code) | | |
runEnterExit | boolean runEnterExit()(Code) | | |
runEventLoopTimers | boolean runEventLoopTimers()(Code) | | |
runGrabs | boolean runGrabs()(Code) | | |
runPaint | boolean runPaint()(Code) | | |
runPopups | boolean runPopups()(Code) | | |
runSettings | boolean runSettings()(Code) | | |
runTimers | boolean runTimers()(Code) | | |
sendEvent | void sendEvent(int eventType, Event event)(Code) | | |
setAppName | public static void setAppName(String name)(Code) | | 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. Specifying
null for the name clears it.
Parameters: name - the new app name or null |
setCurrentCaret | void setCurrentCaret(Caret caret)(Code) | | |
setCursor | void setCursor(int cursor)(Code) | | |
setCursorLocation | public void setCursorLocation(int x, int y)(Code) | | 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 Parameters: y - the new y coordinate for the cursor exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.1 |
setCursorLocation | public void setCursorLocation(Point point)(Code) | | 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 exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_NULL_ARGUMENT - if the point is null
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
since: 2.0 |
setData | public void setData(String key, Object value)(Code) | | 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 Parameters: value - the new value for the property exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the key is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.getData(String) See Also: Display.disposeExec(Runnable) |
setData | public void setData(Object data)(Code) | | 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 exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.getData() See Also: Display.disposeExec(Runnable) |
setDevice | static void setDevice(Device device)(Code) | | |
setMenuBar | void setMenuBar(Menu menu)(Code) | | |
setSynchronizer | public void setSynchronizer(Synchronizer synchronizer)(Code) | | 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) exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the synchronizer is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
- ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message
|
sleep | public boolean sleep()(Code) | | 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.
true if an event requiring dispatching was placed on the queue. exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.wake |
syncExec | public void syncExec(Runnable runnable)(Code) | | 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. Specifying null
as the runnable simply wakes the user-interface thread.
Note that at the time the runnable is invoked, widgets
that have the receiver as their display may have been
disposed. Therefore, it is necessary to check for this
case inside the runnable before accessing the widget.
Parameters: runnable - code to run on the user-interface thread or null exception: SWTException - - ERROR_FAILED_EXEC - if an exception occured when executing the runnable
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.asyncExec |
textInputProc | int textInputProc(int nextHandler, int theEvent, int userData)(Code) | | |
timerExec | public void timerExec(int milliseconds, Runnable runnable)(Code) | | 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.
Note that at the time the runnable is invoked, widgets
that have the receiver as their display may have been
disposed. Therefore, it is necessary to check for this
case inside the runnable before accessing the widget.
Parameters: milliseconds - the delay before running the runnable Parameters: runnable - code to run on the user-interface thread exception: IllegalArgumentException - - ERROR_NULL_ARGUMENT - if the runnable is null
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.asyncExec |
timerProc | int timerProc(int id, int index)(Code) | | |
trackingProc | int trackingProc(int browser, int itemID, int property, int theRect, int startPt, int modifiers)(Code) | | |
translateKey | static int translateKey(int key)(Code) | | |
untranslateKey | static int untranslateKey(int key)(Code) | | |
update | public void update()(Code) | | Forces all outstanding paint requests for the display
to be processed before this method returns.
exception: SWTException - - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Control.update |
updateQuitMenu | void updateQuitMenu()(Code) | | |
wake | public void wake()(Code) | | 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.
exception: SWTException - - ERROR_DEVICE_DISPOSED - if the receiver has been disposed
See Also: Display.sleep |
wakeThread | void wakeThread()(Code) | | |
windowProc | int windowProc(int nextHandler, int theEvent, int userData)(Code) | | |
|
|