Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/eclipse/swt/SWT.java


1   /*******************************************************************************
2    * Copyright (c) 2000, 2004 IBM Corporation and others.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Common Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/cpl-v10.html
7    * 
8    * Contributors:
9    *     IBM Corporation - initial API and implementation
10   *******************************************************************************/
11  package org.eclipse.swt;
12  
13  
14  import org.eclipse.swt.internal.*;
15  
16  /**
17   * This class provides access to a small number of SWT system-wide
18   * methods, and in addition defines the public constants provided
19   * by SWT.
20   * <p>
21   * By defining constants like UP and DOWN in a single class, SWT
22   * can share common names and concepts at the same time minimizing
23   * the number of classes, names and constants for the application
24   * programmer.
25   * </p><p>
26   * Note that some of the constants provided by this class represent
27   * optional, appearance related aspects of widgets which are available
28   * either only on some window systems, or for a differing set of
29   * widgets on each window system. These constants are marked
30   * as <em>HINT</em>s. The set of widgets which support a particular
31   * <em>HINT</em> may change from release to release, although we typically
32   * will not withdraw support for a <em>HINT</em> once it is made available.
33   * </p>
34   */
35   
36  /* NOTE:
37   *   Good javadoc coding style is to put the values of static final 
38   *   constants in the comments. This reinforces the fact that
39   *   consumers are allowed to rely on the value (and they must
40   *   since the values are compiled inline in their code). We
41   *   can <em>not</em> change the values of these constants between
42   *   releases.
43   */
44  public class SWT {
45    
46    /* Initialize the class */
47  //  static {
48  //    /* NOTE: the static initialization is at the end of file */
49  //  }
50    
51    /* Widget Event Constants */
52    
53    /**
54     * The null event type (value is 0).
55     * 
56     * @since 3.0
57     */
58    public static final int None = 0;
59    
60    /**
61     * The key down event type (value is 1).
62     */
63    public static final int KeyDown = 1;
64    
65    /**
66     * The key up event type (value is 2).
67     */
68    public static final int KeyUp = 2;
69    
70    /**
71     * mouse down event type (value is 3)
72     */
73    public static final int MouseDown = 3;
74    
75    /**
76     * The mouse up event type (value is 4).
77     */
78    public static final int MouseUp = 4;
79    
80    /**
81     * The mouse move event type (value is 5).
82     */
83    public static final int MouseMove = 5;
84    
85    /**
86     * The mouse enter event type (value is 6).
87     */
88    public static final int MouseEnter = 6;    
89    
90    /**
91     * The mouse exit event type (value is 7).
92     */
93    public static final int MouseExit = 7;
94    
95    /**
96     * The mouse double click event type (value is 8).
97     */
98    public static final int MouseDoubleClick = 8;  
99    
100   /**
101    * The paint event type (value is 9).
102    */
103   public static final int Paint = 9;  
104   
105   /**
106    * The move event type (value is 10).
107    */
108   public static final int Move = 10;
109   
110   /**
111    * The resize event type (value is 11).
112    */
113   public static final int Resize = 11;
114   
115   /**
116    * The dispose event type (value is 12).
117    */
118   public static final int Dispose = 12;
119   
120   /**
121    * The selection event type (value is 13).
122    */
123   public static final int Selection = 13;
124   
125   /**
126    * The default selection event type (value is 14).
127    */
128   public static final int DefaultSelection = 14;
129   
130   /**
131    * The focus in event type (value is 15).
132    */
133   public static final int FocusIn = 15;
134   
135   /**
136    * The focus out event type (value is 16).
137    */
138   public static final int FocusOut = 16;
139   
140   /**
141    * The expand event type (value is 17).
142    */
143   public static final int Expand = 17;
144   
145   /**
146    * The collapse event type (value is 18).
147    */
148   public static final int Collapse = 18;
149   
150   /**
151    * The iconify event type (value is 19).
152    */
153   public static final int Iconify = 19;
154   
155   /**
156    * The de-iconify event type (value is 20).
157    */
158   public static final int Deiconify = 20;
159   
160   /**
161    * The close event type (value is 21).
162    */
163   public static final int Close = 21;
164   
165   /**
166    * The show event type (value is 22).
167    */
168   public static final int Show = 22;
169   
170   /**
171    * The hide event type (value is 23).
172    */
173   public static final int Hide = 23;
174   
175   /**
176    * The modify event type (value is 24).
177    */
178   public static final int Modify = 24;
179   
180   /**
181    * The verify event type (value is 25).
182    */
183   public static final int Verify = 25;
184   
185   /**
186    * The activate event type (value is 26).
187    */
188   public static final int Activate = 26;
189   
190   /**
191    * The deactivate event type (value is 27).
192    */
193   public static final int Deactivate = 27;  
194   
195   /**
196    * The help event type (value is 28).
197    */
198   public static final int Help = 28;
199   
200   /**
201    * The drag detect event type (value is 29).
202    */
203   public static final int DragDetect = 29;
204   
205   /**
206    * The arm event type (value is 30).
207    */
208   public static final int Arm = 30;
209   
210   /**
211    * The traverse event type (value is 31).
212    */
213   public static final int Traverse = 31;
214   
215   /**
216    * The mouse hover event type (value is 32).
217    */
218   public static final int MouseHover = 32;
219 
220   /**
221    * The hardware key down event type (value is 33).
222    */
223   public static final int HardKeyDown = 33;
224   
225   /**
226    * The hardware key up event type (value is 34).
227    */
228   public static final int HardKeyUp = 34;
229 
230   /**
231    * The menu detect event type (value is 35).
232    * 
233    * @since 3.0
234    */
235   public static final int MenuDetect = 35;
236   
237   /**
238    * The set data event type (value is 36).
239    * 
240    * @since 3.0
241    */
242   public static final int SetData = 36;
243     
244   /* Event Details */
245   
246   /**
247    * A constant known to be zero (0), used in operations which
248    * take bit flags to indicate that "no bits are set".
249    */
250   public static final int NONE = 0;
251   
252   /**
253    * Indicates that a user-interface component is being dragged,
254    * for example dragging the thumb of a scroll bar (value is 1).
255    */
256   public static final int DRAG = 1;
257   
258   /**
259    * A constant known to be zero (0), used in operations which
260    * take pointers to indicate a null argument.
261    */
262   public static final int NULL = 0;
263   
264   /**
265    * Indicates that a default should be used (value is -1).
266    */
267   public static final int DEFAULT = -1;
268 
269   /**
270    * Style constant for menu bar behavior (value is 1&lt;&lt;1).
271    * <p><b>Used By:</b><ul>
272    * <li><code>Menu</code></li>
273    * </ul></p>
274    */
275   public static final int BAR = 1 << 1;
276 
277   /**
278    * Style constant for drop down menu/list behavior (value is 1&lt;&lt;2).
279    * <p><b>Used By:</b><ul>
280    * <li><code>Menu</code></li>
281    * <li><code>ToolItem</code></li>
282    * <li><code>CoolItem</code></li>
283    * <li><code>Combo</code></li>
284    * </ul></p>
285    */
286   public static final int DROP_DOWN = 1 << 2;
287 
288   /**
289    * Style constant for pop up menu behavior (value is 1&lt;&lt;3).
290    * <p><b>Used By:</b><ul>
291    * <li><code>Menu</code></li>
292    * </ul></p>
293    */
294   public static final int POP_UP = 1 << 3;
295 
296   /**
297    * Style constant for line separator behavior (value is 1&lt;&lt;1).
298    * <p><b>Used By:</b><ul>
299    * <li><code>Label</code></li>
300    * <li><code>MenuItem</code></li>
301    * <li><code>ToolItem</code></li>
302    * </ul></p>
303    */
304   public static final int SEPARATOR = 1 << 1;
305 
306   /**
307    * Style constant for toggle button behavior (value is 1&lt;&lt;1).
308    * <p><b>Used By:</b><ul>
309    * <li><code>Button</code></li>
310    * </ul></p>
311    */
312   public static final int TOGGLE = 1 << 1;
313 
314   /**
315    * Style constant for arrow button behavior (value is 1&lt;&lt;2).
316    * <p><b>Used By:</b><ul>
317    * <li><code>Button</code></li>
318    * </ul></p>
319    */
320   public static final int ARROW = 1 << 2;
321 
322   /**
323    * Style constant for push button behavior (value is 1&lt;&lt;3).
324    * <p><b>Used By:</b><ul>
325    * <li><code>Button</code></li>
326    * <li><code>MenuItem</code></li>
327    * <li><code>ToolItem</code></li>
328    * </ul></p>
329    */
330   public static final int PUSH = 1 << 3;
331 
332   /**
333    * Style constant for radio button behavior (value is 1&lt;&lt;4).
334    * <p><b>Used By:</b><ul>
335    * <li><code>Button</code></li>
336    * <li><code>MenuItem</code></li>
337    * <li><code>ToolItem</code></li>
338    * </ul></p>
339    */
340   public static final int RADIO = 1 << 4;
341 
342   /**
343    * Style constant for check box behavior (value is 1&lt;&lt;5).
344    * <p><b>Used By:</b><ul>
345    * <li><code>Button</code></li>
346    * <li><code>MenuItem</code></li>
347    * <li><code>ToolItem</code></li>
348    * <li><code>Table</code></li>
349    * <li><code>Tree</code></li>
350    * </ul></p>
351    */
352   public static final int CHECK = 1 << 5;
353 
354   /**
355    * Style constant for cascade behavior (value is 1&lt;&lt;6).
356    * <p><b>Used By:</b><ul>
357    * <li><code>MenuItem</code></li>
358    * </ul></p>
359    */
360   public static final int CASCADE = 1 << 6;
361 
362   /**
363    * Style constant for multi-selection behavior in lists
364    * and multiple line support on text fields (value is 1&lt;&lt;1).
365    * <p><b>Used By:</b><ul>
366    * <li><code>Text</code></li>
367    * <li><code>List</code></li>
368    * <li><code>FileDialog</code></li>
369    * </ul></p>
370    */
371   public static final int MULTI = 1 << 1;
372 
373   /**
374    * Style constant for single selection behavior in lists
375    * and single line support on text fields (value is 1&lt;&lt;2).
376    * <p><b>Used By:</b><ul>
377    * <li><code>Text</code></li>
378    * <li><code>List</code></li>
379    * <li><code>Table</code></li>
380    * <li><code>Tree</code></li>
381    * </ul></p>
382    */
383   public static final int SINGLE = 1 << 2;
384 
385   /**
386    * Style constant for read-only behavior (value is 1&lt;&lt;3).
387    * <p><b>Used By:</b><ul>
388    * <li><code>Combo</code></li>
389    * <li><code>Text</code></li>
390    * </ul></p>
391    */
392   public static final int READ_ONLY = 1 << 3;
393 
394   /**
395    * Style constant for automatic line wrap behavior (value is 1&lt;&lt;6).
396    * <p><b>Used By:</b><ul>
397    * <li><code>Label</code></li>
398    * <li><code>Text</code></li>
399    * <li><code>ToolBar</code></li>
400    * </ul></p>
401    */
402   public static final int WRAP = 1 << 6;
403 
404   /**
405    * Style constant for simple (not drop down) behavior (value is 1&lt;&lt;6).
406    * <p><b>Used By:</b><ul>
407    * <li><code>Combo</code></li>
408    * </ul></p>
409    */
410   public static final int SIMPLE = 1 << 6;
411 
412   /**
413    * Style constant for password behavior (value is 1&lt;&lt;22).
414    * <p><b>Used By:</b><ul>
415    * <li><code>Text</code></li>
416    * </ul></p>
417    * 
418    * @since 3.0
419    */
420   public static final int PASSWORD = 1 << 22;
421   
422   /**
423    * Style constant for shadow in behavior (value is 1&lt;&lt;2).
424    * <br>Note that this is a <em>HINT</em>.
425    * <p><b>Used By:</b><ul>
426    * <li><code>Label</code></li>
427    * <li><code>Group</code></li>
428    * </ul></p>
429    */
430   public static final int SHADOW_IN = 1 << 2;
431 
432   /**
433    * Style constant for shadow out behavior (value is 1&lt;&lt;3).
434    * <br>Note that this is a <em>HINT</em>.
435    * <p><b>Used By:</b><ul>
436    * <li><code>Label</code></li>
437    * <li><code>Group</code></li>
438    * <li><code>ToolBar</code></li>
439    * </ul></p>
440    */
441   public static final int SHADOW_OUT = 1 << 3;
442 
443   /**
444    * Style constant for shadow etched in behavior (value is 1&lt;&lt;4).
445    * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
446    * <p><b>Used By:</b><ul>
447    * <li><code>Group</code></li>
448    * </ul></p>
449    */
450   public static final int SHADOW_ETCHED_IN = 1 << 4;
451 
452   /**
453    * Style constant for shadow etched out behavior (value is 1&lt;&lt;6).
454    * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
455    * <p><b>Used By:</b><ul>
456    * <li><code>Group</code></li>
457    * </ul></p>
458    */
459   public static final int SHADOW_ETCHED_OUT = 1 << 6;
460 
461   /**
462    * Style constant for no shadow behavior (value is 1&lt;&lt;5).
463    * <br>Note that this is a <em>HINT</em>.
464    * <p><b>Used By:</b><ul>
465    * <li><code>Label</code></li>
466    * <li><code>Group</code></li>
467    * </ul></p>
468    */
469   public static final int SHADOW_NONE = 1 << 5;
470 
471   /**
472    * Style constant for progress bar behavior (value is 1&lt;&lt;1).
473    * <p><b>Used By:</b><ul>
474    * <li><code>ProgressBar</code></li>
475    * </ul></p>
476    */
477   public static final int INDETERMINATE = 1 << 1;
478   
479   /**
480    * Style constant for tool window behavior (value is 1&lt;&lt;2).
481    * <p>
482    * A tool window is a window intended to be used as a floating toolbar.
483    * It typically has a title bar that is shorter than a normal title bar,
484    * and the window title is typically drawn using a smaller font.
485    * <br>Note that this is a <em>HINT</em>.
486    * </p><p><b>Used By:</b><ul>
487    * <li><code>Decorations</code> and subclasses</li>
488    * </ul></p>
489    */
490   public static final int TOOL = 1 << 2; 
491 
492   /**
493    * Style constant to ensure no trimmings are used (value is 1&lt;&lt;3).
494    * <br>Note that this overrides all other trim styles.
495    * <p><b>Used By:</b><ul>
496    * <li><code>Decorations</code> and subclasses</li>
497    * </ul></p>
498    */
499   public static final int NO_TRIM = 1 << 3;
500   
501   /**
502    * Style constant for resize box trim (value is 1&lt;&lt;4).
503    * <p><b>Used By:</b><ul>
504    * <li><code>Decorations</code> and subclasses</li>
505    * <li><code>Tracker</code></li>
506    * </ul></p>
507    */
508   public static final int RESIZE = 1 << 4;
509 
510   /**
511    * Style constant for title area trim (value is 1&lt;&lt;5).
512    * <p><b>Used By:</b><ul>
513    * <li><code>Decorations</code> and subclasses</li>
514    * </ul></p>
515    */
516   public static final int TITLE = 1 << 5;
517 
518   /**
519    * Style constant for close box trim (value is 1&lt;&lt;6,
520    * since we do not distinguish between CLOSE style and MENU style).
521    * <p><b>Used By:</b><ul>
522    * <li><code>Decorations</code> and subclasses</li>
523    * </ul></p>
524    */
525   public static final int CLOSE = 1 << 6;
526 
527   /**
528    * Style constant for shell menu trim (value is 1&lt;&lt;6,
529    * since we do not distinguish between CLOSE style and MENU style).
530    * <p><b>Used By:</b><ul>
531    * <li><code>Decorations</code> and subclasses</li>
532    * </ul></p>
533    */
534   public static final int MENU = CLOSE;
535 
536   /**
537    * Style constant for minimize box trim (value is 1&lt;&lt;7).
538    * <p><b>Used By:</b><ul>
539    * <li><code>Decorations</code> and subclasses</li>
540    * </ul></p>
541    */
542   public static final int MIN = 1 << 7;
543 
544   /**
545    * Style constant for maximize box trim (value is 1&lt;&lt;10).
546    * <p><b>Used By:</b><ul>
547    * <li><code>Decorations</code> and subclasses</li>
548    * </ul></p>
549    */
550   public static final int MAX = 1 << 10;
551 
552   /**
553    * Style constant for horizontal scrollbar behavior (value is 1&lt;&lt;8).
554    * <p><b>Used By:</b><ul>
555    * <li><code>Scrollable</code> and subclasses</li>
556    * </ul></p>
557    */
558   public static final int H_SCROLL = 1 << 8;
559 
560   /**
561    * Style constant for vertical scrollbar behavior (value is 1&lt;&lt;9).
562    * <p><b>Used By:</b><ul>
563    * <li><code>Scrollable</code> and subclasses</li>
564    * </ul></p>
565    */
566   public static final int V_SCROLL = 1 << 9;
567 
568   /**
569    * Style constant for bordered behavior (value is 1&lt;&lt;11).
570    * <br>Note that this is a <em>HINT</em>.
571    * <p><b>Used By:</b><ul>
572    * <li><code>Control</code> and subclasses</li>
573    * </ul></p>
574    */
575   public static final int BORDER = 1 << 11;
576 
577   /**
578    * Style constant indicating that the window manager should clip
579    * a widget's children with respect to its viewable area. (value is 1&lt;&lt;12).
580    * <br>Note that this is a <em>HINT</em>.
581    * <p><b>Used By:</b><ul>
582    * <li><code>Control</code> and subclasses</li>
583    * </ul></p>
584    */
585   public static final int CLIP_CHILDREN = 1 << 12; 
586 
587   /**
588    * Style constant indicating that the window manager should clip
589    * a widget's siblings with respect to its viewable area. (value is 1&lt;&lt;13).
590    * <br>Note that this is a <em>HINT</em>.
591    * <p><b>Used By:</b><ul>
592    * <li><code>Control</code> and subclasses</li>
593    * </ul></p>
594    */
595   public static final int CLIP_SIBLINGS = 1 << 13;
596 
597   /**
598    * Style constant for always on top behavior (value is 1&lt;&lt;14).
599    * <br>Note that this is a <em>HINT</em>.
600    * <p><b>Used By:</b><ul>
601    * <li><code>Shell</code> and subclasses</li>
602    * </ul></p>
603    */
604   public static final int ON_TOP = 1 << 14;
605 
606   /**
607    * Trim style convenience constant for the most common top level shell appearance
608    * (value is CLOSE|TITLE|MIN|MAX|RESIZE).
609    * <p><b>Used By:</b><ul>
610    * <li><code>Shell</code></li>
611    * </ul></p>
612    */
613   public static final int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE;
614 
615   /**
616    * Trim style convenience constant for the most common dialog shell appearance
617    * (value is CLOSE|TITLE|BORDER).
618    * <p><b>Used By:</b><ul>
619    * <li><code>Shell</code></li>
620    * </ul></p>
621    */
622   public static final int DIALOG_TRIM = TITLE | CLOSE | BORDER;
623 
624   /**
625    * Style constant for modeless behavior (value is 0).
626    * <br>Note that this is a <em>HINT</em>.
627    * <p><b>Used By:</b><ul>
628    * <li><code>Dialog</code></li>
629    * <li><code>Shell</code></li>
630    * </ul></p>
631    */
632   public static final int MODELESS = 0;
633 
634   /**
635    * Style constant for primary modal behavior (value is 1&lt;&lt;15).
636    * <br>Note that this is a <em>HINT</em>.
637    * <p><b>Used By:</b><ul>
638    * <li><code>Dialog</code></li>
639    * <li><code>Shell</code></li>
640    * </ul></p>
641    */
642   public static final int PRIMARY_MODAL = 1 << 15;
643 
644   /**
645    * Style constant for application modal behavior (value is 1&lt;&lt;16).
646    * <br>Note that this is a <em>HINT</em>.
647    * <p><b>Used By:</b><ul>
648    * <li><code>Dialog</code></li>
649    * <li><code>Shell</code></li>
650    * </ul></p>
651    */
652   public static final int APPLICATION_MODAL = 1 << 16;
653 
654   /**
655    * Style constant for system modal behavior (value is 1&lt;&lt;17).
656    * <br>Note that this is a <em>HINT</em>.
657    * <p><b>Used By:</b><ul>
658    * <li><code>Dialog</code></li>
659    * <li><code>Shell</code></li>
660    * </ul></p>
661    */
662   public static final int SYSTEM_MODAL = 1 << 17;
663 
664   /**
665    * Style constant for selection hiding behavior when the widget loses focus (value is 1&lt;&lt;15).
666    * <br>Note that this is a <em>HINT</em>.
667    * <p><b>Used By:</b><ul>
668    * <li><code>Table</code></li>
669    * </ul></p>
670    */
671   public static final int HIDE_SELECTION = 1 << 15;
672 
673   /**
674    * Style constant for full row selection behavior. (value is 1&lt;&lt;16).
675    * <br>Note that this is a <em>HINT</em>.
676    * <p><b>Used By:</b><ul>
677    * <li><code>StyledText</code></li>
678    * <li><code>Table</code></li>
679    * <li><code>TableTree</code></li>
680    * </ul></p>
681    */
682   public static final int FULL_SELECTION = 1 << 16;
683 
684   /**
685    * Style constant for flat appearance. (value is 1&lt;&lt;23).
686    * <br>Note that this is a <em>HINT</em>.
687    * <p><b>Used By:</b><ul>
688    * <li><code>Button</code></li>
689    * <li><code>ToolBar</code></li>
690    * </ul></p>
691    */
692   public static final int FLAT = 1 << 23;
693 
694   /**
695    * Style constant for flat appearance. (value is 1&lt;&lt;16).
696    * <br>Note that this is a <em>HINT</em>.
697    * <p><b>Used By:</b><ul>
698    * <li><code>ProgressBar</code></li>
699    * </ul></p>
700    */
701   public static final int SMOOTH = 1 << 16;
702 
703   /**
704    * Style constant for no background behavior (value is 1&lt;&lt;18).
705    * <p>
706    * By default, before a widget paints, the client area is filled with the current background color.
707    * When this style is specified, the background is not filled, and the application is responsible
708    * for filling every pixel of the client area.
709    * This style might be used as an alternative to "double-buffering" in order to reduce flicker.
710    * This style does not mean "transparent" - widgets that are obscured will not draw through.
711    * </p><p><b>Used By:</b><ul>
712    * <li><code>Composite</code></li>
713    * </ul></p>
714    */
715   public static final int NO_BACKGROUND = 1 << 18;
716 
717   /**
718    * Style constant for does not take focus behavior (value is 1&lt;&lt;19).
719    * <br>Note that this is a <em>HINT</em>.
720    * <p><b>Used By:</b><ul>
721    * <li><code>Composite</code></li>
722    * </ul></p>
723    */
724   public static final int NO_FOCUS = 1 << 19;
725 
726   /**
727    * Style constant for no redraw on resize behavior (value is 1&lt;&lt;20).
728    * <p>
729    * This style stops the entire client area from being invalidated when the size
730    * of the Canvas changes. Specifically, when the size of the Canvas gets smaller,
731    * the SWT.Paint event is not sent. When it gets bigger, an SWT.Paint event is
732    * sent with a GC clipped to only the new areas to be painted. Without this
733    * style, the entire client area will be repainted.
734    * </p><p><b>Used By:</b><ul>
735    * <li><code>Composite</code></li>
736    * </ul></p>
737    */
738   public static final int NO_REDRAW_RESIZE = 1 << 20;
739 
740   /**
741    * Style constant for no paint event merging behavior (value is 1&lt;&lt;21).
742    * <p><b>Used By:</b><ul>
743    * <li><code>Composite</code></li>
744    * </ul></p>
745    */
746   public static final int NO_MERGE_PAINTS = 1 << 21;
747 
748   /**
749    * Style constant for preventing child radio group behavior (value is 1&lt;&lt;22).
750    * <p><b>Used By:</b><ul>
751    * <li><code>Composite</code></li>
752    * </ul></p>
753    */
754   public static final int NO_RADIO_GROUP = 1 << 22;
755   
756   /**
757    * Style constant for left to right orientation (value is 1&lt;&lt;25).
758    * <p>
759    * When orientation is not explicitly specified, orientation is
760    * inherited.  This means that children will be assigned the
761    * orientation of their parent.  To override this behavior and
762    * force an orientation for a child, explicitly set the orientation
763    * of the child when that child is created.
764    * </p>
765    * <p><b>Used By:</b><ul>
766    * <li><code>Control</code></li>
767    * <li><code>Menu</code></li>
768    * <li><code>GC</code></li> 
769    * </ul></p>
770    * 
771    * @since 2.1.2
772    */
773   public static final int LEFT_TO_RIGHT = 1 << 25;
774   
775   /**
776    * Style constant for right to left orientation (value is 1&lt;&lt;26).
777    * <p>
778    * When orientation is not explicitly specified, orientation is
779    * inherited.  This means that children will be assigned the
780    * orientation of their parent.  To override this behavior and
781    * force an orientation for a child, explicitly set the orientation
782    * of the child when that child is created.
783    * </p>
784    * <p><b>Used By:</b><ul>
785    * <li><code>Control</code></li>
786    * <li><code>Menu</code></li>
787    * <li><code>GC</code></li> 
788    * </ul></p>
789    * 
790    * @since 2.1.2
791    */
792   public static final int RIGHT_TO_LEFT = 1 << 26;
793   
794   /**
795    * Style constant to indicate coordinate mirroring (value is 1&lt;&lt;27).
796    * <p><b>Used By:</b><ul>
797    * <li><code>Control</code></li>
798    * <li><code>Menu</code></li>
799    * </ul></p>
800    * 
801    * @since 2.1.2
802    */
803   public static final int MIRRORED = 1 << 27;
804   
805   /**
806    * Style constant to allow embedding (value is 1&lt;&lt;24).
807    * <p><b>Used By:</b><ul>
808    * <li><code>Composite</code></li>
809    * </ul></p>
810    * 
811    * @since 3.0
812    */
813   public static final int EMBEDDED = 1 << 24;
814   
815   /**
816    * Style constant to allow virtual data (value is 1&lt;&lt;28).
817    * <p><b>Used By:</b><ul>
818    * <li><code>Table</code></li>
819    * </ul></p>
820    * 
821    * @since 3.0
822    */
823   public static final int VIRTUAL = 1 << 28;
824 
825   /**
826    * Style constant for align up behavior (value is 1&lt;&lt;7,
827    * since align UP and align TOP are considered the same).
828    * <p><b>Used By:</b><ul>
829    * <li><code>Button</code> with <code>ARROW</code> style</li>
830    * <li><code>Tracker</code></li>
831    * </ul></p>
832    */
833   public static final int UP = 1 << 7;
834 
835   /**
836    * Style constant for align top behavior (value is 1&lt;&lt;7,
837    * since align UP and align TOP are considered the same).
838    * <p><b>Used By:</b><ul>
839    * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
840    * </ul></p>
841    */
842   public static final int TOP = UP;
843 
844   /**
845    * Style constant for align down behavior (value is 1&lt;&lt;10,
846    * since align DOWN and align BOTTOM are considered the same).
847    * <p><b>Used By:</b><ul>
848    * <li><code>Button</code> with <code>ARROW</code> style</li>
849    * <li><code>Tracker</code></li>
850    * </ul></p>
851    */
852   public static final int DOWN               = 1 << 10;
853 
854   /**
855    * Style constant for align bottom behavior (value is 1&lt;&lt;10,
856    * since align DOWN and align BOTTOM are considered the same).
857    * <p><b>Used By:</b><ul>
858    * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
859    * </ul></p>
860    */
861   public static final int BOTTOM             = DOWN;
862 
863   /**
864    * Style constant for leading alignment (value is 1&lt;&lt;14).
865    * <p><b>Used By:</b><ul>
866    * <li><code>Button</code></li>
867    * <li><code>Label</code></li>
868    * <li><code>TableColumn</code></li>
869    * <li><code>Tracker</code></li>
870    * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
871    * </ul></p>
872    * 
873    * @since 2.1.2
874    */
875   public static final int LEAD               = 1 << 14;
876   
877   /**
878    * Style constant for align left behavior (value is 1&lt;&lt;14).
879    * This is a synonym for LEAD (value is 1&lt;&lt;14).  Newer
880    * applications should use LEAD instead of LEFT to make code more
881    * understandable on right-to-left platforms.
882    */
883   public static final int LEFT               = LEAD;
884 
885   /**
886    * Style constant for trailiing alignment (value is 1&lt;&lt;17).
887    * <p><b>Used By:</b><ul>
888    * <li><code>Button</code></li>
889    * <li><code>Label</code></li>
890    * <li><code>TableColumn</code></li>
891    * <li><code>Tracker</code></li>
892    * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
893    * </ul></p>
894    * 
895    * @since 2.1.2
896    */
897   public static final int TRAIL              = 1 << 17;
898     
899   /**
900    * Style constant for align right behavior (value is 1&lt;&lt;17).
901    * This is a synonym for TRAIL (value is 1&lt;&lt;14).  Newer
902    * applications should use TRAIL instead of RIGHT to make code more
903    * understandable on right-to-left platforms.
904    */
905   public static final int RIGHT              = TRAIL;
906 
907   /**
908    * Style constant for align center behavior (value is 1&lt;&lt;24).
909    * <p><b>Used By:</b><ul>
910    * <li><code>Button</code></li>
911    * <li><code>Label</code></li>
912    * <li><code>TableColumn</code></li>
913    * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
914    * </ul></p>
915    */
916   public static final int CENTER = 1 << 24;
917 
918   /**
919    * Style constant for horizontal alignment or orientation behavior (value is 1&lt;&lt;8).
920    * <p><b>Used By:</b><ul>
921    * <li><code>Label</code></li>
922    * <li><code>ProgressBar</code></li>
923    * <li><code>Sash</code></li>
924    * <li><code>Scale</code></li>
925    * <li><code>ScrollBar</code></li>
926    * <li><code>Slider</code></li>
927    * <li><code>ToolBar</code></li>
928    * <li><code>FillLayout</code> type</li>
929    * <li><code>RowLayout</code> type</li>
930    * </ul></p>
931    */
932   public static final int HORIZONTAL = 1 << 8;
933 
934   /**
935    * Style constant for vertical alignment or orientation behavior (value is 1&lt;&lt;9).
936    * <p><b>Used By:</b><ul>
937    * <li><code>Label</code></li>
938    * <li><code>ProgressBar</code></li>
939    * <li><code>Sash</code></li>
940    * <li><code>Scale</code></li>
941    * <li><code>ScrollBar</code></li>
942    * <li><code>Slider</code></li>
943    * <li><code>ToolBar</code></li>
944    * <li><code>FillLayout</code> type</li>
945    * <li><code>RowLayout</code> type</li>
946    * </ul></p>
947    */
948   public static final int VERTICAL = 1 << 9;
949 
950   /**
951    * Style constant for vertical alignment or orientation behavior (value is 1).
952    * <p><b>Used By:</b><ul>
953    * <li><code>GridLayout</code> type</li>
954    * </ul></p>
955    */
956   public static final int BEGINNING = 1;
957   
958   /**
959    * Style constant for vertical alignment or orientation behavior (value is 4).
960    * <p><b>Used By:</b><ul>
961    * <li><code>GridLayout</code> type</li>
962    * </ul></p>
963    */
964   public static final int FILL = 4;
965   
966   /**
967    * Input Method Editor style constant for double byte
968    * input behavior (value is 1&lt;&lt;1).
969    */
970   public static final int DBCS = 1 << 1;
971 
972   /**
973    * Input Method Editor style constant for alpha
974    * input behavior (value is 1&lt;&lt;2).
975    */
976   public static final int ALPHA = 1 << 2;
977 
978   /**
979    * Input Method Editor style constant for native
980    * input behavior (value is 1&lt;&lt;3).
981    */
982   public static final int NATIVE = 1 << 3;
983 
984   /**
985    * Input Method Editor style constant for phonetic
986    * input behavior (value is 1&lt;&lt;4).
987    */
988   public static final int PHONETIC = 1 << 4;
989 
990   /**
991    * Input Method Editor style constant for romanicized
992    * input behavior (value is 1&lt;&lt;5).
993    */
994   public static final int ROMAN = 1 << 5;
995 
996   /**
997    * ASCII character convenience constant for the backspace character
998    * (value is the <code>char</code> '\b').
999    */
1000  public static final char BS = '\b';
1001
1002  /**
1003   * ASCII character convenience constant for the carriage return character
1004   * (value is the <code>char</code> '\r').
1005   */
1006  public static final char CR = '\r';
1007
1008  /**
1009   * ASCII character convenience constant for the delete character
1010   * (value is the <code>char</code> with value 127).
1011   */
1012  public static final char DEL = 0x7F;
1013 
1014  /**
1015   * ASCII character convenience constant for the escape character
1016   * (value is the <code>char</code> with value 27).
1017   */
1018  public static final char ESC = 0x1B;
1019
1020  /**
1021   * ASCII character convenience constant for the line feed character
1022   * (value is the <code>char</code> '\n').
1023   */
1024  public static final char LF = '\n';
1025
1026  /**
1027   * ASCII character convenience constant for the tab character
1028   * (value is the <code>char</code> '\t').
1029   * 
1030   * @since 2.1
1031   */
1032  public static final char TAB = '\t';
1033            
1034  /**
1035   * keyboard and/or mouse event mask indicating that the ALT key
1036   * was pushed on the keyboard when the event was generated
1037   * (value is 1&lt;&lt;16).
1038   */
1039  public static final int ALT = 1 << 16;
1040          
1041  /**
1042   * Keyboard and/or mouse event mask indicating that the SHIFT key
1043   * was pushed on the keyboard when the event was generated
1044   * (value is 1&lt;&lt;17).
1045   */
1046  public static final int SHIFT = 1 << 17;
1047          
1048  /**
1049   * Keyboard and/or mouse event mask indicating that the CTRL key
1050   * was pushed on the keyboard when the event was generated
1051   * (value is 1&lt;&lt;18).
1052   */
1053  public static final int CTRL = 1 << 18;
1054
1055  /**
1056   * Keyboard and/or mouse event mask indicating that the CTRL key
1057   * was pushed on the keyboard when the event was generated. This
1058   * is a synonym for CTRL (value is 1&lt;&lt;18).
1059   */
1060  public static final int CONTROL = CTRL;
1061
1062  /**
1063   * Keyboard and/or mouse event mask indicating that the COMMAND key
1064   * was pushed on the keyboard when the event was generated
1065   * (value is 1&lt;&lt;22).
1066   * 
1067   * @since 2.1
1068   */
1069  public static final int COMMAND = 1 << 22;
1070  
1071  /**
1072   * Keyboard and/or mouse event mask indicating all possible
1073   * keyboard modifiers.
1074   * 
1075   * To allow for the future, this mask  is intended to be used in 
1076   * place of code that references  each individual keyboard mask. 
1077   *  For example, the following expression will determine whether 
1078   * any modifer is pressed and will continue to work as new modifier 
1079   * masks are added.
1080   * 
1081    * <code>(stateMask & SWT.MODIFIER_MASK) != 0</code>.
1082   * 
1083   * @since 2.1
1084   */
1085  public static final int MODIFIER_MASK;
1086  
1087  /**
1088   * Keyboard and/or mouse event mask indicating that mouse button one
1089   * was pushed when the event was generated. (value is 1&lt;&lt;19).
1090   */
1091  public static final int BUTTON1 = 1 << 19;
1092
1093  /**
1094   * Keyboard and/or mouse event mask indicating that mouse button two
1095   * was pushed when the event was generated. (value is 1&lt;&lt;20).
1096   */
1097  public static final int BUTTON2 = 1 << 20;
1098
1099  /**
1100   * Keyboard and/or mouse event mask indicating that mouse button three
1101   * was pushed when the event was generated. (value is 1&lt;&lt;21).
1102   */
1103  public static final int BUTTON3 = 1 << 21;
1104
1105  /**
1106   * Keyboard and/or mouse event mask indicating all possible
1107   * mouse buttons.
1108   * 
1109   * To allow for the future, this mask  is intended to be used 
1110   * in place of code that references each individual button mask.  
1111   * For example, the following expression will determine whether
1112   * any button is pressed and will continue to work as new button 
1113   * masks are added.
1114   * 
1115    * <code>(stateMask & SWT.BUTTON_MASK) != 0</code>.
1116   * 
1117   * @since 2.1
1118   */
1119  public static final int BUTTON_MASK;
1120  
1121  /**
1122   * Keyboard and/or mouse event mask indicating that the MOD1 key
1123   * was pushed on the keyboard when the event was generated.
1124   * 
1125   * This is the primary keyboard modifier for the platform.
1126   * 
1127   * @since 2.1
1128   */
1129  public static final int MOD1;
1130  
1131  /**
1132   * Keyboard and/or mouse event mask indicating that the MOD2 key
1133   * was pushed on the keyboard when the event was generated.
1134   * 
1135   * This is the secondary keyboard modifier for the platform.
1136   * 
1137   * @since 2.1
1138   */
1139  public static final int MOD2;
1140
1141  /**
1142   * Keyboard and/or mouse event mask indicating that the MOD3 key
1143   * was pushed on the keyboard when the event was generated.
1144   * 
1145   * @since 2.1
1146   */
1147  public static final int MOD3;
1148
1149  /**
1150   * Keyboard and/or mouse event mask indicating that the MOD4 key
1151   * was pushed on the keyboard when the event was generated.
1152   * 
1153   * @since 2.1
1154   */
1155  public static final int MOD4;
1156  
1157  /**
1158   * Accelerator constant used to differentiate a key code from a
1159   * unicode character.
1160   * 
1161   * If this bit is set, then the key stroke
1162   * portion of an accelerator represents a key code.  If this bit
1163   * is not set, then the key stroke portion of an accelerator is
1164   * a unicode character.
1165   * 
1166   * The following expression is false:
1167   * 
1168   * <code>((SWT.MOD1 | SWT.MOD2 | 'T') & SWT.KEYCODE_BIT) != 0</code>.
1169   * 
1170   * The following expression is true:
1171   * 
1172   * <code>((SWT.MOD3 | SWT.F2) & SWT.KEYCODE_BIT) != 0</code>.
1173   * 
1174   * (value is (1&lt;&lt;24))
1175   * 
1176   * @since 2.1
1177   */  
1178  public static final int KEYCODE_BIT = (1 << 24);
1179
1180  /**
1181   * Accelerator constant used to extract the key stroke portion of
1182   * an accelerator.
1183   * 
1184   * The key stroke may be a key code or a unicode
1185   * value.  If the key stroke is a key code <code>KEYCODE_BIT</code>
1186   * will be set.
1187   * 
1188   * @since 2.1
1189   */  
1190  public static final int KEY_MASK = KEYCODE_BIT + 0xFFFF;
1191  
1192  /**
1193   * Keyboard event constant representing the UP ARROW key
1194   * (value is (1&lt;&lt;24)+1).
1195   */
1196  public static final int ARROW_UP = KEYCODE_BIT + 1;
1197
1198  /**
1199   * Keyboard event constant representing the DOWN ARROW key
1200   * (value is (1&lt;&lt;24)+2).
1201   */
1202  public static final int ARROW_DOWN = KEYCODE_BIT + 2;
1203
1204  /**
1205   * Keyboard event constant representing the LEFT ARROW key
1206   * (value is (1&lt;&lt;24)+3).
1207   */
1208  public static final int ARROW_LEFT = KEYCODE_BIT + 3;
1209
1210  /**
1211   * Keyboard event constant representing the RIGHT ARROW key
1212   * (value is (1&lt;&lt;24)+4).
1213   */
1214  public static final int ARROW_RIGHT = KEYCODE_BIT + 4;
1215
1216  /**
1217   * Keyboard event constant representing the PAGE UP key
1218   * (value is (1&lt;&lt;24)+5).
1219   */
1220  public static final int PAGE_UP = KEYCODE_BIT + 5;
1221
1222  /**
1223   * Keyboard event constant representing the PAGE DOWN key
1224   * (value is (1&lt;&lt;24)+6).
1225   */
1226  public static final int PAGE_DOWN = KEYCODE_BIT + 6;
1227
1228  /**
1229   * Keyboard event constant representing the HOME key
1230   * (value is (1&lt;&lt;24)+7).
1231   */
1232  public static final int HOME = KEYCODE_BIT + 7;
1233
1234  /**
1235   * Keyboard event constant representing the END key
1236   * (value is (1&lt;&lt;24)+8).
1237   */
1238  public static final int END = KEYCODE_BIT + 8;
1239
1240  /**
1241   * Keyboard event constant representing the INSERT key
1242   * (value is (1&lt;&lt;24)+9).
1243   */
1244  public static final int INSERT = KEYCODE_BIT + 9;
1245
1246  /**
1247   * Keyboard event constant representing the F1 key
1248   * (value is (1&lt;&lt;24)+10).
1249   */
1250  public static final int F1 = KEYCODE_BIT + 10;
1251  
1252  /**
1253   * Keyboard event constant representing the F2 key
1254   * (value is (1&lt;&lt;24)+11).
1255   */
1256  public static final int F2 = KEYCODE_BIT + 11;
1257  
1258  /**
1259   * Keyboard event constant representing the F3 key
1260   * (value is (1&lt;&lt;24)+12).
1261   */
1262  public static final int F3 = KEYCODE_BIT + 12;
1263  
1264  /**
1265   * Keyboard event constant representing the F4 key
1266   * (value is (1&lt;&lt;24)+13).
1267   */
1268  public static final int F4 = KEYCODE_BIT + 13;
1269  
1270  /**
1271   * Keyboard event constant representing the F5 key
1272   * (value is (1&lt;&lt;24)+14).
1273   */
1274  public static final int F5 = KEYCODE_BIT + 14;
1275  
1276  /**
1277   * Keyboard event constant representing the F6 key
1278   * (value is (1&lt;&lt;24)+15).
1279   */
1280  public static final int F6 = KEYCODE_BIT + 15;
1281  
1282  /**
1283   * Keyboard event constant representing the F7 key
1284   * (value is (1&lt;&lt;24)+16).
1285   */
1286  public static final int F7 = KEYCODE_BIT + 16;
1287  
1288  /**
1289   * Keyboard event constant representing the F8 key
1290   * (value is (1&lt;&lt;24)+17).
1291   */
1292  public static final int F8 = KEYCODE_BIT + 17;
1293  
1294  /**
1295   * Keyboard event constant representing the F9 key
1296   * (value is (1&lt;&lt;24)+18).
1297   */
1298  public static final int F9 = KEYCODE_BIT + 18;
1299  
1300  /**
1301   * Keyboard event constant representing the F10 key
1302   * (value is (1&lt;&lt;24)+19).
1303   */
1304  public static final int F10 = KEYCODE_BIT + 19;
1305  
1306  /**
1307   * Keyboard event constant representing the F11 key
1308   * (value is (1&lt;&lt;24)+20).
1309   */
1310  public static final int F11 = KEYCODE_BIT + 20;
1311  
1312  /**
1313   * Keyboard event constant representing the F12 key
1314   * (value is (1&lt;&lt;24)+21).
1315   */
1316  public static final int F12 = KEYCODE_BIT + 21;
1317
1318  /**
1319   * Keyboard event constant representing the F13 key
1320   * (value is (1&lt;&lt;24)+22).
1321   * 
1322   * @since 3.0
1323   */
1324  public static final int F13 = KEYCODE_BIT + 22;
1325  
1326  /**
1327   * Keyboard event constant representing the F14 key
1328   * (value is (1&lt;&lt;24)+23).
1329   * 
1330   * @since 3.0
1331   */
1332  public static final int F14 = KEYCODE_BIT + 23;
1333  
1334  /**
1335   * Keyboard event constant representing the F15 key
1336   * (value is (1&lt;&lt;24)+24).
1337   * 
1338   * @since 3.0
1339   */
1340  public static final int F15 = KEYCODE_BIT + 24;
1341  
1342  /**
1343   * Keyboard event constant representing the numeric key
1344   * pad multiply key (value is (1&lt;&lt;24)+42).
1345   * 
1346   * @since 3.0
1347   */
1348  public static final int KEYPAD_MULTIPLY = KEYCODE_BIT + 42;
1349  
1350  /**
1351   * Keyboard event constant representing the numeric key
1352   * pad add key (value is (1&lt;&lt;24)+43).
1353   * 
1354   * @since 3.0
1355   */
1356  public static final int KEYPAD_ADD = KEYCODE_BIT + 43;
1357  
1358  /**
1359   * Keyboard event constant representing the numeric key
1360   * pad subtract key (value is (1&lt;&lt;24)+45).
1361   * 
1362   * @since 3.0
1363   */
1364  public static final int KEYPAD_SUBTRACT = KEYCODE_BIT + 45;
1365
1366  /**
1367   * Keyboard event constant representing the numeric key
1368   * pad decimal key (value is (1&lt;&lt;24)+46).
1369   * 
1370   * @since 3.0
1371   */
1372  public static final int KEYPAD_DECIMAL = KEYCODE_BIT + 46;
1373
1374  /**
1375   * Keyboard event constant representing the numeric key
1376   * pad divide key (value is (1&lt;&lt;24)+47).
1377   * 
1378   * @since 3.0
1379   */
1380  public static final int KEYPAD_DIVIDE = KEYCODE_BIT + 47;
1381
1382  /**
1383   * Keyboard event constant representing the numeric key
1384   * pad zero key (value is (1&lt;&lt;24)+48).
1385   * 
1386   * @since 3.0
1387   */
1388  public static final int KEYPAD_0 = KEYCODE_BIT + 48;
1389
1390  /**
1391   * Keyboard event constant representing the numeric key
1392   * pad one key (value is (1&lt;&lt;24)+49).
1393   * 
1394   * @since 3.0
1395   */
1396  public static final int KEYPAD_1 = KEYCODE_BIT + 49;
1397
1398  /**
1399   * Keyboard event constant representing the numeric key
1400   * pad two key (value is (1&lt;&lt;24)+50).
1401   * 
1402   * @since 3.0
1403   */
1404  public static final int KEYPAD_2 = KEYCODE_BIT + 50;
1405
1406  /**
1407   * Keyboard event constant representing the numeric key
1408   * pad three key (value is (1&lt;&lt;24)+51).
1409   * 
1410   * @since 3.0
1411   */
1412  public static final int KEYPAD_3 = KEYCODE_BIT + 51;
1413
1414  /**
1415   * Keyboard event constant representing the numeric key
1416   * pad four key (value is (1&lt;&lt;24)+52).
1417   * 
1418   * @since 3.0
1419   */
1420  public static final int KEYPAD_4 = KEYCODE_BIT + 52;
1421  
1422  /**
1423   * Keyboard event constant representing the numeric key
1424   * pad five key (value is (1&lt;&lt;24)+53).
1425   * 
1426   * @since 3.0
1427   */
1428  public static final int KEYPAD_5 = KEYCODE_BIT + 53;
1429  
1430  /**
1431   * Keyboard event constant representing the numeric key
1432   * pad six key (value is (1&lt;&lt;24)+54).
1433   * 
1434   * @since 3.0
1435   */
1436  public static final int KEYPAD_6 = KEYCODE_BIT + 54;
1437
1438  /**
1439   * Keyboard event constant representing the numeric key
1440   * pad seven key (value is (1&lt;&lt;24)+55).
1441   * 
1442   * @since 3.0
1443   */
1444  public static final int KEYPAD_7 = KEYCODE_BIT + 55;
1445
1446  /**
1447   * Keyboard event constant representing the numeric key
1448   * pad eight key (value is (1&lt;&lt;24)+56).
1449   * 
1450   * @since 3.0
1451   */
1452  public static final int KEYPAD_8 = KEYCODE_BIT + 56;
1453  
1454  /**
1455   * Keyboard event constant representing the numeric key
1456   * pad nine key (value is (1&lt;&lt;24)+57).
1457   * 
1458   * @since 3.0
1459   */
1460  public static final int KEYPAD_9 = KEYCODE_BIT + 57;
1461
1462  /**
1463   * Keyboard event constant representing the numeric key
1464   * pad equal key (value is (1&lt;&lt;24)+61).
1465   * 
1466   * @since 3.0
1467   */
1468  public static final int KEYPAD_EQUAL = KEYCODE_BIT + 61;
1469  
1470  /**
1471   * Keyboard event constant representing the numeric key
1472   * pad enter key (value is (1&lt;&lt;24)+80).
1473   * 
1474   * @since 3.0
1475   */
1476  public static final int KEYPAD_CR = KEYCODE_BIT + 80;
1477  
1478  /**
1479   * Keyboard event constant representing the help
1480   * key (value is (1&lt;&lt;24)+81).
1481   * 
1482   * NOTE: The HELP key maps to the key labeled "help",
1483   * not "F1". If your keyboard does not have a HELP key,
1484   * you will never see this key press.  To listen for
1485   * help on a control, use SWT.Help.
1486   * 
1487   * @since 3.0
1488   * 
1489   * @see SWT#Help
1490   */
1491  public static final int HELP = KEYCODE_BIT + 81;
1492  
1493  /**
1494   * Keyboard event constant representing the caps
1495   * lock key (value is (1&lt;&lt;24)+82).
1496   * 
1497   * @since 3.0
1498   */
1499  public static final int CAPS_LOCK = KEYCODE_BIT + 82;
1500  
1501  /**
1502   * Keyboard event constant representing the num
1503   * lock key (value is (1&lt;&lt;24)+83).
1504   * 
1505   * @since 3.0
1506   */
1507  public static final int NUM_LOCK = KEYCODE_BIT + 83;
1508  
1509  /**
1510   * Keyboard event constant representing the scroll
1511   * lock key (value is (1&lt;&lt;24)+84).
1512   * 
1513   * @since 3.0
1514   */
1515  public static final int SCROLL_LOCK = KEYCODE_BIT + 84;
1516  
1517  /**
1518   * Keyboard event constant representing the pause
1519   * key (value is (1&lt;&lt;24)+85).
1520   * 
1521   * @since 3.0
1522   */
1523  public static final int PAUSE = KEYCODE_BIT + 85;
1524  
1525  /**
1526   * Keyboard event constant representing the break
1527   * key (value is (1&lt;&lt;24)+86).
1528   * 
1529   * @since 3.0
1530   */
1531  public static final int BREAK = KEYCODE_BIT + 86;
1532  
1533  /**
1534   * Keyboard event constant representing the break
1535   * key (value is (1&lt;&lt;24)+87).
1536   * 
1537   * @since 3.0
1538   */
1539  public static final int PRINT_SCREEN = KEYCODE_BIT + 87;
1540  
1541  /**
1542   * The <code>MessageBox</code> style constant for error icon
1543   * behavior (value is 1).
1544   */
1545  public static final int ICON_ERROR = 1;
1546
1547  /**
1548   * The <code>MessageBox</code> style constant for information icon
1549   * behavior (value is 1&lt;&lt;1).
1550   */
1551  public static final int ICON_INFORMATION = 1 << 1;
1552
1553  /**
1554   * The <code>MessageBox</code> style constant for question icon
1555   * behavior (value is 1&lt;&lt;2).
1556   */
1557  public static final int ICON_QUESTION = 1 << 2;
1558
1559  /**
1560   * The <code>MessageBox</code> style constant for warning icon
1561   * behavior (value is 1&lt;&lt;3).
1562   */
1563  public static final int ICON_WARNING = 1 << 3;
1564
1565  /**
1566   * The <code>MessageBox</code> style constant for "working" icon
1567   * behavior (value is 1&lt;&lt;4).
1568   */
1569  public static final int ICON_WORKING = 1 << 4;
1570
1571  /**
1572   * The <code>MessageBox</code> style constant for an OK button;
1573   * valid combinations are OK, OK|CANCEL
1574   * (value is 1&lt;&lt;5).
1575   */
1576  public static final int OK = 1 << 5;
1577
1578  /**
1579   * The <code>MessageBox</code> style constant for YES button;
1580   * valid combinations are YES|NO, YES|NO|CANCEL
1581   * (value is 1&lt;&lt;6).
1582   */
1583  public static final int YES = 1 << 6;
1584
1585  /**
1586   * The <code>MessageBox</code> style constant for NO button;
1587   * valid combinations are YES|NO, YES|NO|CANCEL
1588   * (value is 1&lt;&lt;7).
1589   */
1590  public static final int NO = 1 << 7;
1591
1592  /**
1593   * The <code>MessageBox</code> style constant for a CANCEL button;
1594   * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL
1595   * (value is 1&lt;&lt;8).
1596   */
1597  public static final int CANCEL = 1 << 8;
1598
1599  /**
1600   * The <code>MessageBox</code> style constant for an ABORT button;
1601   * the only valid combination is ABORT|RETRY|IGNORE
1602   * (value is 1&lt;&lt;9).
1603   */
1604  public static final int ABORT = 1 << 9;
1605
1606  /**
1607   * The <code>MessageBox</code> style constant for a RETRY button;
1608   *  valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL
1609   * (value is 1&lt;&lt;10).
1610   */
1611  public static final int RETRY = 1 << 10;
1612
1613  /**
1614   * The <code>MessageBox</code> style constant for an IGNORE button;
1615   * the only valid combination is ABORT|RETRY|IGNORE
1616   * (value is 1&lt;&lt;11).
1617   */
1618  public static final int  IGNORE = 1 << 11;
1619
1620  /**
1621   * The <code>FileDialog</code> style constant for open file dialog behavior
1622   * (value is 1&lt;&lt;12).
1623   */
1624  public static final int OPEN = 1 << 12;
1625
1626  /**
1627   * The <code>FileDialog</code> style constant for save file dialog behavior
1628   * (value is 1&lt;&lt;13).
1629   */
1630  public static final int SAVE = 1 << 13;
1631
1632  /**
1633   * Default color white (value is 1).
1634   */
1635  public static final int COLOR_WHITE = 1;
1636
1637  /**
1638   * Default color black (value is 2).
1639   */
1640  public static final int COLOR_BLACK = 2;
1641
1642  /**
1643   * Default color red (value is 3).
1644   */
1645  public static final int COLOR_RED = 3;
1646
1647  /**
1648   * Default color dark red (value is 4).
1649   */
1650  public static final int COLOR_DARK_RED = 4;
1651
1652  /**
1653   * Default color green (value is 5).
1654   */
1655  public static final int COLOR_GREEN = 5;
1656
1657  /**
1658   * Default color dark green (value is 6).
1659   */
1660  public static final int COLOR_DARK_GREEN = 6;
1661
1662  /**
1663   * Default color yellow (value is 7).
1664   */
1665  public static final int COLOR_YELLOW = 7;
1666
1667  /**
1668   * Default color dark yello (value is 8).
1669   */
1670  public static final int COLOR_DARK_YELLOW = 8;
1671
1672  /**
1673   * Default color blue (value is 9).
1674   */
1675  public static final int COLOR_BLUE = 9;
1676
1677  /**
1678   * Default color dark blue (value is 10).
1679   */
1680  public static final int COLOR_DARK_BLUE = 10;
1681
1682  /**
1683   * Default color magenta (value is 11).
1684   */
1685  public static final int COLOR_MAGENTA = 11;
1686
1687  /**
1688   * Default color dark magenta (value is 12).
1689   */
1690  public static final int COLOR_DARK_MAGENTA = 12;
1691
1692  /**
1693   * Default color cyan (value is 13).
1694   */
1695  public static final int COLOR_CYAN = 13;
1696
1697  /**
1698   * Default color dark cyan (value is 14).
1699   */
1700  public static final int COLOR_DARK_CYAN = 14;
1701
1702  /**
1703   * Default color gray (value is 15).
1704   */
1705  public static final int COLOR_GRAY = 15;
1706
1707  /**
1708   * Default color dark gray (value is 16).
1709   */
1710  public static final int COLOR_DARK_GRAY = 16;
1711  
1712  /*
1713   * System Colors
1714   *
1715   * Dealing with system colors is an area where there are
1716   * many platform differences.  On some platforms, system
1717   * colors can change dynamically while the program is
1718   * running.  On other platforms, system colors can be
1719   * changed for all instances of a particular widget.
1720   * Therefore, the only truly portable method to obtain
1721   * a widget color query is to query the color from an
1722   * instance of the widget.
1723   *
1724   *  It is expected that the list of supported colors
1725   * will grow over time.
1726   */
1727  
1728  /**
1729   * System color used to paint dark shadow areas (value is 17).
1730   */
1731  public static final int COLOR_WIDGET_DARK_SHADOW = 17;
1732
1733  /**
1734   * System color used to paint normal shadow areas (value is 18).
1735   */
1736  public static final int COLOR_WIDGET_NORMAL_SHADOW = 18;
1737
1738  /**
1739   * System color used to paint light shadow areas (value is 19).
1740   */
1741  public static final int COLOR_WIDGET_LIGHT_SHADOW = 19;
1742
1743  /**
1744   * System color used to paint highlight shadow areas (value is 20).
1745   */
1746  public static final int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20;
1747
1748  /**
1749   * System color used to paint foreground areas (value is 21).
1750   */
1751  public static final int COLOR_WIDGET_FOREGROUND = 21;
1752
1753  /**
1754   * System color used to paint background areas (value is 22).
1755   */
1756  public static final int COLOR_WIDGET_BACKGROUND = 22;
1757
1758  /**
1759   * System color used to paint border areas (value is 23).
1760   */
1761  public static final int COLOR_WIDGET_BORDER = 23;
1762
1763  /**
1764   * System color used to paint list foreground areas (value is 24).
1765   */
1766  public static final int COLOR_LIST_FOREGROUND = 24;
1767
1768  /**
1769   * System color used to paint list background areas (value is 25).
1770   */
1771  public static final int COLOR_LIST_BACKGROUND = 25;
1772
1773  /**
1774   * System color used to paint list selection background areas (value is 26).
1775   */
1776  public static final int COLOR_LIST_SELECTION = 26;
1777
1778  /**
1779   * System color used to paint list selected text (value is 27).
1780   */
1781  public static final int COLOR_LIST_SELECTION_TEXT = 27;
1782
1783  /**
1784   * System color used to paint tooltip text (value is 28).
1785   */
1786  public static final int COLOR_INFO_FOREGROUND = 28;
1787
1788  /**
1789   * System color used to paint tooltip background areas (value is 29).
1790   */
1791  public static final int COLOR_INFO_BACKGROUND = 29;
1792  
1793  /**
1794   * System color used to paint title text (value is 30).
1795   */
1796  public static final int COLOR_TITLE_FOREGROUND = 30;
1797
1798  /**
1799   * System color used to paint title background areas (value is 31).
1800   */
1801  public static final int COLOR_TITLE_BACKGROUND = 31;
1802
1803  /**
1804   * System color used to paint title background gradient (value is 32).
1805   */
1806  public static final int COLOR_TITLE_BACKGROUND_GRADIENT = 32;
1807  
1808  /**
1809   * System color used to paint inactive title text (value is 33).
1810   */
1811  public static final int COLOR_TITLE_INACTIVE_FOREGROUND = 33;
1812
1813  /**
1814   * System color used to paint inactive title background areas (value is 34).
1815   */
1816  public static final int COLOR_TITLE_INACTIVE_BACKGROUND = 34;
1817
1818  /**
1819   * System color used to paint inactive title background gradient (value is 35).
1820   */
1821  public static final int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35;
1822  
1823  /**
1824   * Draw constant indicating whether the drawing operation
1825   * should fill the background (value is 1&lt;&lt;0).
1826   */
1827  public static final int DRAW_TRANSPARENT = 1 << 0;
1828
1829  /**
1830   * Draw constant indicating whether the string drawing operation
1831   * should handle line-delimeters (value is 1&lt;&lt;1).
1832   */
1833  public static final int DRAW_DELIMITER = 1 << 1;
1834
1835  /**
1836   * Draw constant indicating whether the string drawing operation
1837   * should expand TAB characters (value is 1&lt;&lt;2).
1838   */
1839  public static final int DRAW_TAB = 1 << 2;
1840
1841  /**
1842   * Draw constant indicating whether the string drawing operation
1843   * should handle mnemonics (value is 1&lt;&lt;3).
1844   */
1845  public static final int DRAW_MNEMONIC = 1 << 3;  
1846  
1847  /** 
1848   * SWT error constant indicating that no error number was specified
1849   * (value is 1).
1850   */
1851  public static final int ERROR_UNSPECIFIED = 1;
1852  
1853  /** 
1854   * SWT error constant indicating that no more handles for an
1855   * operating system resource are available
1856   * (value is 2).
1857   */
1858  public static final int ERROR_NO_HANDLES = 2;
1859  
1860  /** 
1861   * SWT error constant indicating that no more callback resources are available
1862   * (value is 3).
1863   */
1864  public static final int ERROR_NO_MORE_CALLBACKS = 3;
1865  
1866  /** 
1867   * SWT error constant indicating that a null argument was passed in
1868   * (value is 4). 
1869   */
1870  public static final int ERROR_NULL_ARGUMENT = 4;
1871  
1872  /** 
1873   * SWT error constant indicating that an invalid argument was passed in
1874   * (value is 5).
1875   */
1876  public static final int ERROR_INVALID_ARGUMENT = 5;
1877  
1878  /** 
1879   * SWT error constant indicating that a value was found to be
1880   * outside the allowable range
1881   * (value is 6).
1882   */
1883  public static final int ERROR_INVALID_RANGE = 6;
1884  
1885  /** 
1886   * SWT error constant indicating that a value which can not be 
1887   * zero was found to be
1888   * (value is 7).
1889   */
1890  public static final int ERROR_CANNOT_BE_ZERO = 7;
1891  
1892  /** 
1893   * SWT error constant indicating that the underlying operating
1894   * system was unable to provide the value of an item
1895   * (value is 8).
1896   */
1897  public static final int ERROR_CANNOT_GET_ITEM = 8;
1898  
1899  /** 
1900   * SWT error constant indicating that the underlying operating
1901   * system was unable to provide the selection
1902   * (value is 9).
1903   */
1904  public static final int ERROR_CANNOT_GET_SELECTION = 9;
1905
1906  /** 
1907   * SWT error constant indicating that the underlying operating
1908   * system was unable to provide the height of an item
1909   * (value is 11).
1910   */
1911  public static final int ERROR_CANNOT_GET_ITEM_HEIGHT = 11;
1912
1913  /** 
1914   * SWT error constant indicating that the underlying operating
1915   * system was unable to provide the text of a widget
1916   * (value is 12).
1917   */
1918  public static final int ERROR_CANNOT_GET_TEXT = 12;
1919
1920  /** 
1921   * SWT error constant indicating that the underlying operating
1922   * system was unable to set the text of a widget
1923   * (value is 13).
1924   */
1925  public static final int ERROR_CANNOT_SET_TEXT = 13;
1926
1927  /** 
1928   * SWT error constant indicating that the underlying operating
1929   * system was unable to add an item
1930   * (value is 14).
1931   */
1932  public static final int ERROR_ITEM_NOT_ADDED = 14;
1933
1934  /** 
1935   * SWT error constant indicating that the underlying operating
1936   * system was unable to remove an item
1937   * (value is 15).
1938   */
1939  public static final int ERROR_ITEM_NOT_REMOVED = 15;
1940
1941  /** 
1942   * SWT error constant indicating that a particular feature has
1943   * not been implemented on this platform
1944   * (value is 20).
1945   */
1946  public static final int ERROR_NOT_IMPLEMENTED = 20;
1947
1948  /** 
1949   * SWT error constant indicating that a menu which needed
1950   * to have the drop down style had some other style instead
1951   * (value is 21).
1952   */
1953  public static final int ERROR_MENU_NOT_DROP_DOWN = 21;
1954
1955  /** 
1956   * SWT error constant indicating that an attempt was made to
1957   * invoke an SWT operation which can only be executed by the
1958   * user-interface thread from some other thread
1959   * (value is 22).
1960   */
1961  public static final int ERROR_THREAD_INVALID_ACCESS = 22;
1962
1963  /** 
1964   * SWT error constant indicating that an attempt was made to
1965   * invoke an SWT operation using a widget which had already
1966   * been disposed
1967   * (value is 24). 
1968   */
1969  public static final int ERROR_WIDGET_DISPOSED = 24;
1970
1971  /** 
1972   * SWT error constant indicating that a menu item which needed
1973   * to have the cascade style had some other style instead
1974   * (value is 27).
1975   */
1976  public static final int ERROR_MENUITEM_NOT_CASCADE = 27;
1977
1978  /** 
1979   * SWT error constant indicating that the underlying operating
1980   * system was unable to set the selection of a widget
1981   * (value is 28).
1982   */
1983  public static final int ERROR_CANNOT_SET_SELECTION = 28;
1984
1985  /** 
1986   * SWT error constant indicating that the underlying operating
1987   * system was unable to set the menu
1988   * (value is 29).
1989   */
1990  public static final int ERROR_CANNOT_SET_MENU = 29;
1991
1992  /** 
1993   * SWT error constant indicating that the underlying operating
1994   * system was unable to set the enabled state
1995   * (value is 30).
1996   */
1997  public static final int ERROR_CANNOT_SET_ENABLED = 30;
1998
1999  /** 
2000   * SWT error constant indicating that the underlying operating
2001   * system was unable to provide enabled/disabled state information
2002   * (value is 31).
2003   */
2004  public static final int ERROR_CANNOT_GET_ENABLED = 31;
2005
2006  /** 
2007   * SWT error constant indicating that a provided widget can
2008   * not be used as a parent in the current operation
2009   * (value is 32).
2010   */
2011  public static final int ERROR_INVALID_PARENT = 32;
2012  
2013  /** 
2014   * SWT error constant indicating that a menu which needed
2015   * to have the menu bar style had some other style instead
2016   * (value is 33).
2017   */
2018  public static final int ERROR_MENU_NOT_BAR = 33;
2019
2020  /** 
2021   * SWT error constant indicating that the underlying operating
2022   * system was unable to provide count information
2023   * (value is 36).
2024   */
2025  public static final int ERROR_CANNOT_GET_COUNT = 36;
2026
2027  /** 
2028   * SWT error constant indicating that a menu which needed
2029   * to have the pop up menu style had some other style instead
2030   * (value is 37).
2031   */
2032  public static final int ERROR_MENU_NOT_POP_UP = 37;
2033
2034  /** 
2035   * SWT error constant indicating that a graphics operation
2036   * was attempted with an image of an unsupported depth
2037   * (value is 38).
2038   */
2039  public static final int ERROR_UNSUPPORTED_DEPTH = 38;
2040
2041  /** 
2042   * SWT error constant indicating that an input/output operation
2043   * failed during the execution of an SWT operation
2044   * (value is 39).
2045   */
2046  public static final int ERROR_IO = 39;
2047
2048  /** 
2049   * SWT error constant indicating that a graphics operation
2050   * was attempted with an image having an invalid format
2051   * (value is 40).
2052   */
2053  public static final int ERROR_INVALID_IMAGE = 40;
2054
2055  /** 
2056   * SWT error constant indicating that a graphics operation
2057   * was attempted with an image having a valid but unsupported
2058   * format
2059   * (value is 42).
2060   */
2061  public static final int ERROR_UNSUPPORTED_FORMAT = 42;
2062
2063  /** 
2064   * SWT error constant indicating that an attempt was made
2065   * to subclass an SWT widget class without implementing the
2066   * <code>checkSubclass()</code> method
2067   * (value is 43).
2068   * 
2069   * For additional information see the comment in 
2070   * <code>Widget.checkSubclass()</code>.
2071   *
2072   * @see org.eclipse.swt.widgets.Widget#checkSubclass
2073   */
2074  public static final int ERROR_INVALID_SUBCLASS = 43;
2075
2076  /** 
2077   * SWT error constant indicating that an attempt was made to
2078   * invoke an SWT operation using a graphics object which had
2079   * already been disposed
2080   * (value is 44).
2081   */
2082  public static final int ERROR_GRAPHIC_DISPOSED = 44;
2083  
2084  /** 
2085   * SWT error constant indicating that an attempt was made to
2086   * invoke an SWT operation using a device which had already
2087   * been disposed
2088   * (value is 45). 
2089   */
2090  public static final int ERROR_DEVICE_DISPOSED = 45;
2091  
2092  /** 
2093   * SWT error constant indicating that an exception happened
2094   * when executing a runnable
2095   * (value is 46).
2096   */
2097  public static final int ERROR_FAILED_EXEC = 46;
2098  
2099  /** 
2100   * SWT error constant indicating that an unsatisfied link
2101   * error occured while attempting to load a library
2102   * (value is 47).
2103   */
2104  public static final int ERROR_FAILED_LOAD_LIBRARY = 47;
2105  
2106  /**
2107   * Traversal event detail field value indicating that no 
2108   * traversal action should be taken
2109   * (value is 0).
2110   */
2111  public static final int TRAVERSE_NONE = 0;
2112  
2113  /**
2114   * Traversal event detail field value indicating that the 
2115   * key which designates that a dialog should be cancelled was
2116   * pressed; typically, this is the ESC key
2117   * (value is 1&lt;&lt;1).
2118   */
2119  public static final int TRAVERSE_ESCAPE = 1 << 1;
2120
2121  /**
2122   * Traversal event detail field value indicating that the
2123   * key which activates the default button in a dialog was
2124   * pressed; typically, this is the ENTER key
2125   * (value is 1&lt;&lt;2).
2126   */
2127  public static final int TRAVERSE_RETURN = 1 << 2;
2128
2129  /**
2130   * Traversal event detail field value indicating that the 
2131   * key which designates that focus should be given to the
2132   * previous tab group was pressed; typically, this is the
2133   * SHIFT-TAB key sequence
2134   * (value is 1&lt;&lt;3).
2135   */
2136  public static final int TRAVERSE_TAB_PREVIOUS = 1 << 3;
2137
2138  /**
2139   * Traversal event detail field value indicating that the 
2140   * key which designates that focus should be given to the
2141   * next tab group was pressed; typically, this is the
2142   * TAB key
2143   * (value is 1&lt;&lt;4).
2144   */
2145  public static final int TRAVERSE_TAB_NEXT = 1 << 4;
2146
2147  /**
2148   * Traversal event detail field value indicating that the 
2149   * key which designates that focus should be given to the
2150   * previous tab item was pressed; typically, this is either
2151   * the LEFT-ARROW or UP-ARROW keys
2152   * (value is 1&lt;&lt;5).
2153   */
2154  public static final int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
2155
2156  /**
2157   * Traversal event detail field value indicating that the 
2158   * key which designates that focus should be given to the
2159   * previous tab item was pressed; typically, this is either
2160   * the RIGHT-ARROW or DOWN-ARROW keys
2161   * (value is 1&lt;&lt;6).
2162   */
2163  public static final int TRAVERSE_ARROW_NEXT = 1 << 6;
2164
2165  /**
2166   * Traversal event detail field value indicating that a 
2167   * mnemonic key sequence was pressed
2168   * (value is 1&lt;&lt;7).
2169   */
2170  public static final int TRAVERSE_MNEMONIC = 1 << 7;
2171
2172  /**
2173   * Traversal event detail field value indicating that the 
2174   * key which designates that the previous page of a multi-page
2175   * window should be shown was pressed; typically, this
2176   * is the CTRL-PAGEUP key sequence
2177   * (value is 1&lt;&lt;8).
2178   */
2179  public static final int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
2180  
2181  /**
2182   * Traversal event detail field value indicating that the 
2183   * key which designates that the next page of a multi-page
2184   * window should be shown was pressed; typically, this
2185   * is the CTRL-PAGEDOWN key sequence
2186   * (value is 1&lt;&lt;9).
2187   */
2188  public static final int TRAVERSE_PAGE_NEXT = 1 << 9;
2189
2190  /**
2191   * Constant indicating that an image or operation is of type bitmap  (value is 0).
2192   */  
2193  public static final int BITMAP = 0;
2194
2195  /**
2196   * Constant indicating that an image or operation is of type icon  (value is 1).
2197   */  
2198  public static final int ICON = 1;
2199
2200  /**
2201   * The <code>Image</code> constructor argument indicating that
2202   * the new image should be a copy of the image provided as
2203   * an argument  (value is 0).
2204   */  
2205  public static final int IMAGE_COPY = 0;
2206
2207  /**
2208   * The <code>Image</code> constructor argument indicating that
2209   * the new image should have the appearance of a "disabled"
2210   * (using the platform's rules for how this should look)
2211   * copy of the image provided as an argument  (value is 1).
2212   */  
2213  public static final int IMAGE_DISABLE = 1;
2214  
2215  /**
2216   * The <code>Image</code> constructor argument indicating that
2217   * the new image should have the appearance of a "gray scaled"
2218   * copy of the image provided as an argument  (value is 2).
2219   */  
2220  public static final int IMAGE_GRAY = 2;
2221  
2222  /**
2223   * The font style constant indicating a normal weight, non-italic font
2224   * (value is 0).
2225   */
2226  public static final int NORMAL = 0;
2227  
2228  /**
2229   * The font style constant indicating a bold weight font
2230   * (value is 1&lt;&lt;0).
2231   */
2232  public static final int BOLD = 1 << 0;
2233  
2234  /**
2235   * The font style constant indicating an italic font
2236   * (value is 1&lt;&lt;1).
2237   */
2238  public static final int ITALIC = 1 << 1;
2239    
2240  /**
2241   * System arrow cursor  (value is 0).
2242   */
2243  public static final int CURSOR_ARROW = 0;
2244    
2245  /**
2246   * System wait cursor  (value is 1).
2247   */
2248  public static final int CURSOR_WAIT = 1;
2249    
2250  /**
2251   * System cross hair cursor  (value is 2).
2252   */
2253  public static final int CURSOR_CROSS = 2;
2254    
2255  /**
2256   * System app startup cursor  (value is 3).
2257   */
2258  public static final int CURSOR_APPSTARTING = 3;
2259    
2260  /**
2261   * System help cursor  (value is 4).
2262   */
2263  public static final int CURSOR_HELP = 4;
2264    
2265  /**
2266   * System resize all directions cursor (value is 5).
2267   */
2268  public static final int CURSOR_SIZEALL = 5;
2269    
2270  /**
2271   * System resize north-east-south-west cursor  (value is 6).
2272   */
2273  public static final int CURSOR_SIZENESW = 6;
2274    
2275  /**
2276   * System resize north-south cursor  (value is 7).
2277   */
2278  public static final int CURSOR_SIZENS = 7;
2279    
2280  /**
2281   * System resize north-west-south-east cursor  (value is 8).
2282   */
2283  public static final int CURSOR_SIZENWSE = 8;
2284    
2285  /**
2286   * System resize west-east cursor  (value is 9).
2287   */
2288  public static final int CURSOR_SIZEWE = 9;
2289    
2290  /**
2291   * System resize north cursor  (value is 10).
2292   */
2293  public static final int CURSOR_SIZEN = 10;
2294    
2295  /**
2296   * System resize south cursor  (value is 11).
2297   */
2298  public static final int CURSOR_SIZES = 11;
2299    
2300  /**
2301   * System resize east cursor  (value is 12).
2302   */
2303  public static final int CURSOR_SIZEE = 12;
2304    
2305  /**
2306   * System resize west cursor  (value is 13).
2307   */
2308  public static final int CURSOR_SIZEW = 13;
2309    
2310  /**
2311   * System resize north-east cursor (value is 14).
2312   */
2313  public static final int CURSOR_SIZENE = 14;
2314    
2315  /**
2316   * System resize south-east cursor (value is 15).
2317   */
2318  public static final int CURSOR_SIZESE = 15;
2319    
2320  /**
2321   * System resize south-west cursor (value is 16).
2322   */
2323  public static final int CURSOR_SIZESW = 16;
2324    
2325  /**
2326   * System resize north-west cursor (value is 17).
2327   */
2328  public static final int CURSOR_SIZENW = 17;
2329    
2330  /**
2331   * System up arrow cursor  (value is 18).
2332   */
2333  public static final int CURSOR_UPARROW = 18;
2334    
2335  /**
2336   * System i-beam cursor (value is 19).
2337   */
2338  public static final int CURSOR_IBEAM = 19;
2339    
2340  /**
2341   * System "not allowed" cursor (value is 20).
2342   */
2343  public static final int CURSOR_NO = 20;
2344    
2345  /**
2346   * System hand cursor (value is 21).
2347   */
2348  public static final int CURSOR_HAND = 21;
2349    
2350  /**
2351   * Line drawing style for solid lines  (value is 1).
2352   */
2353  public static final int LINE_SOLID = 1;
2354    
2355  /**
2356   * Line drawing style for dashed lines (value is 2).
2357   */
2358  public static final int LINE_DASH = 2;
2359    
2360  /**
2361   * Line drawing style for dotted lines (value is 3).
2362   */
2363  public static final int LINE_DOT = 3;
2364    
2365  /**
2366   * Line drawing style for alternating dash-dot lines (value is 4).
2367   */
2368  public static final int LINE_DASHDOT = 4;
2369    
2370  /**
2371   * Line drawing style for dash-dot-dot lines (value is 5).
2372   */
2373  public static final int LINE_DASHDOTDOT = 5;
2374
2375  /**
2376   * Image format constant indicating an unknown image type (value is -1).
2377   */
2378  public static final int IMAGE_UNDEFINED = -1;
2379
2380  /**
2381   * Image format constant indicating a Windows BMP format image (value is 0).
2382   */
2383  public static final int IMAGE_BMP = 0;
2384
2385  /**
2386   * Image format constant indicating a run-length encoded 
2387   * Windows BMP format image (value is 1).
2388   */
2389  public static final int IMAGE_BMP_RLE = 1;
2390
2391  /**
2392   * Image format constant indicating a GIF format image (value is 2).
2393   */
2394  public static final int IMAGE_GIF = 2;
2395
2396  /**
2397   * Image format constant indicating a ICO format image (value is 3).
2398   */
2399  public static final int IMAGE_ICO = 3;
2400
2401  /**
2402   * Image format constant indicating a JPEG format image (value is 4).
2403   */
2404  public static final int IMAGE_JPEG = 4;
2405
2406  /**
2407   * Image format constant indicating a PNG format image (value is 5).
2408   */
2409  public static final int IMAGE_PNG = 5;
2410
2411  /**
2412   * Image format constant indicating a TIFF format image (value is 6).
2413   */
2414  public static final int IMAGE_TIFF = 6;
2415
2416  /**
2417   * GIF image disposal method constants indicating that the
2418   * disposal method is unspecified (value is 0).
2419   */
2420  public static final int DM_UNSPECIFIED = 0x0;
2421
2422  /**
2423   * GIF image disposal method constants indicating that the
2424   * disposal method is to do nothing; that is, to leave the 
2425   * previous image in place (value is 1).
2426   */
2427  public static final int DM_FILL_NONE = 0x1;
2428
2429  /**
2430   * GIF image disposal method constants indicating that the
2431   * the previous images should be covered with the background
2432   * color before displaying the next image (value is 2).
2433   */
2434  public static final int DM_FILL_BACKGROUND = 0x2;
2435
2436  /**
2437   * GIF image disposal method constants indicating that the
2438   * disposal method is to restore the previous picture
2439   * (value is 3).
2440   */
2441  public static final int DM_FILL_PREVIOUS = 0x3;
2442  
2443  /**
2444   * Image transparency constant indicating that the image
2445   * contains no transparency information (value is 0).
2446   */
2447  public static final int TRANSPARENCY_NONE = 0x0;
2448  
2449  /**
2450   * Image transparency constant indicating that the image
2451   * contains alpha transparency information (value is 1&lt;&lt;0).
2452   */
2453  public static final int TRANSPARENCY_ALPHA = 1 << 0;
2454  
2455  /**
2456   * Image transparency constant indicating that the image
2457   * contains a transparency mask (value is 1&lt;&lt;1).
2458   */
2459  public static final int TRANSPARENCY_MASK = 1 << 1;
2460  
2461  /**
2462   * Image transparency constant indicating that the image
2463   * contains a transparent pixel (value is 1&lt;&lt;2).
2464   */
2465  public static final int TRANSPARENCY_PIXEL = 1 << 2;
2466
2467  /**
2468   * The character movement type (value is 1&lt;&lt;0).
2469   * 
2470   * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
2471   * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
2472   * 
2473   * @since 3.0
2474   */  
2475  public static final int MOVEMENT_CHAR = 1 << 0;
2476
2477  /**
2478   * The cluster movement type (value is 1&lt;&lt;1).
2479   * 
2480   * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
2481   * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
2482   * 
2483   * @since 3.0
2484   */
2485  public static final int MOVEMENT_CLUSTER = 1 << 1;
2486
2487  /**
2488   * The word movement type (value is 1&lt;&lt;2).
2489   * 
2490   * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
2491   * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
2492   * 
2493   * @since 3.0
2494   */  
2495  public static final int MOVEMENT_WORD = 1 << 2;
2496
2497/**
2498 * Answers a concise, human readable description of the error code.
2499 *
2500 * @param code the SWT error code.
2501 * @return a description of the error code.
2502 *
2503 * @see SWT
2504 */
2505static String findErrorText (int code) {
2506  switch (code) {
2507    case ERROR_UNSPECIFIED:            return "Unspecified error"; //$NON-NLS-1$
2508    case ERROR_NO_HANDLES:         return "No more handles"; //$NON-NLS-1$
2509    case ERROR_NO_MORE_CALLBACKS:      return "No more callbacks"; //$NON-NLS-1$
2510    case ERROR_NULL_ARGUMENT:          return "Argument cannot be null"; //$NON-NLS-1$
2511    case ERROR_INVALID_ARGUMENT:       return "Argument not valid"; //$NON-NLS-1$
2512    case ERROR_INVALID_RANGE:          return "Index out of bounds"; //$NON-NLS-1$
2513    case ERROR_CANNOT_BE_ZERO:         return "Argument cannot be zero"; //$NON-NLS-1$
2514    case ERROR_CANNOT_GET_ITEM:        return "Cannot get item"; //$NON-NLS-1$
2515    case ERROR_CANNOT_GET_SELECTION:   return "Cannot get selection"; //$NON-NLS-1$
2516    case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; //$NON-NLS-1$
2517    case ERROR_CANNOT_GET_TEXT:        return "Cannot get text"; //$NON-NLS-1$
2518    case ERROR_CANNOT_SET_TEXT:        return "Cannot set text"; //$NON-NLS-1$
2519    case ERROR_ITEM_NOT_ADDED:         return "Item not added"; //$NON-NLS-1$
2520    case ERROR_ITEM_NOT_REMOVED:       return "Item not removed"; //$NON-NLS-1$
2521    case ERROR_NOT_IMPLEMENTED:        return "Not implemented"; //$NON-NLS-1$
2522    case ERROR_MENU_NOT_DROP_DOWN:     return "Menu must be a drop down"; //$NON-NLS-1$
2523    case ERROR_THREAD_INVALID_ACCESS:  return "Invalid thread access"; //$NON-NLS-1$
2524    case ERROR_WIDGET_DISPOSED:        return "Widget is disposed"; //$NON-NLS-1$
2525    case ERROR_MENUITEM_NOT_CASCADE:   return "Menu item is not a CASCADE"; //$NON-NLS-1$
2526    case ERROR_CANNOT_SET_SELECTION:   return "Cannot set selection";  //$NON-NLS-1$
2527    case ERROR_CANNOT_SET_MENU:        return "Cannot set menu";  //$NON-NLS-1$
2528    case ERROR_CANNOT_SET_ENABLED:     return "Cannot set the enabled state";  //$NON-NLS-1$
2529    case ERROR_CANNOT_GET_ENABLED:     return "Cannot get the enabled state";  //$NON-NLS-1$
2530    case ERROR_INVALID_PARENT:         return "Widget has the wrong parent";  //$NON-NLS-1$
2531    case ERROR_MENU_NOT_BAR:           return "Menu is not a BAR";  //$NON-NLS-1$
2532    case ERROR_CANNOT_GET_COUNT:       return "Cannot get count"; //$NON-NLS-1$
2533    case ERROR_MENU_NOT_POP_UP:        return "Menu is not a POP_UP"; //$NON-NLS-1$
2534    case ERROR_UNSUPPORTED_DEPTH:      return "Unsupported color depth"; //$NON-NLS-1$
2535    case ERROR_IO:                     return "i/o error"; //$NON-NLS-1$
2536    case ERROR_INVALID_IMAGE:          return "Invalid image"; //$NON-NLS-1$
2537    case ERROR_UNSUPPORTED_FORMAT:     return "Unsupported or unrecognized format"; //$NON-NLS-1$
2538    case ERROR_INVALID_SUBCLASS:       return "Subclassing not allowed"; //$NON-NLS-1$
2539    case ERROR_GRAPHIC_DISPOSED:       return "Graphic is disposed"; //$NON-NLS-1$
2540    case ERROR_DEVICE_DISPOSED:        return "Device is disposed"; //$NON-NLS-1$
2541    case ERROR_FAILED_EXEC:            return "Failed to execute runnable"; //$NON-NLS-1$
2542    case ERROR_FAILED_LOAD_LIBRARY:    return "Unable to load library"; //$NON-NLS-1$
2543  }
2544  return "Unknown error"; //$NON-NLS-1$
2545}
2546
2547/**
2548 * Returns the NLS'ed message for the given argument.
2549 * 
2550 * @param key the key to look up
2551 * @return the message for the given key
2552 * 
2553 * @exception IllegalArgumentException <ul>
2554 *    <li>ERROR_NULL_ARGUMENT - if the key is null</li>
2555 * </ul>
2556 */
2557public static String getMessage(String key) {
2558  return Compatibility.getMessage(key);
2559}
2560  
2561/**
2562 * Returns the SWT platform name.
2563 * Examples: "win32", "motif", "gtk", "photon", "carbon"
2564 *
2565 * @return the SWT platform name
2566 */
2567public static String getPlatform () {
2568  return Library.getPlatform ();
2569}
2570
2571/**
2572 * Returns the SWT version number as an integer.
2573 * Example: "SWT051" == 51
2574 *
2575 * @return the SWT version number
2576 */
2577public static int getVersion () {
2578  return Library.getVersion ();
2579}
2580
2581/**
2582 * Throws an appropriate exception based on the passed in error code.
2583 *
2584 * @param code the SWT error code
2585 */
2586public static void error (int code) {
2587  error (code, null);
2588}
2589
2590/**
2591 * Throws an appropriate exception based on the passed in error code.
2592 * The <code>throwable</code> argument should be either null, or the
2593 * throwable which caused SWT to throw an exception.
2594 * <p>
2595 * In SWT, errors are reported by throwing one of three exceptions:
2596 * <dl>
2597 * <dd>java.lang.IllegalArgumentException</dd>
2598 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
2599 * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
2600 * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
2601 * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
2602 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
2603 * </dl>
2604 * This method provides the logic which maps between error codes
2605 * and one of the above exceptions.
2606 * </p>
2607 *
2608 * @param code the SWT error code.
2609 * @param throwable the exception which caused the error to occur.
2610 *
2611 * @see SWTError
2612 * @see SWTException
2613 * @see IllegalArgumentException
2614 */
2615public static void error (int code, Throwable throwable) {
2616  error (code, throwable, null);
2617}
2618
2619/**
2620 * Throws an appropriate exception based on the passed in error code.
2621 * The <code>throwable</code> argument should be either null, or the
2622 * throwable which caused SWT to throw an exception.
2623 * <p>
2624 * In SWT, errors are reported by throwing one of three exceptions:
2625 * <dl>
2626 * <dd>java.lang.IllegalArgumentException</dd>
2627 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
2628 * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
2629 * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
2630 * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
2631 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
2632 * </dl>
2633 * This method provides the logic which maps between error codes
2634 * and one of the above exceptions.
2635 * </p>
2636 *
2637 * @param code the SWT error code.
2638 * @param throwable the exception which caused the error to occur.
2639 * @param detail more information about error.
2640 *
2641 * @see SWTError
2642 * @see SWTException
2643 * @see IllegalArgumentException
2644 * 
2645 * @since 3.0
2646 */
2647public static void error (int code, Throwable throwable, String detail) {
2648
2649  /*
2650  * This code prevents the creation of "chains" of SWTErrors and
2651  * SWTExceptions which in turn contain other SWTErrors and 
2652  * SWTExceptions as their throwable. This can occur when low level
2653  * code throws an exception past a point where a higher layer is
2654  * being "safe" and catching all exceptions. (Note that, this is
2655  * _a_bad_thing_ which we always try to avoid.)
2656  *
2657  * On the theory that the low level code is closest to the
2658  * original problem, we simply re-throw the original exception here.
2659  */
2660  if (throwable instanceof SWTError) throw (SWTError) throwable;
2661  if (throwable instanceof SWTException) throw (SWTException) throwable;
2662
2663  String message = findErrorText (code);
2664  if (detail != null) message += detail;
2665  switch (code) {
2666    
2667    /* Illegal Arguments (non-fatal) */
2668    case ERROR_NULL_ARGUMENT: 
2669    case ERROR_CANNOT_BE_ZERO:
2670    case ERROR_INVALID_ARGUMENT:
2671    case ERROR_MENU_NOT_BAR:
2672    case ERROR_MENU_NOT_DROP_DOWN:
2673    case ERROR_MENU_NOT_POP_UP:
2674    case ERROR_MENUITEM_NOT_CASCADE:
2675    case ERROR_INVALID_PARENT:     
2676    case ERROR_INVALID_RANGE: {
2677      throw new IllegalArgumentException (message);
2678    }
2679    
2680    /* SWT Errors (non-fatal) */
2681    case ERROR_INVALID_SUBCLASS:
2682    case ERROR_THREAD_INVALID_ACCESS:
2683    case ERROR_WIDGET_DISPOSED:
2684    case ERROR_GRAPHIC_DISPOSED:
2685    case ERROR_DEVICE_DISPOSED:
2686    case ERROR_INVALID_IMAGE:
2687    case ERROR_UNSUPPORTED_DEPTH:
2688    case ERROR_UNSUPPORTED_FORMAT:
2689    case ERROR_FAILED_EXEC:
2690    case ERROR_IO: {
2691      SWTException exception = new SWTException (code, message);
2692      exception.throwable = throwable;
2693      throw exception;
2694    }
2695    
2696    /* OS Failure/Limit (fatal, may occur only on some platforms) */
2697    case ERROR_CANNOT_GET_COUNT:
2698    case ERROR_CANNOT_GET_ENABLED:
2699    case ERROR_CANNOT_GET_ITEM:
2700    case ERROR_CANNOT_GET_ITEM_HEIGHT:
2701    case ERROR_CANNOT_GET_SELECTION:
2702    case ERROR_CANNOT_GET_TEXT:
2703    case ERROR_CANNOT_SET_ENABLED:
2704    case ERROR_CANNOT_SET_MENU:
2705    case ERROR_CANNOT_SET_SELECTION:
2706    case ERROR_CANNOT_SET_TEXT:
2707    case ERROR_ITEM_NOT_ADDED:
2708    case ERROR_ITEM_NOT_REMOVED:
2709    case ERROR_NO_HANDLES:
2710    //FALL THROUGH
2711    
2712    /* SWT Failure/Limit (fatal, may occur only on some platforms) */
2713    case ERROR_FAILED_LOAD_LIBRARY:
2714    case ERROR_NO_MORE_CALLBACKS:
2715    case ERROR_NOT_IMPLEMENTED:
2716    case ERROR_UNSPECIFIED: {
2717      SWTError error = new SWTError (code, message);
2718      error.throwable = throwable;
2719      throw error;
2720    }
2721  }
2722  
2723  /* Unknown/Undefined Error */
2724  SWTError error = new SWTError (code, message);
2725  error.throwable = throwable;
2726  throw error;
2727}
2728
2729static {
2730  /*
2731  * These values represent bit masks that may need to
2732  * expand in the future.  Therefore they are not initialized
2733  * in the declaration to stop the compiler from inlining.
2734  */
2735  BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3;
2736  MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND;
2737  
2738  /*
2739  * These values can be different on different platforms.
2740  * Therefore they are not initialized in the declaration
2741  * to stop the compiler from inlining.
2742  */
2743  String platform = getPlatform ();
2744  if ("carbon".equals (platform)) { //$NON-NLS-1$
2745    MOD1 = COMMAND;
2746    MOD2 = SHIFT;
2747    MOD3 = ALT;
2748    MOD4 = CONTROL;
2749  } else {
2750    MOD1 = CONTROL;
2751    MOD2 = SHIFT;
2752    MOD3 = ALT;
2753    MOD4 = 0;
2754  }
2755}
2756}