Java Doc for Display.java in  » IDE-Eclipse » swt » org » eclipse » swt » widgets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » swt » org.eclipse.swt.widgets 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.graphics.Device
      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 Displays 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, Settings

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


Field Summary
final static  StringADD_WIDGET_KEY
    
static  StringAPP_NAME
    
static  DisplayDefault
    
static  Display[]Displays
    
final static  intGROW_SIZE
    
final static  intID_START
    
final static  intID_TEMPORARY
    
static  int[][]KeyTable
    
final static  StringPACKAGE_PREFIX
    
final static  intSWT0
    
 CallbackactionCallbackappleEventCallbackclockCallbackcommandCallbackcontrolCallbackaccessibilityCallbackappearanceCallback
    
 intactionProcappleEventProcclockProccommandProccontrolProcappearanceProcaccessibilityProc
    
 ShellactiveShell
    
 booleanallowTimers
    
 RectbuttonInsettabFolderNorthInsettabFolderSouthInsetcomboInseteditTextInsetsearchTextInset
    
 CallbackcaretCallback
    
 intcaretIDcaretProc
    
 intclickCountclickCountButton
    
 CaretcurrentCaret
    
 ControlcurrentControl
    
 Cursor[]cursors
    
 Objectdata
    
 Runnable[]disposeList
    
 intdisposeWindow
    
 int[]disposeWindowList
    
 booleandisposing
    
 intdockImage
    
 intdragButtondragXdragYdragStatedragModifiers
    
 booleandragging
    
 CallbackdrawItemCallbackitemDataCallbackitemNotificationCallbackitemCompareCallbacksearchCallbacktrayItemCallback
    
 intdrawItemProcitemDataProcitemNotificationProcitemCompareProchelpProcsearchProctrayItemProc
    
 ImageerrorImageinfoImagewarningImage
    
 Event[]eventQueue
    
 EventTableeventTablefilterTable
    
 CombofocusCombo
    
 ControlfocusControl
    
 intfocusEvent
    
 intfreeSlot
    
 intgcWindow
    
 ControlgrabControl
    
 inthelpString
    
 WidgethelpWidget
    
 RGBColorhighlightColor
    
 CallbackhitTestCallbackkeyboardCallbackmenuCallbackmouseHoverCallbackhelpCallbackobserverCallbacksourceCallback
    
 inthitTestProckeyboardProcmenuProcmouseHoverProcobserverProcsourceProc
    
 booleanignoreFocus
    
 booleaninPaintneedsPaint
    
 int[]indexTableproperty
    
 intkchrPtr
    
 int[]kchrState
    
 String[]keys
    
 intlastHelpXlastHelpY
    
 MenumenuBar
    
 Menu[]menuspopups
    
 CallbackmouseCallbacktrackingCallbackwindowCallbackcolorCallbacktextInputCallbackreleaseCallbackcoreEventCallback
    
 intmouseHoverID
    
 booleanmouseMoved
    
 intmouseProctrackingProcwindowProccolorProctextInputProcreleaseProccoreEventProc
    
 intqueuerunLooprunLoopSourcerunLoopObserverlastModifierslastStatelastXlastY
    
 booleanrunAsyncMessages
    
 booleanrunSettings
    
 booleansmallFonts
    
 Synchronizersynchronizer
    
 Threadthread
    
 CallbacktimerCallback
    
 int[]timerIds
    
 Runnable[]timerList
    
 inttimerProc
    
 Traytray
    
 Object[]values
    
 Widget[]widgetTable
    

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
 intaccessibilityProc(int nextHandler, int theEvent, int userData)
    
 intactionProc(int theControl, int partCode)
    
 voidaddDisposeWindow(int window)
    
public  voidaddFilter(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  voidaddListener(int eventType, Listener listener)
     Adds the listener to the collection of listeners who will be notified when an event of the given type occurs.
 voidaddMenu(Menu menu)
    
 voidaddPopup(Menu menu)
    
 voidaddToDisposeWindow(int control)
    
 voidaddWidget(int handle, Widget widget)
    
 intappearanceProc(int theAppleEvent, int reply, int handlerRefcon)
    
 intappleEventProc(int nextHandler, int theEvent, int userData)
    
static  byte[]ascii(String name)
    
public  voidasyncExec(Runnable runnable)
     Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
public  voidbeep()
     Causes the system hardware to emit a short sound (if it supports this capability).
 intcaretProc(int id, int clientData)
    
protected  voidcheckDevice()
    
static  voidcheckDisplay(Thread thread, boolean multiple)
    
protected  voidcheckSubclass()
     Checks that this class can be subclassed.
 voidclearMenuFlags()
    
 intclockProc(int nextHandler, int theEvent, int userData)
    
public  voidclose()
     Requests that the connection between SWT and the underlying operating system be closed.
 intcolorProc(int inControl, int inMessage, int inDrawDepth, int inDrawInColor)
    
 intcommandProc(int nextHandler, int theEvent, int userData)
    
 RectcomputeInset(int control)
    
 intcontrolProc(int nextHandler, int theEvent, int userData)
    
static  StringconvertToLf(String text)
    
 intcoreEventProc(int theAppleEvent, int reply, int handlerRefcon)
    
protected  voidcreate(DeviceData data)
     Creates the device in the operating system.
 voidcreateDisplay(DeviceData data)
    
 int[]createImage(int type)
    
 int[]createImageFromFamily(int family, int type, int maskType, int width, int height)
    
 intcreateOverlayWindow()
    
static  voidderegister(Display display)
    
protected  voiddestroy()
     Destroys the device in the operating system and releases the device's handle.
 voiddestroyDisplay()
    
public  voiddisposeExec(Runnable runnable)
     Causes the run() method of the runnable to be invoked by the user-interface thread just before the receiver is disposed.
 voiddisposeWindows()
    
 intdrawItemProc(int browser, int item, int property, int itemState, int theRect, int gdDepth, int colorDevice)
    
 voiderror(int code)
    
 booleanfilterEvent(Event event)
    
 booleanfilters(int eventType)
    
public static  DisplayfindDisplay(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  WidgetfindWidget(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  WidgetfindWidget(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  WidgetfindWidget(Widget widget, int id)
     Given a widget and a widget-specific id, returns the instance of the Widget subclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.
public  ShellgetActiveShell()
     Returns the currently active Shell, or null if no shell belonging to the currently running application is active.
public  RectanglegetBounds()
     Returns a rectangle describing the receiver's size and location.
 intgetCaretBlinkTime()
    
public  RectanglegetClientArea()
     Returns a rectangle which describes the area of the receiver which is capable of displaying data.
public static  DisplaygetCurrent()
     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  ControlgetCursorControl()
     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  PointgetCursorLocation()
     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  ObjectgetData(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  ObjectgetData()
     Returns the application defined, display specific data associated with the receiver, or null if it has not been set.
public static  DisplaygetDefault()
     Returns the default display.
public  intgetDismissalAlignment()
     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  intgetDoubleClickTime()
     Returns the longest duration, in milliseconds, between two mouse button clicks that will be considered a double click by the underlying operating system.
public  ControlgetFocusControl()
     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.
 ControlgetFocusControl(int window, boolean disabled)
    
public  booleangetHighContrast()
     Returns true when the high contrast mode is enabled.
public  intgetIconDepth()
     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.
 intgetLastEventTime()
    
 MenugetMenu(int id)
    
 MenugetMenuBar()
    
 Menu[]getMenus(Decorations shell)
    
 intgetMessageCount()
    
public  Monitor[]getMonitors()
     Returns an array of monitors attached to the device.
public  MonitorgetPrimaryMonitor()
     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  ThreadgetSyncThread()
     Returns the thread that has invoked syncExec or null if no such runnable is currently being invoked by the user-interface thread.
public  SynchronizergetSynchronizer()
     Gets the synchronizer used by the display.
public  ColorgetSystemColor(int id)
     Returns the matching standard color for the given constant, which should be one of the color constants specified in class SWT.
public  CursorgetSystemCursor(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  ImagegetSystemImage(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  TraygetSystemTray()
     Returns the single instance of the system tray or null when there is no system tray available for the platform.
public  ThreadgetThread()
     Returns the user-interface thread for the receiver.
 WidgetgetWidget(int handle)
    
 inthelpProc(int inControl, int inGlobalMouse, int inRequest, int outContentProvided, int ioHelpContent)
    
 inthitTestProc(int browser, int item, int property, int theRect, int mouseRect)
    
protected  voidinit()
     Initializes any internal resources needed by the device.
 voidinitializeCallbacks()
    
 voidinitializeFonts()
    
 voidinitializeInsets()
    
 voidinitializeWidgetTable()
    
public  voidinternal_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  intinternal_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  booleanisValidClass(Class clazz)
    
 booleanisValidThread()
    
 intitemCompareProc(int browser, int itemOne, int itemTwo, int sortProperty)
    
 intitemDataProc(int browser, int item, int property, int itemData, int setValue)
    
 intitemNotificationProc(int browser, int item, int message)
    
 intkeyboardProc(int nextHandler, int theEvent, int userData)
    
public  Pointmap(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  Pointmap(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  Rectanglemap(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  Rectanglemap(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.

 intmenuProc(int nextHandler, int theEvent, int userData)
    
 intmouseHoverProc(int id, int handle)
    
 intmouseProc(int nextHandler, int theEvent, int userData)
    
 intobserverProc(int observer, int activity, int info)
    
public  booleanpost(Event event)
     Generate a low level system event. post is used to generate low level keyboard and mouse events.
 voidpostEvent(Event event)
    
public  booleanreadAndDispatch()
     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.
 intreadImageRef(int path)
    
static  voidregister(Display display)
    
protected  voidrelease()
     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.

 intreleaseDataProc(int info, int data, int size)
    
 voidreleaseDisplay()
    
public  voidremoveFilter(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  voidremoveListener(int eventType, Listener listener)
     Removes the listener from the collection of listeners who will be notified when an event of the given type occurs.
 voidremoveMenu(Menu menu)
    
 voidremovePopup(Menu menu)
    
 WidgetremoveWidget(int handle)
    
 booleanrunAsyncMessages(boolean all)
    
 booleanrunDeferredEvents()
    
 booleanrunEnterExit()
    
 booleanrunEventLoopTimers()
    
 booleanrunPaint()
    
 booleanrunPopups()
    
 booleanrunSettings()
    
 booleanrunTimers()
    
 intsearchProc(int nextHandler, int theEvent, int userData)
    
 voidsendEvent(int eventType, Event event)
    
public static  voidsetAppName(String name)
     On platforms which support it, sets the application name to be the argument.
 voidsetCurrentCaret(Caret caret)
    
 voidsetCursor(int cursor)
    
public  voidsetCursorLocation(int x, int y)
     Sets the location of the on-screen pointer relative to the top left corner of the screen.
public  voidsetCursorLocation(Point point)
     Sets the location of the on-screen pointer relative to the top left corner of the screen.
public  voidsetData(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  voidsetData(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  voidsetDevice(Device device)
    
 voidsetMenuBar(Menu menu)
    
public  voidsetSynchronizer(Synchronizer synchronizer)
     Sets the synchronizer used by the display to be the argument, which can not be null.
public  booleansleep()
     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.
 intsourceProc(int info)
    
public  voidsyncExec(Runnable runnable)
     Causes the run() method of the runnable to be invoked by the user-interface thread at the next reasonable opportunity.
 inttextInputProc(int nextHandler, int theEvent, int userData)
    
public  voidtimerExec(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.
 inttimerProc(int id, int index)
    
 inttrackingProc(int browser, int itemID, int property, int theRect, int startPt, int modifiers)
    
static  inttranslateKey(int key)
    
 inttrayItemProc(int target, int userData, int selector, int event)
    
static  intuntranslateKey(int key)
    
public  voidupdate()
     Forces all outstanding paint requests for the display to be processed before this method returns.
 voidupdateQuitMenu()
    
public  voidwake()
     If the receiver's user-interface thread was sleeping, causes it to be awakened and start running again.
 voidwakeThread()
    
 intwindowProc(int nextHandler, int theEvent, int userData)
    

Field Detail
ADD_WIDGET_KEY
final static String ADD_WIDGET_KEY(Code)



APP_NAME
static String APP_NAME(Code)



Default
static Display Default(Code)



Displays
static Display[] Displays(Code)



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)



PACKAGE_PREFIX
final static String PACKAGE_PREFIX(Code)



SWT0
final static int SWT0(Code)



actionCallbackappleEventCallbackclockCallbackcommandCallbackcontrolCallbackaccessibilityCallbackappearanceCallback
Callback actionCallbackappleEventCallbackclockCallbackcommandCallbackcontrolCallbackaccessibilityCallbackappearanceCallback(Code)



actionProcappleEventProcclockProccommandProccontrolProcappearanceProcaccessibilityProc
int actionProcappleEventProcclockProccommandProccontrolProcappearanceProcaccessibilityProc(Code)



activeShell
Shell activeShell(Code)



allowTimers
boolean allowTimers(Code)



buttonInsettabFolderNorthInsettabFolderSouthInsetcomboInseteditTextInsetsearchTextInset
Rect buttonInsettabFolderNorthInsettabFolderSouthInsetcomboInseteditTextInsetsearchTextInset(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)



data
Object data(Code)



disposeList
Runnable[] disposeList(Code)



disposeWindow
int disposeWindow(Code)



disposeWindowList
int[] disposeWindowList(Code)



disposing
boolean disposing(Code)



dockImage
int dockImage(Code)



dragButtondragXdragYdragStatedragModifiers
int dragButtondragXdragYdragStatedragModifiers(Code)



dragging
boolean dragging(Code)



drawItemCallbackitemDataCallbackitemNotificationCallbackitemCompareCallbacksearchCallbacktrayItemCallback
Callback drawItemCallbackitemDataCallbackitemNotificationCallbackitemCompareCallbacksearchCallbacktrayItemCallback(Code)



drawItemProcitemDataProcitemNotificationProcitemCompareProchelpProcsearchProctrayItemProc
int drawItemProcitemDataProcitemNotificationProcitemCompareProchelpProcsearchProctrayItemProc(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)



freeSlot
int freeSlot(Code)



gcWindow
int gcWindow(Code)



grabControl
Control grabControl(Code)



helpString
int helpString(Code)



helpWidget
Widget helpWidget(Code)



highlightColor
RGBColor highlightColor(Code)



hitTestCallbackkeyboardCallbackmenuCallbackmouseHoverCallbackhelpCallbackobserverCallbacksourceCallback
Callback hitTestCallbackkeyboardCallbackmenuCallbackmouseHoverCallbackhelpCallbackobserverCallbacksourceCallback(Code)



hitTestProckeyboardProcmenuProcmouseHoverProcobserverProcsourceProc
int hitTestProckeyboardProcmenuProcmouseHoverProcobserverProcsourceProc(Code)



ignoreFocus
boolean ignoreFocus(Code)



inPaintneedsPaint
boolean inPaintneedsPaint(Code)



indexTableproperty
int[] indexTableproperty(Code)



kchrPtr
int kchrPtr(Code)



kchrState
int[] kchrState(Code)



keys
String[] keys(Code)



lastHelpXlastHelpY
int lastHelpXlastHelpY(Code)



menuBar
Menu menuBar(Code)



menuspopups
Menu[] menuspopups(Code)



mouseCallbacktrackingCallbackwindowCallbackcolorCallbacktextInputCallbackreleaseCallbackcoreEventCallback
Callback mouseCallbacktrackingCallbackwindowCallbackcolorCallbacktextInputCallbackreleaseCallbackcoreEventCallback(Code)



mouseHoverID
int mouseHoverID(Code)



mouseMoved
boolean mouseMoved(Code)



mouseProctrackingProcwindowProccolorProctextInputProcreleaseProccoreEventProc
int mouseProctrackingProcwindowProccolorProctextInputProcreleaseProccoreEventProc(Code)



queuerunLooprunLoopSourcerunLoopObserverlastModifierslastStatelastXlastY
int queuerunLooprunLoopSourcerunLoopObserverlastModifierslastStatelastXlastY(Code)



runAsyncMessages
boolean runAsyncMessages(Code)



runSettings
boolean runSettings(Code)



smallFonts
boolean smallFonts(Code)



synchronizer
Synchronizer synchronizer(Code)



thread
Thread thread(Code)



timerCallback
Callback timerCallback(Code)



timerIds
int[] timerIds(Code)



timerList
Runnable[] timerList(Code)



timerProc
int timerProc(Code)



tray
Tray tray(Code)



values
Object[] values(Code)



widgetTable
Widget[] widgetTable(Code)




Constructor Detail
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




Method Detail
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)



addWidget
void addWidget(int handle, Widget widget)(Code)



appearanceProc
int appearanceProc(int theAppleEvent, int reply, int handlerRefcon)(Code)



appleEventProc
int appleEventProc(int nextHandler, int theEvent, int userData)(Code)



ascii
static byte[] ascii(String name)(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 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)



clockProc
int clockProc(int nextHandler, int theEvent, int userData)(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)



convertToLf
static String convertToLf(String text)(Code)



coreEventProc
int coreEventProc(int theAppleEvent, int reply, int handlerRefcon)(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 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)



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 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



findWidget
public Widget findWidget(Widget widget, int id)(Code)
Given a widget and a widget-specific id, returns the instance of the Widget subclass which represents the widget/id pair in the currently running application, if such exists, or null if no matching widget can be found.
Parameters:
  widget - the widget
Parameters:
  id - the id for the subwidget (usually an item) the SWT subwidget (usually an item) that the widget/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.3



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 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 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, boolean disabled)(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



getSynchronizer
public Synchronizer getSynchronizer()(Code)
Gets the synchronizer used by the display. the receiver's synchronizer
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.4



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



getWidget
Widget getWidget(int handle)(Code)



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)



observerProc
int observerProc(int observer, int activity, int info)(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)



register
static void register(Display display)(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



releaseDataProc
int releaseDataProc(int info, int data, int size)(Code)



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)



removeWidget
Widget removeWidget(int handle)(Code)



runAsyncMessages
boolean runAsyncMessages(boolean all)(Code)



runDeferredEvents
boolean runDeferredEvents()(Code)



runEnterExit
boolean runEnterExit()(Code)



runEventLoopTimers
boolean runEventLoopTimers()(Code)



runPaint
boolean runPaint()(Code)



runPopups
boolean runPopups()(Code)



runSettings
boolean runSettings()(Code)



runTimers
boolean runTimers()(Code)



searchProc
int searchProc(int nextHandler, int theEvent, int userData)(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



sourceProc
int sourceProc(int info)(Code)



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 occurred 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)



trayItemProc
int trayItemProc(int target, int userData, int selector, int event)(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 sleeping, 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)



Fields inherited from org.eclipse.swt.graphics.Device
protected static Device CurrentDevice(Code)(Java Doc)
public static boolean DEBUG(Code)(Java Doc)
protected static Runnable DeviceFinder(Code)(Java Doc)

Methods inherited from org.eclipse.swt.graphics.Device
protected void checkDevice()(Code)(Java Doc)
protected void create(DeviceData data)(Code)(Java Doc)
protected void destroy()(Code)(Java Doc)
public void dispose()(Code)(Java Doc)
public Rectangle getBounds()(Code)(Java Doc)
public Rectangle getClientArea()(Code)(Java Doc)
public Point getDPI()(Code)(Java Doc)
public int getDepth()(Code)(Java Doc)
public DeviceData getDeviceData()(Code)(Java Doc)
public FontData[] getFontList(String faceName, boolean scalable)(Code)(Java Doc)
public Color getSystemColor(int id)(Code)(Java Doc)
public Font getSystemFont()(Code)(Java Doc)
public boolean getWarnings()(Code)(Java Doc)
protected void init()(Code)(Java Doc)
abstract public void internal_dispose_GC(int handle, GCData data)(Code)(Java Doc)
abstract public int internal_new_GC(GCData data)(Code)(Java Doc)
public boolean isDisposed()(Code)(Java Doc)
public boolean loadFont(String path)(Code)(Java Doc)
protected void release()(Code)(Java Doc)
public void setWarnings(boolean warnings)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.