1 /*******************************************************************************
2 * Copyright (c) 2000, 2019 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 * Lars Vogel <Lars.Vogel@vogella.com> - Bug 455263
14 *******************************************************************************/
15 package org.eclipse.swt;
18 import org.eclipse.swt.internal.*;
19 import org.eclipse.swt.widgets.*;
22 * This class provides access to a small number of SWT system-wide
23 * methods, and in addition defines the public constants provided
26 * By defining constants like UP and DOWN in a single class, SWT
27 * can share common names and concepts at the same time minimizing
28 * the number of classes, names and constants for the application
31 * Note that some of the constants provided by this class represent
32 * optional, appearance related aspects of widgets which are available
33 * either only on some window systems, or for a differing set of
34 * widgets on each window system. These constants are marked
35 * as <em>HINT</em>s. The set of widgets which support a particular
36 * <em>HINT</em> may change from release to release, although we typically
37 * will not withdraw support for a <em>HINT</em> once it is made available.
40 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
44 * Good javadoc coding style is to put the values of static final
45 * constants in the comments. This reinforces the fact that
46 * consumers are allowed to rely on the value (and they must
47 * since the values are compiled inline in their code). We
48 * can <em>not</em> change the values of these constants between
53 /* Widget Event Constants */
56 * The null event type (value is 0).
60 public static final int None = 0;
63 * The key down event type (value is 1).
65 * @see org.eclipse.swt.widgets.Widget#addListener
66 * @see org.eclipse.swt.widgets.Display#addFilter
67 * @see org.eclipse.swt.widgets.Event
69 * @see org.eclipse.swt.widgets.Control#addKeyListener
70 * @see org.eclipse.swt.widgets.Tracker#addKeyListener
71 * @see org.eclipse.swt.events.KeyListener#keyPressed
72 * @see org.eclipse.swt.events.KeyEvent
74 public static final int KeyDown = 1;
77 * The key up event type (value is 2).
79 * @see org.eclipse.swt.widgets.Widget#addListener
80 * @see org.eclipse.swt.widgets.Display#addFilter
81 * @see org.eclipse.swt.widgets.Event
83 * @see org.eclipse.swt.widgets.Control#addKeyListener
84 * @see org.eclipse.swt.widgets.Tracker#addKeyListener
85 * @see org.eclipse.swt.events.KeyListener#keyReleased
86 * @see org.eclipse.swt.events.KeyEvent
88 public static final int KeyUp = 2;
91 * The mouse down event type (value is 3).
93 * @see org.eclipse.swt.widgets.Widget#addListener
94 * @see org.eclipse.swt.widgets.Display#addFilter
95 * @see org.eclipse.swt.widgets.Event
97 * @see org.eclipse.swt.widgets.Control#addMouseListener
98 * @see org.eclipse.swt.events.MouseListener#mouseDown
99 * @see org.eclipse.swt.events.MouseEvent
101 public static final int MouseDown = 3;
104 * The mouse up event type (value is 4).
106 * @see org.eclipse.swt.widgets.Widget#addListener
107 * @see org.eclipse.swt.widgets.Display#addFilter
108 * @see org.eclipse.swt.widgets.Event
110 * @see org.eclipse.swt.widgets.Control#addMouseListener
111 * @see org.eclipse.swt.events.MouseListener#mouseUp
112 * @see org.eclipse.swt.events.MouseEvent
114 public static final int MouseUp = 4;
117 * The mouse move event type (value is 5).
119 * @see org.eclipse.swt.widgets.Widget#addListener
120 * @see org.eclipse.swt.widgets.Display#addFilter
121 * @see org.eclipse.swt.widgets.Event
123 * @see org.eclipse.swt.widgets.Control#addMouseMoveListener
124 * @see org.eclipse.swt.events.MouseMoveListener#mouseMove
125 * @see org.eclipse.swt.events.MouseEvent
127 public static final int MouseMove = 5;
130 * The mouse enter event type (value is 6).
132 * @see org.eclipse.swt.widgets.Widget#addListener
133 * @see org.eclipse.swt.widgets.Display#addFilter
134 * @see org.eclipse.swt.widgets.Event
136 * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
137 * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter
138 * @see org.eclipse.swt.events.MouseEvent
140 public static final int MouseEnter = 6;
143 * The mouse exit event type (value is 7).
145 * @see org.eclipse.swt.widgets.Widget#addListener
146 * @see org.eclipse.swt.widgets.Display#addFilter
147 * @see org.eclipse.swt.widgets.Event
149 * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
150 * @see org.eclipse.swt.events.MouseTrackListener#mouseExit
151 * @see org.eclipse.swt.events.MouseEvent
153 public static final int MouseExit = 7;
156 * The mouse double click event type (value is 8).
158 * @see org.eclipse.swt.widgets.Widget#addListener
159 * @see org.eclipse.swt.widgets.Display#addFilter
160 * @see org.eclipse.swt.widgets.Event
162 * @see org.eclipse.swt.widgets.Control#addMouseListener
163 * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick
164 * @see org.eclipse.swt.events.MouseEvent
166 public static final int MouseDoubleClick = 8;
169 * The paint event type (value is 9).
171 * @see org.eclipse.swt.widgets.Widget#addListener
172 * @see org.eclipse.swt.widgets.Display#addFilter
173 * @see org.eclipse.swt.widgets.Event
175 * @see org.eclipse.swt.widgets.Control#addPaintListener
176 * @see org.eclipse.swt.events.PaintListener#paintControl
177 * @see org.eclipse.swt.events.PaintEvent
179 public static final int Paint = 9;
182 * The move event type (value is 10).
184 * @see org.eclipse.swt.widgets.Widget#addListener
185 * @see org.eclipse.swt.widgets.Display#addFilter
186 * @see org.eclipse.swt.widgets.Event
188 * @see org.eclipse.swt.widgets.Control#addControlListener
189 * @see org.eclipse.swt.widgets.TableColumn#addControlListener
190 * @see org.eclipse.swt.widgets.Tracker#addControlListener
191 * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
192 * @see org.eclipse.swt.events.ControlListener#controlMoved
193 * @see org.eclipse.swt.events.ControlEvent
195 public static final int Move = 10;
198 * The resize event type (value is 11).
200 * @see org.eclipse.swt.widgets.Widget#addListener
201 * @see org.eclipse.swt.widgets.Display#addFilter
202 * @see org.eclipse.swt.widgets.Event
204 * @see org.eclipse.swt.widgets.Control#addControlListener
205 * @see org.eclipse.swt.widgets.TableColumn#addControlListener
206 * @see org.eclipse.swt.widgets.Tracker#addControlListener
207 * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
208 * @see org.eclipse.swt.events.ControlListener#controlResized
209 * @see org.eclipse.swt.events.ControlEvent
211 public static final int Resize = 11;
214 * The dispose event type (value is 12).
216 * @see org.eclipse.swt.widgets.Widget#addListener
217 * @see org.eclipse.swt.widgets.Display#addListener
218 * @see org.eclipse.swt.widgets.Display#addFilter
219 * @see org.eclipse.swt.widgets.Event
221 * @see org.eclipse.swt.widgets.Widget#addDisposeListener
222 * @see org.eclipse.swt.events.DisposeListener#widgetDisposed
223 * @see org.eclipse.swt.events.DisposeEvent
225 public static final int Dispose = 12;
228 * The selection event type (value is 13).
230 * @see org.eclipse.swt.widgets.Widget#addListener
231 * @see org.eclipse.swt.widgets.Display#addFilter
232 * @see org.eclipse.swt.widgets.Event
234 * @see org.eclipse.swt.widgets.Button#addSelectionListener
235 * @see org.eclipse.swt.widgets.Combo#addSelectionListener
236 * @see org.eclipse.swt.widgets.CoolItem#addSelectionListener
237 * @see org.eclipse.swt.widgets.Link#addSelectionListener
238 * @see org.eclipse.swt.widgets.List#addSelectionListener
239 * @see org.eclipse.swt.widgets.MenuItem#addSelectionListener
240 * @see org.eclipse.swt.widgets.Sash#addSelectionListener
241 * @see org.eclipse.swt.widgets.Scale#addSelectionListener
242 * @see org.eclipse.swt.widgets.ScrollBar#addSelectionListener
243 * @see org.eclipse.swt.widgets.Slider#addSelectionListener
244 * @see org.eclipse.swt.widgets.TabFolder#addSelectionListener
245 * @see org.eclipse.swt.widgets.Table#addSelectionListener
246 * @see org.eclipse.swt.widgets.TableColumn#addSelectionListener
247 * @see org.eclipse.swt.widgets.ToolItem#addSelectionListener
248 * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
249 * @see org.eclipse.swt.widgets.Tree#addSelectionListener
250 * @see org.eclipse.swt.widgets.TreeColumn#addSelectionListener
251 * @see org.eclipse.swt.events.SelectionListener#widgetSelected
252 * @see org.eclipse.swt.events.SelectionEvent
254 public static final int Selection = 13;
257 * The default selection event type (value is 14).
259 * @see org.eclipse.swt.widgets.Widget#addListener
260 * @see org.eclipse.swt.widgets.Display#addFilter
261 * @see org.eclipse.swt.widgets.Event
263 * @see org.eclipse.swt.widgets.Combo#addSelectionListener
264 * @see org.eclipse.swt.widgets.List#addSelectionListener
265 * @see org.eclipse.swt.widgets.Spinner#addSelectionListener
266 * @see org.eclipse.swt.widgets.Table#addSelectionListener
267 * @see org.eclipse.swt.widgets.Text#addSelectionListener
268 * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
269 * @see org.eclipse.swt.widgets.Tree#addSelectionListener
270 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
271 * @see org.eclipse.swt.events.SelectionEvent
273 public static final int DefaultSelection = 14;
276 * The focus in event type (value is 15).
278 * @see org.eclipse.swt.widgets.Widget#addListener
279 * @see org.eclipse.swt.widgets.Display#addFilter
280 * @see org.eclipse.swt.widgets.Event
282 * @see org.eclipse.swt.widgets.Control#addFocusListener
283 * @see org.eclipse.swt.events.FocusListener#focusGained
284 * @see org.eclipse.swt.events.FocusEvent
286 public static final int FocusIn = 15;
289 * The focus out event type (value is 16).
291 * @see org.eclipse.swt.widgets.Widget#addListener
292 * @see org.eclipse.swt.widgets.Display#addFilter
293 * @see org.eclipse.swt.widgets.Event
295 * @see org.eclipse.swt.widgets.Control#addFocusListener
296 * @see org.eclipse.swt.events.FocusListener#focusLost
297 * @see org.eclipse.swt.events.FocusEvent
299 public static final int FocusOut = 16;
302 * The expand event type (value is 17).
304 * @see org.eclipse.swt.widgets.Widget#addListener
305 * @see org.eclipse.swt.widgets.Display#addFilter
306 * @see org.eclipse.swt.widgets.Event
308 * @see org.eclipse.swt.widgets.Tree#addTreeListener
309 * @see org.eclipse.swt.events.TreeListener#treeExpanded
310 * @see org.eclipse.swt.events.TreeEvent
312 public static final int Expand = 17;
315 * The collapse event type (value is 18).
317 * @see org.eclipse.swt.widgets.Widget#addListener
318 * @see org.eclipse.swt.widgets.Display#addFilter
319 * @see org.eclipse.swt.widgets.Event
321 * @see org.eclipse.swt.widgets.Tree#addTreeListener
322 * @see org.eclipse.swt.events.TreeListener#treeCollapsed
323 * @see org.eclipse.swt.events.TreeEvent
325 public static final int Collapse = 18;
328 * The iconify event type (value is 19).
330 * @see org.eclipse.swt.widgets.Widget#addListener
331 * @see org.eclipse.swt.widgets.Display#addFilter
332 * @see org.eclipse.swt.widgets.Event
334 * @see org.eclipse.swt.widgets.Shell#addShellListener
335 * @see org.eclipse.swt.events.ShellListener#shellIconified
336 * @see org.eclipse.swt.events.ShellEvent
338 public static final int Iconify = 19;
341 * The de-iconify event type (value is 20).
343 * @see org.eclipse.swt.widgets.Widget#addListener
344 * @see org.eclipse.swt.widgets.Display#addFilter
345 * @see org.eclipse.swt.widgets.Event
347 * @see org.eclipse.swt.widgets.Shell#addShellListener
348 * @see org.eclipse.swt.events.ShellListener#shellDeiconified
349 * @see org.eclipse.swt.events.ShellEvent
351 public static final int Deiconify = 20;
354 * The close event type (value is 21).
356 * @see org.eclipse.swt.widgets.Widget#addListener
357 * @see org.eclipse.swt.widgets.Display#addListener
358 * @see org.eclipse.swt.widgets.Display#addFilter
359 * @see org.eclipse.swt.widgets.Event
361 * @see org.eclipse.swt.widgets.Shell#addShellListener
362 * @see org.eclipse.swt.events.ShellListener#shellClosed
363 * @see org.eclipse.swt.events.ShellEvent
365 public static final int Close = 21;
368 * The show event type (value is 22).
370 * @see org.eclipse.swt.widgets.Widget#addListener
371 * @see org.eclipse.swt.widgets.Display#addFilter
372 * @see org.eclipse.swt.widgets.Event
374 * @see org.eclipse.swt.widgets.Menu#addMenuListener
375 * @see org.eclipse.swt.events.MenuListener#menuShown
376 * @see org.eclipse.swt.events.MenuEvent
378 public static final int Show = 22;
381 * The hide event type (value is 23).
383 * @see org.eclipse.swt.widgets.Widget#addListener
384 * @see org.eclipse.swt.widgets.Display#addFilter
385 * @see org.eclipse.swt.widgets.Event
387 * @see org.eclipse.swt.widgets.Menu#addMenuListener
388 * @see org.eclipse.swt.events.MenuListener#menuHidden
389 * @see org.eclipse.swt.events.MenuEvent
391 public static final int Hide = 23;
394 * The modify event type (value is 24).
396 * @see org.eclipse.swt.widgets.Widget#addListener
397 * @see org.eclipse.swt.widgets.Display#addFilter
398 * @see org.eclipse.swt.widgets.Event
400 * @see org.eclipse.swt.widgets.Combo#addModifyListener
401 * @see org.eclipse.swt.widgets.Spinner#addModifyListener
402 * @see org.eclipse.swt.widgets.Text#addModifyListener
403 * @see org.eclipse.swt.events.ModifyListener#modifyText
404 * @see org.eclipse.swt.events.ModifyEvent
406 public static final int Modify = 24;
409 * The verify event type (value is 25).
411 * @see org.eclipse.swt.widgets.Widget#addListener
412 * @see org.eclipse.swt.widgets.Display#addFilter
413 * @see org.eclipse.swt.widgets.Event
415 * @see org.eclipse.swt.custom.CCombo#addVerifyListener
416 * @see org.eclipse.swt.widgets.Combo#addVerifyListener
417 * @see org.eclipse.swt.custom.StyledText#addVerifyListener
418 * @see org.eclipse.swt.widgets.Text#addVerifyListener
419 * @see org.eclipse.swt.events.VerifyListener#verifyText
420 * @see org.eclipse.swt.events.VerifyEvent
422 public static final int Verify = 25;
425 * The activate event type (value is 26).
427 * @see org.eclipse.swt.widgets.Widget#addListener
428 * @see org.eclipse.swt.widgets.Display#addFilter
429 * @see org.eclipse.swt.widgets.Event
431 * @see org.eclipse.swt.widgets.Shell#addShellListener
432 * @see org.eclipse.swt.events.ShellListener#shellActivated
433 * @see org.eclipse.swt.events.ShellEvent
435 public static final int Activate = 26;
438 * The deactivate event type (value is 27).
440 * @see org.eclipse.swt.widgets.Widget#addListener
441 * @see org.eclipse.swt.widgets.Display#addFilter
442 * @see org.eclipse.swt.widgets.Event
444 * @see org.eclipse.swt.widgets.Shell#addShellListener
445 * @see org.eclipse.swt.events.ShellListener#shellDeactivated
446 * @see org.eclipse.swt.events.ShellEvent
448 public static final int Deactivate = 27;
451 * The help event type (value is 28).
453 * @see org.eclipse.swt.widgets.Widget#addListener
454 * @see org.eclipse.swt.widgets.Display#addFilter
455 * @see org.eclipse.swt.widgets.Event
457 * @see org.eclipse.swt.widgets.Control#addHelpListener
458 * @see org.eclipse.swt.widgets.Menu#addHelpListener
459 * @see org.eclipse.swt.widgets.MenuItem#addHelpListener
460 * @see org.eclipse.swt.events.HelpListener#helpRequested
461 * @see org.eclipse.swt.events.HelpEvent
463 public static final int Help = 28;
466 * The drag detect event type (value is 29).
468 * @see org.eclipse.swt.widgets.Widget#addListener
469 * @see org.eclipse.swt.widgets.Display#addFilter
470 * @see org.eclipse.swt.widgets.Event
472 * @see org.eclipse.swt.widgets.Control#addDragDetectListener
473 * @see org.eclipse.swt.events.DragDetectListener#dragDetected
474 * @see org.eclipse.swt.events.DragDetectEvent
475 * @see org.eclipse.swt.dnd.DragSource
477 public static final int DragDetect = 29;
480 * The arm event type (value is 30).
482 * @see org.eclipse.swt.widgets.Widget#addListener
483 * @see org.eclipse.swt.widgets.Display#addFilter
484 * @see org.eclipse.swt.widgets.Event
486 * @see org.eclipse.swt.widgets.MenuItem#addArmListener
487 * @see org.eclipse.swt.events.ArmListener#widgetArmed
488 * @see org.eclipse.swt.events.ArmEvent
490 public static final int Arm = 30;
493 * The traverse event type (value is 31).
495 * @see org.eclipse.swt.widgets.Widget#addListener
496 * @see org.eclipse.swt.widgets.Display#addFilter
497 * @see org.eclipse.swt.widgets.Event
499 * @see org.eclipse.swt.widgets.Control#addTraverseListener
500 * @see org.eclipse.swt.events.TraverseListener#keyTraversed
501 * @see org.eclipse.swt.events.TraverseEvent
503 public static final int Traverse = 31;
506 * The mouse hover event type (value is 32).
508 * @see org.eclipse.swt.widgets.Widget#addListener
509 * @see org.eclipse.swt.widgets.Display#addFilter
510 * @see org.eclipse.swt.widgets.Event
512 * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
513 * @see org.eclipse.swt.events.MouseTrackListener#mouseHover
514 * @see org.eclipse.swt.events.MouseEvent
516 public static final int MouseHover = 32;
519 * The hardware key down event type (value is 33).
521 * @see org.eclipse.swt.widgets.Widget#addListener
522 * @see org.eclipse.swt.widgets.Display#addFilter
523 * @see org.eclipse.swt.widgets.Event
525 public static final int HardKeyDown = 33;
528 * The hardware key up event type (value is 34).
530 * @see org.eclipse.swt.widgets.Widget#addListener
531 * @see org.eclipse.swt.widgets.Display#addFilter
532 * @see org.eclipse.swt.widgets.Event
534 public static final int HardKeyUp = 34;
537 * The menu detect event type (value is 35).
539 * @see org.eclipse.swt.widgets.Widget#addListener
540 * @see org.eclipse.swt.widgets.Display#addFilter
541 * @see org.eclipse.swt.widgets.Event
543 * @see org.eclipse.swt.widgets.Control#addMenuDetectListener
544 * @see org.eclipse.swt.widgets.TrayItem#addMenuDetectListener
545 * @see org.eclipse.swt.events.MenuDetectListener#menuDetected
546 * @see org.eclipse.swt.events.MenuDetectEvent
550 public static final int MenuDetect = 35;
553 * The set data event type (value is 36).
555 * @see org.eclipse.swt.widgets.Widget#addListener
556 * @see org.eclipse.swt.widgets.Display#addFilter
557 * @see org.eclipse.swt.widgets.Event
559 * @see org.eclipse.swt.widgets.Table
560 * @see org.eclipse.swt.widgets.Tree
564 public static final int SetData = 36;
567 * The mouse vertical wheel event type (value is 37).
569 * @see org.eclipse.swt.widgets.Control#addMouseWheelListener
570 * @see org.eclipse.swt.widgets.Display#addFilter
571 * @see org.eclipse.swt.widgets.Event
575 public static final int MouseVerticalWheel = 37;
578 * The mouse horizontal wheel event type (value is 38).
580 * @see org.eclipse.swt.widgets.Widget#addListener
581 * @see org.eclipse.swt.widgets.Display#addFilter
582 * @see org.eclipse.swt.widgets.Event
586 public static final int MouseHorizontalWheel = 38;
589 * The mouse wheel event type (value is 37).
590 * This is a synonym for {@link #MouseVerticalWheel} (value is 37).
591 * Newer applications should use {@link #MouseVerticalWheel} instead
592 * of {@link #MouseWheel} to make code more understandable.
594 * @see org.eclipse.swt.widgets.Control#addMouseWheelListener
595 * @see org.eclipse.swt.widgets.Display#addFilter
596 * @see org.eclipse.swt.widgets.Event
600 public static final int MouseWheel = MouseVerticalWheel;
603 * The settings changed event type (value is 39).
605 * The settings changed event is sent when an operating system
606 * property, such as a system font or color, has been changed.
607 * The event occurs after the property has been changed, but
608 * before any widget is redrawn. Applications that cache operating
609 * system properties can use this event to update their caches.
610 * A specific property change can be detected by querying the
611 * new value of a property and comparing it with the equivalent
612 * cached value. The operating system automatically redraws and
613 * lays out all widgets after this event is sent.
616 * @see org.eclipse.swt.widgets.Display#addListener
617 * @see org.eclipse.swt.widgets.Event
621 public static final int Settings = 39;
624 * The erase item event type (value is 40).
626 * @see org.eclipse.swt.widgets.Widget#addListener
627 * @see org.eclipse.swt.widgets.Display#addFilter
628 * @see org.eclipse.swt.widgets.Event
632 public static final int EraseItem = 40;
635 * The measure item event type (value is 41).
637 * @see org.eclipse.swt.widgets.Widget#addListener
638 * @see org.eclipse.swt.widgets.Display#addFilter
639 * @see org.eclipse.swt.widgets.Event
643 public static final int MeasureItem = 41;
646 * The paint item event type (value is 42).
648 * @see org.eclipse.swt.widgets.Widget#addListener
649 * @see org.eclipse.swt.widgets.Display#addFilter
650 * @see org.eclipse.swt.widgets.Event
654 public static final int PaintItem = 42;
657 * The IME composition event type (value is 43).
659 * The IME composition event is sent to allow
660 * custom text editors to implement in-line
661 * editing of international text.
664 * The detail field indicates the action to be taken:
666 * <li>{@link SWT#COMPOSITION_CHANGED}</li>
667 * <li>{@link SWT#COMPOSITION_OFFSET}</li>
668 * <li>{@link SWT#COMPOSITION_SELECTION}</li>
671 * @see org.eclipse.swt.widgets.Widget#addListener
672 * @see org.eclipse.swt.widgets.Display#addFilter
673 * @see org.eclipse.swt.widgets.Event
677 public static final int ImeComposition = 43;
680 * The orientation change event type (value is 44).
682 * On some platforms the orientation of text widgets
683 * can be changed by keyboard shortcut.
684 * The application can use the <code>doit</code> field
685 * of the event to stop the change from happening.
688 * @see org.eclipse.swt.widgets.Widget#addListener
689 * @see org.eclipse.swt.widgets.Display#addFilter
690 * @see org.eclipse.swt.widgets.Event
694 public static final int OrientationChange = 44;
697 * The skin event type (value is 45).
700 * The skin event is sent by the display when a widget needs to
704 * @see org.eclipse.swt.widgets.Widget#addListener
705 * @see org.eclipse.swt.widgets.Display#addFilter
706 * @see org.eclipse.swt.widgets.Event
707 * @see org.eclipse.swt.widgets.Widget#reskin(int)
711 public static final int Skin = 45;
714 * The open document event type (value is 46).
717 * This event is sent when SWT receives notification that a document
721 * @see org.eclipse.swt.widgets.Display#addListener
722 * @see org.eclipse.swt.widgets.Event
726 public static final int OpenDocument = 46;
729 * The touch event type (value is 47).
732 * This event is sent when a touch has been performed
733 * on a touch-based input source.
736 * @see org.eclipse.swt.widgets.Display#addListener
737 * @see org.eclipse.swt.widgets.Event
741 public static final int Touch = 47;
744 * The gesture event type (value is 48).
747 * This event is sent when a gesture has been performed.
750 * @see org.eclipse.swt.widgets.Display#addListener
751 * @see org.eclipse.swt.widgets.Event
752 * @see SWT#GESTURE_MAGNIFY
753 * @see SWT#GESTURE_PAN
754 * @see SWT#GESTURE_ROTATE
755 * @see SWT#GESTURE_SWIPE
759 public static final int Gesture = 48;
762 * The segments event type (value is 49).
765 * This event is sent when text content has been changed.
768 * @see org.eclipse.swt.widgets.Widget#addListener
769 * @see org.eclipse.swt.widgets.Display#addFilter
770 * @see org.eclipse.swt.widgets.Event
772 * @see org.eclipse.swt.widgets.Text#addSegmentListener
773 * @see org.eclipse.swt.events.SegmentEvent
777 public static final int Segments = 49;
780 * The PreEvent event type (value is 50).
783 * This event is sent before an event other than {@link #PreExternalEventDispatch} or
784 * {@link #PostExternalEventDispatch} is dispatched.
787 * The detail field of the event contains the type of the following event.
792 public static final int PreEvent = 50;
795 * The PostEvent event type (value is 51).
798 * This event is sent after an event other than {@link #PreExternalEventDispatch} or
799 * {@link #PostExternalEventDispatch} is dispatched.
802 * The detail field of the event contains the type of the prior event.
807 public static final int PostEvent = 51;
810 * The PreExternalEventDispatch event type (value is 52).
813 * This event is sent before calling a blocking method that does its own event dispatch outside
819 public static final int PreExternalEventDispatch = 52;
822 * The PostExternalEventDispatch event type (value is 53).
825 * This event is sent after calling a blocking method that does its own event dispatch outside
831 public static final int PostExternalEventDispatch = 53;
834 * @deprecated The same as PreExternalEventDispatch (value is 52).
838 public static final int Sleep = PreExternalEventDispatch;
841 * @deprecated The same as PostExternalEventDispatch (value is 53).
845 public static final int Wakeup = PostExternalEventDispatch;
848 * The open URL event type (value is 54).
851 * This event is sent when SWT receives notification that a URL
855 * @see org.eclipse.swt.widgets.Display#addListener
856 * @see org.eclipse.swt.widgets.Event
860 public static final int OpenUrl = 54;
863 * The SWT zoom change event type (value is 55).
866 * This event is sent on <code>Shell</code> when the SWT zoom has changed. The SWT
867 * zoom changes when the operating system DPI or scale factor changes dynamically.
870 * Note that this is a <em>HINT</em> and is not sent on platforms that do not
871 * support dynamic DPI changes. This event is currently sent on Windows 10 and GTK
875 * @see org.eclipse.swt.widgets.Widget#addListener
876 * @see org.eclipse.swt.widgets.Display#addFilter
877 * @see org.eclipse.swt.widgets.Event
881 public static final int ZoomChanged = 55;
886 * The IME composition event detail that indicates
887 * a change in the IME composition. The text field
888 * of the event is the new composition text.
889 * The start and end indicate the offsets where the
890 * composition text should be inserted.
891 * The styles and ranges are stored in the IME
892 * object (value is 1).
894 * @see SWT#ImeComposition
898 public static final int COMPOSITION_CHANGED = 1;
901 * The IME composition event detail that indicates
902 * that the IME needs the offset for a given location.
903 * The x and y fields of the event are used by the
904 * application to determine the offset.
906 * The index field of the event should be set to the
907 * text offset at that location. The count field should
908 * be set to indicate whether the location is closer to
909 * the leading edge (0) or the trailing edge (1) (value is 2).
911 * @see SWT#ImeComposition
912 * @see org.eclipse.swt.graphics.TextLayout#getOffset(int, int, int[])
916 public static final int COMPOSITION_OFFSET = 2;
919 * The IME composition event detail that indicates
920 * that IME needs the selected text and its start
921 * and end offsets (value is 3).
923 * @see SWT#ImeComposition
927 public static final int COMPOSITION_SELECTION = 3;
930 * Indicates that a user-interface component is being dragged,
931 * for example dragging the thumb of a scroll bar (value is 1).
933 public static final int DRAG = 1;
936 * Event detail field that indicates a user-interface component
937 * state is selected (value is 1<<1).
941 public static final int SELECTED = 1 << 1;
944 * Event detail field that indicates a user-interface component
945 * state is focused (value is 1<<2).
949 public static final int FOCUSED = 1 << 2;
952 * Event detail field that indicates a user-interface component
953 * draws the background (value is 1<<3).
957 public static final int BACKGROUND = 1 << 3;
960 * Event detail field that indicates a user-interface component
961 * draws the foreground (value is 1<<4).
965 public static final int FOREGROUND = 1 << 4;
968 * Event detail field that indicates a user-interface component
969 * state is hot (value is 1<<5).
973 public static final int HOT = 1 << 5;
975 /* This code is intentionally commented */
976 //public static final int PRESSED = 1 << 3;
977 //public static final int ACTIVE = 1 << 4;
978 //public static final int DISABLED = 1 << 5;
979 //public static final int HOT = 1 << 6;
980 //public static final int DEFAULTED = 1 << 7;
983 * Traversal event detail field value indicating that no
984 * traversal action should be taken
987 public static final int TRAVERSE_NONE = 0;
990 * Traversal event detail field value indicating that the
991 * key which designates that a dialog should be cancelled was
992 * pressed; typically, this is the ESC key
993 * (value is 1<<1).
995 public static final int TRAVERSE_ESCAPE = 1 << 1;
998 * Traversal event detail field value indicating that the
999 * key which activates the default button in a dialog was
1000 * pressed; typically, this is the ENTER key
1001 * (value is 1<<2).
1003 public static final int TRAVERSE_RETURN = 1 << 2;
1006 * Traversal event detail field value indicating that the
1007 * key which designates that focus should be given to the
1008 * previous tab group was pressed; typically, this is the
1009 * SHIFT-TAB key sequence
1010 * (value is 1<<3).
1012 public static final int TRAVERSE_TAB_PREVIOUS = 1 << 3;
1015 * Traversal event detail field value indicating that the
1016 * key which designates that focus should be given to the
1017 * next tab group was pressed; typically, this is the
1019 * (value is 1<<4).
1021 public static final int TRAVERSE_TAB_NEXT = 1 << 4;
1024 * Traversal event detail field value indicating that the
1025 * key which designates that focus should be given to the
1026 * previous tab item was pressed; typically, this is either
1027 * the LEFT-ARROW or UP-ARROW keys
1028 * (value is 1<<5).
1030 public static final int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
1033 * Traversal event detail field value indicating that the
1034 * key which designates that focus should be given to the
1035 * previous tab item was pressed; typically, this is either
1036 * the RIGHT-ARROW or DOWN-ARROW keys
1037 * (value is 1<<6).
1039 public static final int TRAVERSE_ARROW_NEXT = 1 << 6;
1042 * Traversal event detail field value indicating that a
1043 * mnemonic key sequence was pressed
1044 * (value is 1<<7).
1046 public static final int TRAVERSE_MNEMONIC = 1 << 7;
1049 * Traversal event detail field value indicating that the
1050 * key which designates that the previous page of a multi-page
1051 * window should be shown was pressed; typically, this
1052 * is the CTRL-PAGEUP key sequence
1053 * (value is 1<<8).
1055 public static final int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
1058 * Traversal event detail field value indicating that the
1059 * key which designates that the next page of a multi-page
1060 * window should be shown was pressed; typically, this
1061 * is the CTRL-PAGEDOWN key sequence
1062 * (value is 1<<9).
1064 public static final int TRAVERSE_PAGE_NEXT = 1 << 9;
1067 * Gesture event detail field value indicating that a continuous
1068 * gesture is about to begin.
1072 public static final int GESTURE_BEGIN = 1 << 1;
1075 * Gesture event detail field value indicating that a continuous
1076 * gesture has ended.
1080 public static final int GESTURE_END = 1 << 2;
1083 * Gesture event detail field value indicating that a
1084 * rotation gesture has happened. Only the rotation field
1085 * of the event is valid.
1089 public static final int GESTURE_ROTATE = 1 << 3;
1092 * Gesture event detail field value indicating that a
1093 * swipe gesture has happened.
1097 public static final int GESTURE_SWIPE = 1 << 4;
1100 * Gesture event detail field value indicating that a
1101 * magnification gesture has happened.
1105 public static final int GESTURE_MAGNIFY = 1 << 5;
1108 * Gesture event detail field value indicating that a
1109 * panning (two-finger scroll) gesture has happened.
1113 public static final int GESTURE_PAN = 1 << 6;
1116 * A constant indicating that a finger touched the device.
1118 * @see org.eclipse.swt.widgets.Touch#state
1122 public static final int TOUCHSTATE_DOWN = 1 << 0;
1125 * A constant indicating that a finger moved on the device.
1127 * @see org.eclipse.swt.widgets.Touch#state
1131 public static final int TOUCHSTATE_MOVE = 1 << 1;
1134 * A constant indicating that a finger was lifted from the device.
1136 * @see org.eclipse.swt.widgets.Touch#state
1140 public static final int TOUCHSTATE_UP = 1 << 2;
1143 * MenuDetect event detail value indicating that a context menu
1144 * was requested by a mouse or other pointing device (value is 0).
1148 public static final int MENU_MOUSE = 0;
1151 * MenuDetect event detail value indicating that a context menu
1152 * was requested by a keyboard or other focus-based device (value is 1).
1156 public static final int MENU_KEYBOARD = 1;
1159 * A constant indicating that widgets have changed.
1160 * (value is 1<<1).
1162 * <p><b>Used By:</b></p>
1164 * <li><code>Composite</code> layout</li>
1167 * @see org.eclipse.swt.widgets.Composite#layout(org.eclipse.swt.widgets.Control[], int)
1171 public static final int CHANGED = 1 << 1;
1174 * A constant indicating that a given operation should be deferred.
1175 * (value is 1<<2).
1177 * <p><b>Used By:</b></p>
1179 * <li><code>Composite</code> layout</li>
1182 * @see org.eclipse.swt.widgets.Composite#layout(org.eclipse.swt.widgets.Control[], int)
1186 public static final int DEFER = 1 << 2;
1189 * A constant known to be zero (0), typically used in operations
1190 * which take bit flags to indicate that "no bits are set".
1192 public static final int NONE = 0;
1195 * A constant known to be zero (0), used in operations which
1196 * take pointers to indicate a null argument.
1198 public static final int NULL = 0;
1201 * Indicates that a default should be used (value is -1).
1203 public static final int DEFAULT = -1;
1206 * Indicates that a property is off (value is 0).
1210 public static final int OFF = 0;
1213 * Indicates that a property is on (value is 1).
1217 public static final int ON = 1;
1220 * Indicates low quality (value is 1).
1224 public static final int LOW = 1;
1227 * Indicates high quality (value is 2).
1231 public static final int HIGH = 2;
1234 * Style constant for menu bar behavior (value is 1<<1).
1235 * <p><b>Used By:</b></p>
1237 * <li><code>Menu</code></li>
1240 public static final int BAR = 1 << 1;
1243 * Style constant for drop down menu/list behavior (value is 1<<2).
1244 * <p><b>Used By:</b></p>
1246 * <li><code>Menu</code></li>
1247 * <li><code>ToolItem</code></li>
1248 * <li><code>CoolItem</code></li>
1249 * <li><code>Combo</code></li>
1250 * <li><code>DateTime</code></li>
1253 public static final int DROP_DOWN = 1 << 2;
1256 * Style constant for pop up menu behavior (value is 1<<3).
1257 * <p><b>Used By:</b></p>
1259 * <li><code>Menu</code></li>
1262 public static final int POP_UP = 1 << 3;
1265 * Style constant for line separator behavior (value is 1<<1).
1266 * <p><b>Used By:</b></p>
1268 * <li><code>Label</code></li>
1269 * <li><code>MenuItem</code></li>
1270 * <li><code>ToolItem</code></li>
1273 public static final int SEPARATOR = 1 << 1;
1276 * Constant representing a flexible space separator in a ToolBar.
1277 * <p><b>Used By:</b></p>
1279 * <li><code>ToolItem.setWidth()</code></li>
1284 public static final int SEPARATOR_FILL = -2;
1287 * Style constant for toggle button behavior (value is 1<<1).
1288 * <p><b>Used By:</b></p>
1290 * <li><code>Button</code></li>
1293 public static final int TOGGLE = 1 << 1;
1296 * Style constant for arrow button behavior (value is 1<<2).
1297 * <p><b>Used By:</b></p>
1299 * <li><code>Button</code></li>
1302 public static final int ARROW = 1 << 2;
1305 * Style constant for push button behavior (value is 1<<3).
1306 * <p><b>Used By:</b></p>
1308 * <li><code>Button</code></li>
1309 * <li><code>MenuItem</code></li>
1310 * <li><code>ToolItem</code></li>
1313 public static final int PUSH = 1 << 3;
1316 * Style constant for radio button behavior (value is 1<<4).
1317 * <p><b>Used By:</b></p>
1319 * <li><code>Button</code></li>
1320 * <li><code>MenuItem</code></li>
1321 * <li><code>ToolItem</code></li>
1324 public static final int RADIO = 1 << 4;
1327 * Style constant for check box behavior (value is 1<<5).
1328 * <p><b>Used By:</b></p>
1330 * <li><code>Button</code></li>
1331 * <li><code>MenuItem</code></li>
1332 * <li><code>ToolItem</code></li>
1333 * <li><code>Table</code></li>
1334 * <li><code>Tree</code></li>
1337 public static final int CHECK = 1 << 5;
1340 * Style constant for cascade behavior (value is 1<<6).
1341 * <p><b>Used By:</b></p>
1343 * <li><code>MenuItem</code></li>
1346 public static final int CASCADE = 1 << 6;
1349 * Style constant for multi-selection behavior in lists
1350 * and multiple line support on text fields (value is 1<<1).
1351 * <p><b>Used By:</b></p>
1353 * <li><code>Text</code></li>
1354 * <li><code>List</code></li>
1355 * <li><code>Table</code></li>
1356 * <li><code>Tree</code></li>
1357 * <li><code>FileDialog</code></li>
1360 public static final int MULTI = 1 << 1;
1363 * Style constant for single selection behavior in lists
1364 * and single line support on text fields (value is 1<<2).
1365 * <p><b>Used By:</b></p>
1367 * <li><code>Text</code></li>
1368 * <li><code>List</code></li>
1369 * <li><code>Table</code></li>
1370 * <li><code>Tree</code></li>
1373 public static final int SINGLE = 1 << 2;
1376 * Style constant for read-only behavior (value is 1<<3).
1377 * <p><b>Used By:</b></p>
1379 * <li><code>Combo</code></li>
1380 * <li><code>Text</code></li>
1383 public static final int READ_ONLY = 1 << 3;
1386 * Style constant for automatic line wrap behavior (value is 1<<6).
1387 * <p><b>Used By:</b></p>
1389 * <li><code>Button</code></li>
1390 * <li><code>Label</code></li>
1391 * <li><code>Text</code></li>
1392 * <li><code>ToolBar</code></li>
1393 * <li><code>Spinner</code></li>
1396 public static final int WRAP = 1 << 6;
1399 * Style constant for search behavior (value is 1<<7).
1400 * <p><b>Used By:</b></p>
1402 * <li><code>Text</code></li>
1407 public static final int SEARCH = 1 << 7;
1410 * Style constant for simple (not drop down) behavior (value is 1<<6).
1411 * <br>Note that this is a <em>HINT</em>.
1412 * <p><b>Used By:</b></p>
1414 * <li><code>Combo</code></li>
1417 public static final int SIMPLE = 1 << 6;
1420 * Style constant for password behavior (value is 1<<22).
1421 * <p><b>Used By:</b></p>
1423 * <li><code>Text</code></li>
1428 public static final int PASSWORD = 1 << 22;
1431 * Style constant for shadow in behavior (value is 1<<2).
1432 * <br>Note that this is a <em>HINT</em>.
1433 * <p><b>Used By:</b></p>
1435 * <li><code>Label</code></li>
1436 * <li><code>Group</code></li>
1439 public static final int SHADOW_IN = 1 << 2;
1442 * Style constant for shadow out behavior (value is 1<<3).
1443 * <br>Note that this is a <em>HINT</em>.
1444 * <p><b>Used By:</b></p>
1446 * <li><code>Label</code></li>
1447 * <li><code>Group</code></li>
1448 * <li><code>ToolBar</code></li>
1451 public static final int SHADOW_OUT = 1 << 3;
1454 * Style constant for shadow etched in behavior (value is 1<<4).
1455 * <br>Note that this is a <em>HINT</em>. It is currently ignored on all platforms.
1456 * <p><b>Used By:</b></p>
1458 * <li><code>Group</code></li>
1461 public static final int SHADOW_ETCHED_IN = 1 << 4;
1464 * Style constant for shadow etched out behavior (value is 1<<6).
1465 * <br>Note that this is a <em>HINT</em>. It is currently ignored on all platforms.
1466 * <p><b>Used By:</b></p>
1468 * <li><code>Group</code></li>
1471 public static final int SHADOW_ETCHED_OUT = 1 << 6;
1474 * Style constant for no shadow behavior (value is 1<<5).
1475 * <br>Note that this is a <em>HINT</em>.
1476 * <p><b>Used By:</b></p>
1478 * <li><code>Label</code></li>
1479 * <li><code>Group</code></li>
1482 public static final int SHADOW_NONE = 1 << 5;
1485 * Style constant for progress bar behavior (value is 1<<1).
1486 * <p><b>Used By:</b></p>
1488 * <li><code>ProgressBar</code></li>
1491 public static final int INDETERMINATE = 1 << 1;
1494 * Style constant for tool window behavior (value is 1<<2).
1496 * A tool window is a window intended to be used as a floating toolbar.
1497 * It typically has a title bar that is shorter than a normal title bar,
1498 * and the window title is typically drawn using a smaller font.
1499 * <br>Note that this is a <em>HINT</em>.
1500 * </p><p><b>Used By:</b></p>
1502 * <li><code>Decorations</code> and subclasses</li>
1505 public static final int TOOL = 1 << 2;
1508 * Style constant to ensure no trimmings are used (value is 1<<3).
1509 * <br>Note that this overrides all other trim styles.
1510 * <p><b>Used By:</b></p>
1512 * <li><code>Decorations</code> and subclasses</li>
1515 public static final int NO_TRIM = 1 << 3;
1518 * Style constant for resize box trim (value is 1<<4).
1519 * <p><b>Used By:</b></p>
1521 * <li><code>Decorations</code> and subclasses</li>
1522 * <li><code>Tracker</code></li>
1525 public static final int RESIZE = 1 << 4;
1528 * Style constant for title area trim (value is 1<<5).
1529 * <p><b>Used By:</b></p>
1531 * <li><code>Decorations</code> and subclasses</li>
1534 public static final int TITLE = 1 << 5;
1537 * Style constant for close box trim (value is 1<<6,
1538 * since we do not distinguish between CLOSE style and MENU style).
1539 * <p><b>Used By:</b></p>
1541 * <li><code>Decorations</code> and subclasses</li>
1544 public static final int CLOSE = 1 << 6;
1547 * Style constant for shell menu trim (value is 1<<6,
1548 * since we do not distinguish between CLOSE style and MENU style).
1549 * <p><b>Used By:</b></p>
1551 * <li><code>Decorations</code> and subclasses</li>
1554 public static final int MENU = CLOSE;
1557 * Style constant for minimize box trim (value is 1<<7).
1558 * <p><b>Used By:</b></p>
1560 * <li><code>Decorations</code> and subclasses</li>
1563 public static final int MIN = 1 << 7;
1566 * Style constant for maximize box trim (value is 1<<10).
1567 * <p><b>Used By:</b></p>
1569 * <li><code>Decorations</code> and subclasses</li>
1572 public static final int MAX = 1 << 10;
1575 * Style constant for the no move behavior (value is 1<<23).
1576 * Creates the title trim when no other trim style is specified.
1577 * Doesn't create the title trim when NO_TRIM is specified.
1578 * <p>Note that this is a <em>HINT</em>.
1579 * <p><b>Used By:</b></p>
1581 * <li><code>Shell</code></li>
1585 public static final int NO_MOVE = 1 << 23;
1588 * Style constant for horizontal scrollbar behavior (value is 1<<8).
1589 * <p><b>Used By:</b></p>
1591 * <li><code>Scrollable</code> and subclasses</li>
1594 public static final int H_SCROLL = 1 << 8;
1597 * Style constant for vertical scrollbar behavior (value is 1<<9).
1598 * <p><b>Used By:</b></p>
1600 * <li><code>Scrollable</code> and subclasses</li>
1603 public static final int V_SCROLL = 1 << 9;
1606 * Style constant for no scrollbar behavior (value is 1<<4).
1608 * When neither H_SCROLL or V_SCROLL are specified, controls
1609 * are free to create the default scroll bars for the control.
1610 * Using NO_SCROLL overrides the default and forces the control
1611 * to have no scroll bars.
1613 * <b>Used By:</b></p>
1615 * <li><code>Tree</code></li>
1616 * <li><code>Table</code></li>
1621 public static final int NO_SCROLL = 1 << 4;
1624 * Style constant for bordered behavior (value is 1<<11).
1625 * <br>Note that this is a <em>HINT</em>.
1626 * <p><b>Used By:</b></p>
1628 * <li><code>Control</code> and subclasses</li>
1631 public static final int BORDER = 1 << 11;
1634 * Style constant indicating that the window manager should clip
1635 * a widget's children with respect to its viewable area. (value is 1<<12).
1636 * <br>Note that this is a <em>HINT</em>.
1637 * <p><b>Used By:</b></p>
1639 * <li><code>Control</code> and subclasses</li>
1642 public static final int CLIP_CHILDREN = 1 << 12;
1645 * Style constant indicating that the window manager should clip
1646 * a widget's siblings with respect to its viewable area. (value is 1<<13).
1647 * <br>Note that this is a <em>HINT</em>.
1648 * <p><b>Used By:</b></p>
1650 * <li><code>Control</code> and subclasses</li>
1653 public static final int CLIP_SIBLINGS = 1 << 13;
1656 * Style constant for always on top behavior (value is 1<<14).
1657 * <br>Note that this is a <em>HINT</em>.
1658 * <p><b>Used By:</b></p>
1660 * <li><code>Shell</code> and subclasses</li>
1663 public static final int ON_TOP = 1 << 14;
1666 * Style constant for sheet window behavior (value is 1<<28).
1668 * A sheet window is a window intended to be used as a temporary modal
1669 * dialog that is attached to a parent window. It is typically used to
1670 * prompt the user before proceeding. The window trim, positioning and
1671 * general look of a sheet window is platform specific. For example,
1672 * on the Macintosh, at the time this documentation was written, the
1673 * window title is not visible.
1674 * <br>Note that this is a <em>HINT</em>.
1675 * </p><p><b>Used By:</b></p>
1677 * <li><code>Dialog</code> and subclasses</li>
1678 * <li><code>Shell</code> and subclasses</li>
1683 public static final int SHEET = 1 << 28;
1686 * Trim style convenience constant for the most common top level shell appearance
1687 * (value is CLOSE|TITLE|MIN|MAX|RESIZE).
1688 * <p><b>Used By:</b></p>
1690 * <li><code>Shell</code></li>
1693 public static final int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE;
1696 * Trim style convenience constant for the most common dialog shell appearance
1697 * (value is CLOSE|TITLE|BORDER).
1698 * <p><b>Used By:</b></p>
1700 * <li><code>Shell</code></li>
1703 public static final int DIALOG_TRIM = TITLE | CLOSE | BORDER;
1706 * Style constant for modeless behavior (value is 0).
1707 * <br>Note that this is a <em>HINT</em>.
1708 * <p><b>Used By:</b></p>
1710 * <li><code>Dialog</code></li>
1711 * <li><code>Shell</code></li>
1714 public static final int MODELESS = 0;
1717 * Style constant for primary modal behavior (value is 1<<15).
1718 * <br>Note that this is a <em>HINT</em>.
1719 * <p><b>Used By:</b></p>
1721 * <li><code>Dialog</code></li>
1722 * <li><code>Shell</code></li>
1725 public static final int PRIMARY_MODAL = 1 << 15;
1728 * Style constant for application modal behavior (value is 1<<16).
1729 * <br>Note that this is a <em>HINT</em>.
1730 * <p><b>Used By:</b></p>
1732 * <li><code>Dialog</code></li>
1733 * <li><code>Shell</code></li>
1736 public static final int APPLICATION_MODAL = 1 << 16;
1739 * Style constant for system modal behavior (value is 1<<17).
1740 * <br>Note that this is a <em>HINT</em>.
1741 * <p><b>Used By:</b></p>
1743 * <li><code>Dialog</code></li>
1744 * <li><code>Shell</code></li>
1747 public static final int SYSTEM_MODAL = 1 << 17;
1750 * Style constant for selection hiding behavior when the widget loses focus (value is 1<<15).
1751 * <br>Note that this is a <em>HINT</em>.
1752 * <p><b>Used By:</b></p>
1754 * <li><code>Table</code></li>
1757 public static final int HIDE_SELECTION = 1 << 15;
1760 * Style constant for full row selection behavior and
1761 * selection constant indicating that a full line should be
1762 * drawn. (value is 1<<16).
1763 * <br>Note that for some widgets this is a <em>HINT</em>.
1764 * <p><b>Used By:</b></p>
1766 * <li><code>Table</code></li>
1767 * <li><code>Tree</code></li>
1768 * <li><code>StyledText</code></li>
1769 * <li><code>TextLayout</code></li>
1772 public static final int FULL_SELECTION = 1 << 16;
1775 * Style constant for flat appearance. (value is 1<<23).
1776 * <br>Note that this is a <em>HINT</em>.
1777 * <p><b>Used By:</b></p>
1779 * <li><code>Button</code></li>
1780 * <li><code>ToolBar</code></li>
1783 public static final int FLAT = 1 << 23;
1786 * Style constant for smooth appearance. (value is 1<<16).
1787 * <br>Note that this is a <em>HINT</em>.
1788 * <p><b>Used By:</b></p><ul>
1789 * <li><code>ProgressBar</code></li>
1790 * <li><code>Sash</code></li>
1793 public static final int SMOOTH = 1 << 16;
1796 * Style constant for no background behavior (value is 1<<18).
1798 * By default, before a widget paints, the client area is filled with the current background.
1799 * When this style is specified, the background is not filled, and the application is responsible
1800 * for filling every pixel of the client area.
1801 * This style might be used as an alternative to "double-buffering" in order to reduce flicker.
1802 * This style does not mean "transparent" - widgets that are obscured will not draw through.
1803 * </p><p><b>Used By:</b></p>
1805 * <li><code>Composite</code></li>
1808 public static final int NO_BACKGROUND = 1 << 18;
1811 * Style constant for no focus from the mouse behavior (value is 1<<19).
1813 * Normally, when the user clicks on a control, focus is assigned to that
1814 * control, providing the control has no children. Some controls, such as
1815 * tool bars and sashes, don't normally take focus when the mouse is clicked
1816 * or accept focus when assigned from within the program. This style allows
1817 * Composites to implement "no focus" mouse behavior.
1819 * <br>Note that this is a <em>HINT</em>.
1821 * <p><b>Used By:</b></p>
1823 * <li><code>Composite</code></li>
1826 public static final int NO_FOCUS = 1 << 19;
1829 * Style constant for no redraw on resize behavior (value is 1<<20).
1831 * This style stops the entire client area from being invalidated when the size
1832 * of the Canvas changes. Specifically, when the size of the Canvas gets smaller,
1833 * the SWT.Paint event is not sent. When it gets bigger, an SWT.Paint event is
1834 * sent with a GC clipped to only the new areas to be painted. Without this
1835 * style, the entire client area will be repainted.
1837 * <br>Note that this is a <em>HINT</em>.
1838 * </p><p><b>Used By:</b></p>
1840 * <li><code>Composite</code></li>
1843 public static final int NO_REDRAW_RESIZE = 1 << 20;
1846 * Style constant for no paint event merging behavior (value is 1<<21).
1848 * <br>Note that this is a <em>HINT</em>.
1849 * <p><b>Used By:</b></p>
1851 * <li><code>Composite</code></li>
1854 public static final int NO_MERGE_PAINTS = 1 << 21;
1857 * Style constant for preventing child radio group behavior (value is 1<<22).
1858 * <p><b>Used By:</b></p>
1860 * <li><code>Composite</code></li>
1861 * <li><code>Menu</code></li>
1864 public static final int NO_RADIO_GROUP = 1 << 22;
1867 * Style constant for left to right orientation (value is 1<<25).
1869 * When orientation is not explicitly specified, orientation is
1870 * inherited. This means that children will be assigned the
1871 * orientation of their parent. To override this behavior and
1872 * force an orientation for a child, explicitly set the orientation
1873 * of the child when that child is created.
1874 * <br>Note that this is a <em>HINT</em>.
1876 * <p><b>Used By:</b></p>
1878 * <li><code>Control</code></li>
1879 * <li><code>Menu</code></li>
1880 * <li><code>GC</code></li>
1885 public static final int LEFT_TO_RIGHT = 1 << 25;
1888 * Style constant for right to left orientation (value is 1<<26).
1890 * When orientation is not explicitly specified, orientation is
1891 * inherited. This means that children will be assigned the
1892 * orientation of their parent. To override this behavior and
1893 * force an orientation for a child, explicitly set the orientation
1894 * of the child when that child is created.
1895 * <br>Note that this is a <em>HINT</em>.
1897 * <p><b>Used By:</b></p>
1899 * <li><code>Control</code></li>
1900 * <li><code>Menu</code></li>
1901 * <li><code>GC</code></li>
1906 public static final int RIGHT_TO_LEFT = 1 << 26;
1909 * Style constant to indicate coordinate mirroring (value is 1<<27).
1910 * <p><b>Used By:</b></p>
1912 * <li><code>Control</code></li>
1913 * <li><code>Menu</code></li>
1918 public static final int MIRRORED = 1 << 27;
1921 * Style constant to allow embedding (value is 1<<24).
1922 * <p><b>Used By:</b></p>
1924 * <li><code>Composite</code></li>
1929 public static final int EMBEDDED = 1 << 24;
1932 * Style constant to allow virtual data (value is 1<<28).
1933 * <p><b>Used By:</b></p>
1935 * <li><code>Table</code></li>
1936 * <li><code>Tree</code></li>
1941 public static final int VIRTUAL = 1 << 28;
1944 * Style constant to indicate double buffering (value is 1<<29).
1945 * <p><b>Used By:</b></p>
1947 * <li><code>Control</code></li>
1952 public static final int DOUBLE_BUFFERED = 1 << 29;
1955 * Style constant for transparent behavior (value is 1<<30).
1957 * By default, before a widget paints, the client area is filled with the current background.
1958 * When this style is specified, the background is not filled and widgets that are obscured
1959 * will draw through.
1960 * </p><p><b>Used By:</b></p>
1962 * <li><code>Composite</code></li>
1967 * WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED
1969 public static final int TRANSPARENT = 1 << 30;
1972 * Style constant to indicate base text direction (value is 1<<31).
1974 * When the bit is set, text direction mismatches the widget orientation.
1975 * <br>Note that this is a <em>HINT</em>.
1977 * <p><b>Used By:</b></p>
1979 * <li><code>Control</code></li>
1982 * @see org.eclipse.swt.widgets.Control#setTextDirection(int)
1983 * @see org.eclipse.swt.widgets.Control#getTextDirection()
1987 public static final int FLIP_TEXT_DIRECTION = 1 << 31;
1990 * A bit mask to indicate Bidi "auto" text direction.
1992 * When the bit is set, text direction is derived from the direction of the
1993 * first strong Bidi character.
1995 * <br>Note that this is a <em>HINT</em> and it works on Windows only.
1996 * <p><b>Used By:</b></p>
1998 * <li><code>Control</code></li>
1999 * <li><code>TextLayout</code></li>
2002 * @see org.eclipse.swt.widgets.Control#setTextDirection(int)
2003 * @see org.eclipse.swt.graphics.TextLayout#setTextDirection(int)
2007 public static final int AUTO_TEXT_DIRECTION = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
2010 * Style constant for align up behavior (value is 1<<7,
2011 * since align UP and align TOP are considered the same).
2012 * <p><b>Used By:</b></p>
2014 * <li><code>Button</code> with <code>ARROW</code> style</li>
2015 * <li><code>Tracker</code></li>
2016 * <li><code>Table</code></li>
2017 * <li><code>Tree</code></li>
2020 public static final int UP = 1 << 7;
2023 * Style constant to indicate single underline (value is 0).
2024 * <p><b>Used By:</b></p>
2026 * <li><code>TextStyle</code></li>
2031 public static final int UNDERLINE_SINGLE = 0;
2034 * Style constant to indicate double underline (value is 1).
2035 * <p><b>Used By:</b></p>
2037 * <li><code>TextStyle</code></li>
2042 public static final int UNDERLINE_DOUBLE = 1;
2045 * Style constant to indicate error underline (value is 2).
2046 * <p><b>Used By:</b></p>
2048 * <li><code>TextStyle</code></li>
2053 public static final int UNDERLINE_ERROR = 2;
2056 * Style constant to indicate squiggle underline (value is 3).
2057 * <p><b>Used By:</b></p>
2059 * <li><code>TextStyle</code></li>
2064 public static final int UNDERLINE_SQUIGGLE = 3;
2067 * Style constant to indicate link underline (value is 0).
2069 * If the text color or the underline color are not set in the range
2070 * the usage of <code>UNDERLINE_LINK</code> will change these colors
2071 * to the preferred link color of the platform.<br>
2072 * Note that clients that use this style, such as <code>StyledText</code>,
2073 * will include code to track the mouse and change the cursor to the hand
2074 * cursor when mouse is over the link.
2076 * <p><b>Used By:</b></p>
2078 * <li><code>TextStyle</code></li>
2083 public static final int UNDERLINE_LINK = 4;
2086 * Style constant to indicate solid border (value is 1).
2087 * <p><b>Used By:</b></p>
2089 * <li><code>TextStyle</code></li>
2094 public static final int BORDER_SOLID = 1;
2097 * Style constant to indicate dashed border (value is 2).
2098 * <p><b>Used By:</b></p>
2100 * <li><code>TextStyle</code></li>
2105 public static final int BORDER_DASH = 2;
2108 * Style constant to indicate dotted border (value is 4).
2109 * <p><b>Used By:</b></p>
2111 * <li><code>TextStyle</code></li>
2116 public static final int BORDER_DOT = 4;
2119 * Style constant for align top behavior (value is 1<<7,
2120 * since align UP and align TOP are considered the same).
2121 * <p><b>Used By:</b></p>
2123 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
2126 public static final int TOP = UP;
2129 * Style constant for align down behavior (value is 1<<10,
2130 * since align DOWN and align BOTTOM are considered the same).
2131 * <p><b>Used By:</b></p>
2133 * <li><code>Button</code> with <code>ARROW</code> style</li>
2134 * <li><code>Tracker</code></li>
2135 * <li><code>Table</code></li>
2136 * <li><code>Tree</code></li>
2139 public static final int DOWN = 1 << 10;
2142 * Style constant for align bottom behavior (value is 1<<10,
2143 * since align DOWN and align BOTTOM are considered the same).
2144 * <p><b>Used By:</b></p>
2146 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
2147 * <li><code>TabFolder</code></li>
2150 public static final int BOTTOM = DOWN;
2153 * Style constant for leading alignment (value is 1<<14).
2154 * <p><b>Used By:</b></p>
2156 * <li><code>Button</code></li>
2157 * <li><code>Label</code></li>
2158 * <li><code>Text</code></li>
2159 * <li><code>TableColumn</code></li>
2160 * <li><code>TreeColumn</code></li>
2161 * <li><code>Tracker</code></li>
2162 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
2167 public static final int LEAD = 1 << 14;
2170 * Style constant for align left behavior (value is 1<<14).
2171 * This is a synonym for {@link #LEAD} (value is 1<<14). Newer
2172 * applications should use {@link #LEAD} instead of {@link #LEFT} to make code more
2173 * understandable on right-to-left platforms.
2175 * This constant can also be used to representing the left keyboard
2176 * location during a key event.
2179 public static final int LEFT = LEAD;
2182 * Style constant for trailing alignment (value is 1<<17).
2183 * <p><b>Used By:</b></p>
2185 * <li><code>Button</code></li>
2186 * <li><code>Label</code></li>
2187 * <li><code>Text</code></li>
2188 * <li><code>TableColumn</code></li>
2189 * <li><code>TreeColumn</code></li>
2190 * <li><code>Tracker</code></li>
2191 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
2196 public static final int TRAIL = 1 << 17;
2199 * Style constant for align right behavior (value is 1<<17).
2200 * This is a synonym for {@link #TRAIL} (value is 1<<17). Newer
2201 * applications should use {@link #TRAIL} instead of {@link #RIGHT} to make code more
2202 * understandable on right-to-left platforms.
2204 * This constant can also be used to representing the right keyboard
2205 * location during a key event.
2208 public static final int RIGHT = TRAIL;
2211 * Style constant for align center behavior (value is 1<<24).
2212 * <p><b>Used By:</b></p>
2214 * <li><code>Button</code></li>
2215 * <li><code>Label</code></li>
2216 * <li><code>TableColumn</code></li>
2217 * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
2220 public static final int CENTER = 1 << 24;
2223 * Style constant for horizontal alignment or orientation behavior (value is 1<<8).
2224 * <p><b>Used By:</b></p>
2226 * <li><code>Label</code></li>
2227 * <li><code>ProgressBar</code></li>
2228 * <li><code>Sash</code></li>
2229 * <li><code>Scale</code></li>
2230 * <li><code>ScrollBar</code></li>
2231 * <li><code>Slider</code></li>
2232 * <li><code>ToolBar</code></li>
2233 * <li><code>FillLayout</code> type</li>
2234 * <li><code>RowLayout</code> type</li>
2237 public static final int HORIZONTAL = 1 << 8;
2240 * Style constant for vertical alignment or orientation behavior (value is 1<<9).
2241 * <p><b>Used By:</b></p>
2243 * <li><code>Label</code></li>
2244 * <li><code>ProgressBar</code></li>
2245 * <li><code>Sash</code></li>
2246 * <li><code>Scale</code></li>
2247 * <li><code>ScrollBar</code></li>
2248 * <li><code>Slider</code></li>
2249 * <li><code>ToolBar</code></li>
2250 * <li><code>CoolBar</code></li>
2251 * <li><code>FillLayout</code> type</li>
2252 * <li><code>RowLayout</code> type</li>
2255 public static final int VERTICAL = 1 << 9;
2258 * Style constant for date display (value is 1<<5).
2259 * <p><b>Used By:</b></p>
2261 * <li><code>DateTime</code></li>
2266 public static final int DATE = 1 << 5;
2269 * Style constant for time display (value is 1<<7).
2270 * <p><b>Used By:</b></p>
2272 * <li><code>DateTime</code></li>
2277 public static final int TIME = 1 << 7;
2280 * Style constant for calendar display (value is 1<<10).
2281 * <p><b>Used By:</b></p>
2283 * <li><code>DateTime</code></li>
2288 public static final int CALENDAR = 1 << 10;
2291 * Style constant for displaying week numbers in the calendar.
2292 * <br>Note that this is a <em>HINT</em> and is supported on Windows & GTK platforms only.
2293 * <p><b>Used By:</b></p>
2295 * <li><code>DateTime</code></li>
2300 public static final int CALENDAR_WEEKNUMBERS = 1 << 14;
2303 * Style constant for short date/time format (value is 1<<15).
2305 * A short date displays the month and year.
2306 * A short time displays hours and minutes.
2307 * <br>Note that this is a <em>HINT</em>.
2309 * <p><b>Used By:</b></p>
2311 * <li><code>DateTime</code></li>
2316 public static final int SHORT = 1 << 15;
2319 * Style constant for medium date/time format (value is 1<<16).
2321 * A medium date displays the day, month and year.
2322 * A medium time displays hours, minutes, and seconds.
2323 * <br>Note that this is a <em>HINT</em>.
2325 * <p><b>Used By:</b></p>
2327 * <li><code>DateTime</code></li>
2332 public static final int MEDIUM = 1 << 16;
2335 * Style constant for long date/time format (value is 1<<28).
2337 * A long date displays the day, month and year.
2338 * A long time displays hours, minutes, and seconds.
2339 * The day and month names may be displayed.
2340 * <br>Note that this is a <em>HINT</em>.
2342 * <p><b>Used By:</b></p>
2344 * <li><code>DateTime</code></li>
2349 public static final int LONG = 1 << 28;
2352 * Style constant specifying that a Browser should use a Mozilla GRE
2353 * for rendering its content (value is 1<<15).
2354 * <p><b>Used By:</b></p>
2356 * <li><code>Browser</code></li>
2360 * @deprecated This style is deprecated and will be removed in the future.
2361 * XULRunner as a browser renderer is no longer supported. Use
2362 * <code>SWT.WEBKIT</code> or <code>SWT.NONE</code> instead.
2365 public static final int MOZILLA = 1 << 15;
2368 * Style constant specifying that a Browser should use WebKit
2369 * for rendering its content (value is 1<<16).
2370 * <p><b>Used By:</b></p>
2372 * <li><code>Browser</code></li>
2377 public static final int WEBKIT = 1 << 16;
2380 * Style constant for balloon behavior (value is 1<<12).
2381 * <p><b>Used By:</b></p>
2383 * <li><code>ToolTip</code></li>
2388 public static final int BALLOON = 1 << 12;
2391 * Style constant for vertical alignment or orientation behavior (value is 1).
2392 * <p><b>Used By:</b></p>
2394 * <li><code>GridLayout</code> type</li>
2397 public static final int BEGINNING = 1;
2400 * Style constant for vertical alignment or orientation behavior (value is 4).
2401 * <p><b>Used By:</b></p>
2403 * <li><code>GridLayout</code> type</li>
2406 public static final int FILL = 4;
2409 * Input Method Editor style constant for double byte
2410 * input behavior (value is 1<<1).
2412 public static final int DBCS = 1 << 1;
2415 * Input Method Editor style constant for alpha
2416 * input behavior (value is 1<<2).
2418 public static final int ALPHA = 1 << 2;
2421 * Input Method Editor style constant for native
2422 * input behavior (value is 1<<3).
2424 public static final int NATIVE = 1 << 3;
2427 * Input Method Editor style constant for phonetic
2428 * input behavior (value is 1<<4).
2430 public static final int PHONETIC = 1 << 4;
2433 * Input Method Editor style constant for romanicized
2434 * input behavior (value is 1<<5).
2436 public static final int ROMAN = 1 << 5;
2439 * ASCII character convenience constant for the backspace character
2440 * (value is the <code>char</code> '\b').
2442 public static final char BS = '\b';
2445 * ASCII character convenience constant for the carriage return character
2446 * (value is the <code>char</code> '\r').
2448 public static final char CR = '\r';
2451 * ASCII character convenience constant for the delete character
2452 * (value is the <code>char</code> with value 127).
2454 public static final char DEL = 0x7F;
2457 * ASCII character convenience constant for the escape character
2458 * (value is the <code>char</code> with value 27).
2460 public static final char ESC = 0x1B;
2463 * ASCII character convenience constant for the line feed character
2464 * (value is the <code>char</code> '\n').
2466 public static final char LF = '\n';
2469 * ASCII character convenience constant for the tab character
2470 * (value is the <code>char</code> '\t').
2474 public static final char TAB = '\t';
2477 * ASCII character convenience constant for the space character
2478 * (value is the <code>char</code> ' ').
2482 public static final char SPACE = ' ';
2485 * Keyboard and/or mouse event mask indicating that the ALT_GR key
2486 * was pushed on the keyboard when the event was generated
2487 * (value is 1 << 15).
2491 public static final int ALT_GR = 1 << 15;
2494 * keyboard and/or mouse event mask indicating that the ALT key
2495 * was pushed on the keyboard when the event was generated
2496 * (value is 1<<16).
2498 public static final int ALT = 1 << 16;
2501 * Keyboard and/or mouse event mask indicating that the SHIFT key
2502 * was pushed on the keyboard when the event was generated
2503 * (value is 1<<17).
2505 public static final int SHIFT = 1 << 17;
2508 * Keyboard and/or mouse event mask indicating that the CTRL key
2509 * was pushed on the keyboard when the event was generated
2510 * (value is 1<<18).
2512 public static final int CTRL = 1 << 18;
2515 * Keyboard and/or mouse event mask indicating that the CTRL key
2516 * was pushed on the keyboard when the event was generated. This
2517 * is a synonym for CTRL (value is 1<<18).
2519 public static final int CONTROL = CTRL;
2522 * Keyboard and/or mouse event mask indicating that the COMMAND key
2523 * was pushed on the keyboard when the event was generated
2524 * (value is 1<<22).
2528 public static final int COMMAND = 1 << 22;
2531 * Keyboard and/or mouse event mask indicating all possible
2532 * keyboard modifiers.
2534 * To allow for the future, this mask is intended to be used in
2535 * place of code that references each individual keyboard mask.
2536 * For example, the following expression will determine whether
2537 * any modifier is pressed and will continue to work as new modifier
2540 * <code>(stateMask & SWT.MODIFIER_MASK) != 0</code>.
2544 public static final int MODIFIER_MASK;
2547 * Keyboard and/or mouse event mask indicating that mouse button one (usually 'left')
2548 * was pushed when the event was generated. (value is 1<<19).
2550 public static final int BUTTON1 = 1 << 19;
2553 * Keyboard and/or mouse event mask indicating that mouse button two (usually 'middle')
2554 * was pushed when the event was generated. (value is 1<<20).
2556 public static final int BUTTON2 = 1 << 20;
2559 * Keyboard and/or mouse event mask indicating that mouse button three (usually 'right')
2560 * was pushed when the event was generated. (value is 1<<21).
2562 public static final int BUTTON3 = 1 << 21;
2565 * Keyboard and/or mouse event mask indicating that mouse button four
2566 * was pushed when the event was generated. (value is 1<<23).
2570 public static final int BUTTON4 = 1 << 23;
2573 * Keyboard and/or mouse event mask indicating that mouse button five
2574 * was pushed when the event was generated. (value is 1<<25).
2578 public static final int BUTTON5 = 1 << 25;
2581 * Keyboard and/or mouse event mask indicating all possible
2584 * To allow for the future, this mask is intended to be used
2585 * in place of code that references each individual button mask.
2586 * For example, the following expression will determine whether
2587 * any button is pressed and will continue to work as new button
2590 * <code>(stateMask & SWT.BUTTON_MASK) != 0</code>.
2594 public static final int BUTTON_MASK;
2597 * Keyboard and/or mouse event mask indicating that the MOD1 key
2598 * was pushed on the keyboard when the event was generated.
2600 * This is the primary keyboard modifier for the platform.
2602 * {@link #CTRL} on most platforms ({@link #COMMAND} on the Mac).
2607 public static final int MOD1;
2610 * Keyboard and/or mouse event mask indicating that the MOD2 key
2611 * was pushed on the keyboard when the event was generated.
2613 * This is the secondary keyboard modifier for the platform.
2615 * {@link #SHIFT} on most platforms.
2620 public static final int MOD2;
2623 * Keyboard and/or mouse event mask indicating that the MOD3 key
2624 * was pushed on the keyboard when the event was generated.
2626 * {@link #ALT} on most platforms.
2631 public static final int MOD3;
2634 * Keyboard and/or mouse event mask indicating that the MOD4 key
2635 * was pushed on the keyboard when the event was generated.
2637 * Undefined on most platforms ({@link #CTRL} on the Mac).
2642 public static final int MOD4;
2645 * Constants to indicate line scrolling (value is 1).
2646 * <p><b>Used By:</b></p>
2648 * <li><code>Control</code></li>
2653 public static final int SCROLL_LINE = 1;
2656 * Constants to indicate page scrolling (value is 2).
2657 * <p><b>Used By:</b></p>
2659 * <li><code>Control</code></li>
2664 public static final int SCROLL_PAGE = 2;
2667 * Accelerator constant used to differentiate a key code from a
2668 * unicode character.
2670 * If this bit is set, then the key stroke
2671 * portion of an accelerator represents a key code. If this bit
2672 * is not set, then the key stroke portion of an accelerator is
2673 * a unicode character.
2675 * The following expression is false:
2677 * <code>((SWT.MOD1 | SWT.MOD2 | 'T') & SWT.KEYCODE_BIT) != 0</code>.
2679 * The following expression is true:
2681 * <code>((SWT.MOD3 | SWT.F2) & SWT.KEYCODE_BIT) != 0</code>.
2683 * (value is (1<<24))
2687 public static final int KEYCODE_BIT = (1 << 24);
2690 * Accelerator constant used to extract the key stroke portion of
2693 * The key stroke may be a key code or a unicode
2694 * value. If the key stroke is a key code <code>KEYCODE_BIT</code>
2699 public static final int KEY_MASK = KEYCODE_BIT + 0xFFFF;
2702 * Keyboard event constant representing the UP ARROW key
2703 * (value is (1<<24)+1).
2705 public static final int ARROW_UP = KEYCODE_BIT + 1;
2708 * Keyboard event constant representing the DOWN ARROW key
2709 * (value is (1<<24)+2).
2711 public static final int ARROW_DOWN = KEYCODE_BIT + 2;
2714 * Keyboard event constant representing the LEFT ARROW key
2715 * (value is (1<<24)+3).
2717 public static final int ARROW_LEFT = KEYCODE_BIT + 3;
2720 * Keyboard event constant representing the RIGHT ARROW key
2721 * (value is (1<<24)+4).
2723 public static final int ARROW_RIGHT = KEYCODE_BIT + 4;
2726 * Keyboard event constant representing the PAGE UP key
2727 * (value is (1<<24)+5).
2729 public static final int PAGE_UP = KEYCODE_BIT + 5;
2732 * Keyboard event constant representing the PAGE DOWN key
2733 * (value is (1<<24)+6).
2735 public static final int PAGE_DOWN = KEYCODE_BIT + 6;
2738 * Keyboard event constant representing the HOME key
2739 * (value is (1<<24)+7).
2741 public static final int HOME = KEYCODE_BIT + 7;
2744 * Keyboard event constant representing the END key
2745 * (value is (1<<24)+8).
2747 public static final int END = KEYCODE_BIT + 8;
2750 * Keyboard event constant representing the INSERT key
2751 * (value is (1<<24)+9).
2753 public static final int INSERT = KEYCODE_BIT + 9;
2756 * Keyboard event constant representing the F1 key
2757 * (value is (1<<24)+10).
2759 public static final int F1 = KEYCODE_BIT + 10;
2762 * Keyboard event constant representing the F2 key
2763 * (value is (1<<24)+11).
2765 public static final int F2 = KEYCODE_BIT + 11;
2768 * Keyboard event constant representing the F3 key
2769 * (value is (1<<24)+12).
2771 public static final int F3 = KEYCODE_BIT + 12;
2774 * Keyboard event constant representing the F4 key
2775 * (value is (1<<24)+13).
2777 public static final int F4 = KEYCODE_BIT + 13;
2780 * Keyboard event constant representing the F5 key
2781 * (value is (1<<24)+14).
2783 public static final int F5 = KEYCODE_BIT + 14;
2786 * Keyboard event constant representing the F6 key
2787 * (value is (1<<24)+15).
2789 public static final int F6 = KEYCODE_BIT + 15;
2792 * Keyboard event constant representing the F7 key
2793 * (value is (1<<24)+16).
2795 public static final int F7 = KEYCODE_BIT + 16;
2798 * Keyboard event constant representing the F8 key
2799 * (value is (1<<24)+17).
2801 public static final int F8 = KEYCODE_BIT + 17;
2804 * Keyboard event constant representing the F9 key
2805 * (value is (1<<24)+18).
2807 public static final int F9 = KEYCODE_BIT + 18;
2810 * Keyboard event constant representing the F10 key
2811 * (value is (1<<24)+19).
2813 public static final int F10 = KEYCODE_BIT + 19;
2816 * Keyboard event constant representing the F11 key
2817 * (value is (1<<24)+20).
2819 public static final int F11 = KEYCODE_BIT + 20;
2822 * Keyboard event constant representing the F12 key
2823 * (value is (1<<24)+21).
2825 public static final int F12 = KEYCODE_BIT + 21;
2828 * Keyboard event constant representing the F13 key
2829 * (value is (1<<24)+22).
2833 public static final int F13 = KEYCODE_BIT + 22;
2836 * Keyboard event constant representing the F14 key
2837 * (value is (1<<24)+23).
2841 public static final int F14 = KEYCODE_BIT + 23;
2844 * Keyboard event constant representing the F15 key
2845 * (value is (1<<24)+24).
2849 public static final int F15 = KEYCODE_BIT + 24;
2852 * Keyboard event constant representing the F16 key
2853 * (value is (1<<25)+25).
2857 public static final int F16 = KEYCODE_BIT + 25;
2861 * Keyboard event constant representing the F17 key
2862 * (value is (1<<26)+26).
2866 public static final int F17 = KEYCODE_BIT + 26;
2870 * Keyboard event constant representing the F18 key
2871 * (value is (1<<27)+27).
2875 public static final int F18 = KEYCODE_BIT + 27;
2879 * Keyboard event constant representing the F19 key
2880 * (value is (1<<28)+28).
2884 public static final int F19 = KEYCODE_BIT + 28;
2887 * Keyboard event constant representing the F20 key
2888 * (value is (1<<29)+29).
2892 public static final int F20 = KEYCODE_BIT + 29;
2895 * Keyboard event constant representing the keypad location.
2896 * (value is 1<<1).
2900 public static final int KEYPAD = 1 << 1;
2903 * Keyboard event constant representing the numeric key
2904 * pad multiply key (value is (1<<24)+42).
2908 public static final int KEYPAD_MULTIPLY = KEYCODE_BIT + 42;
2911 * Keyboard event constant representing the numeric key
2912 * pad add key (value is (1<<24)+43).
2916 public static final int KEYPAD_ADD = KEYCODE_BIT + 43;
2919 * Keyboard event constant representing the numeric key
2920 * pad subtract key (value is (1<<24)+45).
2924 public static final int KEYPAD_SUBTRACT = KEYCODE_BIT + 45;
2927 * Keyboard event constant representing the numeric key
2928 * pad decimal key (value is (1<<24)+46).
2932 public static final int KEYPAD_DECIMAL = KEYCODE_BIT + 46;
2935 * Keyboard event constant representing the numeric key
2936 * pad divide key (value is (1<<24)+47).
2940 public static final int KEYPAD_DIVIDE = KEYCODE_BIT + 47;
2943 * Keyboard event constant representing the numeric key
2944 * pad zero key (value is (1<<24)+48).
2948 public static final int KEYPAD_0 = KEYCODE_BIT + 48;
2951 * Keyboard event constant representing the numeric key
2952 * pad one key (value is (1<<24)+49).
2956 public static final int KEYPAD_1 = KEYCODE_BIT + 49;
2959 * Keyboard event constant representing the numeric key
2960 * pad two key (value is (1<<24)+50).
2964 public static final int KEYPAD_2 = KEYCODE_BIT + 50;
2967 * Keyboard event constant representing the numeric key
2968 * pad three key (value is (1<<24)+51).
2972 public static final int KEYPAD_3 = KEYCODE_BIT + 51;
2975 * Keyboard event constant representing the numeric key
2976 * pad four key (value is (1<<24)+52).
2980 public static final int KEYPAD_4 = KEYCODE_BIT + 52;
2983 * Keyboard event constant representing the numeric key
2984 * pad five key (value is (1<<24)+53).
2988 public static final int KEYPAD_5 = KEYCODE_BIT + 53;
2991 * Keyboard event constant representing the numeric key
2992 * pad six key (value is (1<<24)+54).
2996 public static final int KEYPAD_6 = KEYCODE_BIT + 54;
2999 * Keyboard event constant representing the numeric key
3000 * pad seven key (value is (1<<24)+55).
3004 public static final int KEYPAD_7 = KEYCODE_BIT + 55;
3007 * Keyboard event constant representing the numeric key
3008 * pad eight key (value is (1<<24)+56).
3012 public static final int KEYPAD_8 = KEYCODE_BIT + 56;
3015 * Keyboard event constant representing the numeric key
3016 * pad nine key (value is (1<<24)+57).
3020 public static final int KEYPAD_9 = KEYCODE_BIT + 57;
3023 * Keyboard event constant representing the numeric key
3024 * pad equal key (value is (1<<24)+61).
3028 public static final int KEYPAD_EQUAL = KEYCODE_BIT + 61;
3031 * Keyboard event constant representing the numeric key
3032 * pad enter key (value is (1<<24)+80).
3036 public static final int KEYPAD_CR = KEYCODE_BIT + 80;
3039 * Keyboard event constant representing the help
3040 * key (value is (1<<24)+81).
3042 * NOTE: The HELP key maps to the key labeled "help",
3043 * not "F1". If your keyboard does not have a HELP key,
3044 * you will never see this key press. To listen for
3045 * help on a control, use SWT.Help.
3051 public static final int HELP = KEYCODE_BIT + 81;
3054 * Keyboard event constant representing the caps
3055 * lock key (value is (1<<24)+82).
3059 public static final int CAPS_LOCK = KEYCODE_BIT + 82;
3062 * Keyboard event constant representing the num
3063 * lock key (value is (1<<24)+83).
3067 public static final int NUM_LOCK = KEYCODE_BIT + 83;
3070 * Keyboard event constant representing the scroll
3071 * lock key (value is (1<<24)+84).
3075 public static final int SCROLL_LOCK = KEYCODE_BIT + 84;
3078 * Keyboard event constant representing the pause
3079 * key (value is (1<<24)+85).
3083 public static final int PAUSE = KEYCODE_BIT + 85;
3086 * Keyboard event constant representing the break
3087 * key (value is (1<<24)+86).
3091 public static final int BREAK = KEYCODE_BIT + 86;
3094 * Keyboard event constant representing the print screen
3095 * key (value is (1<<24)+87).
3099 public static final int PRINT_SCREEN = KEYCODE_BIT + 87;
3102 * The <code>MessageBox</code> style constant for error icon
3103 * behavior (value is 1).
3105 public static final int ICON_ERROR = 1;
3108 * The <code>MessageBox</code> style constant for information icon
3109 * behavior (value is 1<<1).
3111 public static final int ICON_INFORMATION = 1 << 1;
3114 * The <code>MessageBox</code> style constant for question icon
3115 * behavior (value is 1<<2).
3117 public static final int ICON_QUESTION = 1 << 2;
3120 * The <code>MessageBox</code> style constant for warning icon
3121 * behavior (value is 1<<3).
3123 public static final int ICON_WARNING = 1 << 3;
3126 * The <code>MessageBox</code> style constant for "working" icon
3127 * behavior (value is 1<<4).
3129 public static final int ICON_WORKING = 1 << 4;
3132 * The style constant for "search" icon. This style constant is
3133 * used with <code>Text</code> in combination with <code>SWT.SEARCH
3134 * </code> (value is 1<<9).
3136 * <p><b>Used By:</b></p>
3138 * <li><code>Text</code></li>
3146 public static final int ICON_SEARCH = 1 << 9;
3149 * The style constant for "cancel" icon. This style constant is
3150 * used with <code>Text</code> in combination with <code>SWT.SEARCH
3151 * </code> (value is 1<<8).
3153 * <p><b>Used By:</b></p>
3155 * <li><code>Text</code></li>
3163 public static final int ICON_CANCEL = 1 << 8;
3167 * The <code>MessageBox</code> style constant for an OK button;
3168 * valid combinations are OK, OK|CANCEL
3169 * (value is 1<<5).
3171 public static final int OK = 1 << 5;
3174 * The <code>MessageBox</code> style constant for YES button;
3175 * valid combinations are YES|NO, YES|NO|CANCEL
3176 * (value is 1<<6).
3178 public static final int YES = 1 << 6;
3181 * The <code>MessageBox</code> style constant for NO button;
3182 * valid combinations are YES|NO, YES|NO|CANCEL
3183 * (value is 1<<7).
3185 public static final int NO = 1 << 7;
3188 * The <code>MessageBox</code> style constant for a CANCEL button;
3189 * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL
3190 * (value is 1<<8).
3192 * <p><b>Used By:</b></p>
3194 * <li><code>MessageBox</code></li>
3197 public static final int CANCEL = 1 << 8;
3200 * The <code>MessageBox</code> style constant for an ABORT button;
3201 * the only valid combination is ABORT|RETRY|IGNORE
3202 * (value is 1<<9).
3204 public static final int ABORT = 1 << 9;
3207 * The <code>MessageBox</code> style constant for a RETRY button;
3208 * valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL
3209 * (value is 1<<10).
3211 public static final int RETRY = 1 << 10;
3214 * The <code>MessageBox</code> style constant for an IGNORE button;
3215 * the only valid combination is ABORT|RETRY|IGNORE
3216 * (value is 1<<11).
3218 public static final int IGNORE = 1 << 11;
3221 * The <code>FileDialog</code> style constant for open file dialog behavior
3222 * (value is 1<<12).
3224 public static final int OPEN = 1 << 12;
3227 * The <code>FileDialog</code> style constant for save file dialog behavior
3228 * (value is 1<<13).
3230 public static final int SAVE = 1 << 13;
3233 * The <code>Composite</code> constant to indicate that
3234 * an attribute (such as background) is not inherited
3235 * by the children (value is 0).
3239 public static final int INHERIT_NONE = 0;
3242 * The <code>Composite</code> constant to indicate that
3243 * an attribute (such as background) is inherited by
3244 * children who choose this value as their "default"
3245 * (value is 1). For example, a label child will
3246 * typically choose to inherit the background color
3247 * of a composite while a list or table will not.
3251 public static final int INHERIT_DEFAULT = 1;
3254 * The <code>Composite</code> constant to indicate that
3255 * an attribute (such as background) is inherited by
3260 public static final int INHERIT_FORCE = 2;
3263 * Default color white (value is 1).
3265 public static final int COLOR_WHITE = 1;
3268 * Default color black (value is 2).
3270 public static final int COLOR_BLACK = 2;
3273 * Default color red (value is 3).
3275 public static final int COLOR_RED = 3;
3278 * Default color dark red (value is 4).
3280 public static final int COLOR_DARK_RED = 4;
3283 * Default color green (value is 5).
3285 public static final int COLOR_GREEN = 5;
3288 * Default color dark green (value is 6).
3290 public static final int COLOR_DARK_GREEN = 6;
3293 * Default color yellow (value is 7).
3295 public static final int COLOR_YELLOW = 7;
3298 * Default color dark yellow (value is 8).
3300 public static final int COLOR_DARK_YELLOW = 8;
3303 * Default color blue (value is 9).
3305 public static final int COLOR_BLUE = 9;
3308 * Default color dark blue (value is 10).
3310 public static final int COLOR_DARK_BLUE = 10;
3313 * Default color magenta (value is 11).
3315 public static final int COLOR_MAGENTA = 11;
3318 * Default color dark magenta (value is 12).
3320 public static final int COLOR_DARK_MAGENTA = 12;
3323 * Default color cyan (value is 13).
3325 public static final int COLOR_CYAN = 13;
3328 * Default color dark cyan (value is 14).
3330 public static final int COLOR_DARK_CYAN = 14;
3333 * Default color gray (value is 15).
3335 public static final int COLOR_GRAY = 15;
3338 * Default color dark gray (value is 16).
3340 public static final int COLOR_DARK_GRAY = 16;
3345 * Dealing with system colors is an area where there are
3346 * many platform differences. On some platforms, system
3347 * colors can change dynamically while the program is
3348 * running. On other platforms, system colors can be
3349 * changed for all instances of a particular widget.
3350 * Therefore, the only truly portable method to obtain
3351 * a widget color query is to query the color from an
3352 * instance of the widget.
3354 * It is expected that the list of supported colors
3355 * will grow over time.
3359 * System color used to paint dark shadow areas (value is 17).
3361 public static final int COLOR_WIDGET_DARK_SHADOW = 17;
3364 * System color used to paint normal shadow areas (value is 18).
3366 public static final int COLOR_WIDGET_NORMAL_SHADOW = 18;
3369 * System color used to paint light shadow areas (value is 19).
3371 public static final int COLOR_WIDGET_LIGHT_SHADOW = 19;
3374 * System color used to paint highlight shadow areas (value is 20).
3376 public static final int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20;
3379 * System color used to paint foreground areas (value is 21).
3381 public static final int COLOR_WIDGET_FOREGROUND = 21;
3384 * System color used to paint background areas (value is 22).
3386 public static final int COLOR_WIDGET_BACKGROUND = 22;
3389 * System color used to paint border areas (value is 23).
3391 public static final int COLOR_WIDGET_BORDER = 23;
3394 * System color used to paint list foreground areas (value is 24).
3396 public static final int COLOR_LIST_FOREGROUND = 24;
3399 * System color used to paint list background areas (value is 25).
3401 public static final int COLOR_LIST_BACKGROUND = 25;
3404 * System color used to paint list selection background areas (value is 26).
3406 public static final int COLOR_LIST_SELECTION = 26;
3409 * System color used to paint list selected text (value is 27).
3411 public static final int COLOR_LIST_SELECTION_TEXT = 27;
3414 * System color used to paint tooltip text (value is 28).
3416 public static final int COLOR_INFO_FOREGROUND = 28;
3419 * System color used to paint tooltip background areas (value is 29).
3421 public static final int COLOR_INFO_BACKGROUND = 29;
3424 * System color used to paint title text (value is 30).
3426 public static final int COLOR_TITLE_FOREGROUND = 30;
3429 * System color used to paint title background areas (value is 31).
3431 public static final int COLOR_TITLE_BACKGROUND = 31;
3434 * System color used to paint title background gradient (value is 32).
3436 public static final int COLOR_TITLE_BACKGROUND_GRADIENT = 32;
3439 * System color used to paint inactive title text (value is 33).
3441 public static final int COLOR_TITLE_INACTIVE_FOREGROUND = 33;
3444 * System color used to paint inactive title background areas (value is 34).
3446 public static final int COLOR_TITLE_INACTIVE_BACKGROUND = 34;
3449 * System color used to paint inactive title background gradient (value is 35).
3451 public static final int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35;
3454 * System color used to paint link text (value is 36).
3458 public static final int COLOR_LINK_FOREGROUND = 36;
3461 * System color used to paint with alpha 0 (value is 37).
3463 * This pseudo-color can be used to set a transparent background on SWT
3465 * Note that this is a <em>HINT</em> and may be overridden by the platform.
3468 * <li>{@link org.eclipse.swt.widgets.Combo Combo},
3469 * {@link org.eclipse.swt.widgets.List List} and
3470 * {@link org.eclipse.swt.widgets.Tree Tree} support transparent background
3471 * on GTK3 and Windows only.</li>
3472 * <li>{@link org.eclipse.swt.widgets.Text Text} supports transparent
3473 * background on Windows only whereas {@link org.eclipse.swt.widgets.Table
3474 * Table} supports transparent background on GTK3 only.</li>
3479 public static final int COLOR_TRANSPARENT = 37;
3482 * System color used to paint disabled text background areas (value is 38).
3486 public static final int COLOR_TEXT_DISABLED_BACKGROUND = 38;
3489 * System color used to paint disabled foreground areas (value is 39).
3493 public static final int COLOR_WIDGET_DISABLED_FOREGROUND = 39;
3496 * Draw constant indicating whether the drawing operation
3497 * should fill the background (value is 1<<0).
3499 public static final int DRAW_TRANSPARENT = 1 << 0;
3502 * Draw constant indicating whether the string drawing operation
3503 * should handle line-delimiters (value is 1<<1).
3505 public static final int DRAW_DELIMITER = 1 << 1;
3508 * Draw constant indicating whether the string drawing operation
3509 * should expand TAB characters (value is 1<<2).
3511 public static final int DRAW_TAB = 1 << 2;
3514 * Draw constant indicating whether the string drawing operation
3515 * should handle mnemonics (value is 1<<3).
3517 public static final int DRAW_MNEMONIC = 1 << 3;
3521 * Selection constant indicating that a line delimiter should be
3522 * drawn (value is 1<<17).
3524 * <p><b>Used By:</b></p>
3526 * <li><code>TextLayout</code></li>
3529 * @see #FULL_SELECTION
3530 * @see #LAST_LINE_SELECTION
3534 public static final int DELIMITER_SELECTION = 1 << 17;
3537 * Selection constant indicating that the last line is selected
3538 * to the end and should be drawn using either a line delimiter
3539 * or full line selection (value is 1<<20).
3541 * <p><b>Used By:</b></p>
3543 * <li><code>TextLayout</code></li>
3546 * @see #DELIMITER_SELECTION
3547 * @see #FULL_SELECTION
3551 public static final int LAST_LINE_SELECTION = 1 << 20;
3554 * SWT error constant indicating that no error number was specified
3557 public static final int ERROR_UNSPECIFIED = 1;
3560 * SWT error constant indicating that no more handles for an
3561 * operating system resource are available
3564 public static final int ERROR_NO_HANDLES = 2;
3567 * SWT error constant indicating that no more callback resources are available
3570 public static final int ERROR_NO_MORE_CALLBACKS = 3;
3573 * SWT error constant indicating that a null argument was passed in
3576 public static final int ERROR_NULL_ARGUMENT = 4;
3579 * SWT error constant indicating that an invalid argument was passed in
3582 public static final int ERROR_INVALID_ARGUMENT = 5;
3585 * SWT error constant indicating that a value was found to be
3586 * outside the allowable range
3589 public static final int ERROR_INVALID_RANGE = 6;
3592 * SWT error constant indicating that a value which can not be
3593 * zero was found to be
3596 public static final int ERROR_CANNOT_BE_ZERO = 7;
3599 * SWT error constant indicating that the underlying operating
3600 * system was unable to provide the value of an item
3603 public static final int ERROR_CANNOT_GET_ITEM = 8;
3606 * SWT error constant indicating that the underlying operating
3607 * system was unable to provide the selection
3610 public static final int ERROR_CANNOT_GET_SELECTION = 9;
3613 * SWT error constant indicating that the matrix is not invertible
3618 public static final int ERROR_CANNOT_INVERT_MATRIX = 10;
3621 * SWT error constant indicating that the underlying operating
3622 * system was unable to provide the height of an item
3625 public static final int ERROR_CANNOT_GET_ITEM_HEIGHT = 11;
3628 * SWT error constant indicating that the underlying operating
3629 * system was unable to provide the text of a widget
3632 public static final int ERROR_CANNOT_GET_TEXT = 12;
3635 * SWT error constant indicating that the underlying operating
3636 * system was unable to set the text of a widget
3639 public static final int ERROR_CANNOT_SET_TEXT = 13;
3642 * SWT error constant indicating that the underlying operating
3643 * system was unable to add an item
3646 public static final int ERROR_ITEM_NOT_ADDED = 14;
3649 * SWT error constant indicating that the underlying operating
3650 * system was unable to remove an item
3653 public static final int ERROR_ITEM_NOT_REMOVED = 15;
3656 * SWT error constant indicating that the graphics library
3660 public static final int ERROR_NO_GRAPHICS_LIBRARY = 16;
3663 * SWT error constant indicating that a particular feature has
3664 * not been implemented on this platform
3667 public static final int ERROR_NOT_IMPLEMENTED = 20;
3670 * SWT error constant indicating that a menu which needed
3671 * to have the drop down style had some other style instead
3674 public static final int ERROR_MENU_NOT_DROP_DOWN = 21;
3677 * SWT error constant indicating that an attempt was made to
3678 * invoke an SWT operation which can only be executed by the
3679 * user-interface thread from some other thread
3682 public static final int ERROR_THREAD_INVALID_ACCESS = 22;
3685 * SWT error constant indicating that an attempt was made to
3686 * invoke an SWT operation using a widget which had already
3690 public static final int ERROR_WIDGET_DISPOSED = 24;
3693 * SWT error constant indicating that a menu item which needed
3694 * to have the cascade style had some other style instead
3697 public static final int ERROR_MENUITEM_NOT_CASCADE = 27;
3700 * SWT error constant indicating that the underlying operating
3701 * system was unable to set the selection of a widget
3704 public static final int ERROR_CANNOT_SET_SELECTION = 28;
3707 * SWT error constant indicating that the underlying operating
3708 * system was unable to set the menu
3711 public static final int ERROR_CANNOT_SET_MENU = 29;
3714 * SWT error constant indicating that the underlying operating
3715 * system was unable to set the enabled state
3718 public static final int ERROR_CANNOT_SET_ENABLED = 30;
3721 * SWT error constant indicating that the underlying operating
3722 * system was unable to provide enabled/disabled state information
3725 public static final int ERROR_CANNOT_GET_ENABLED = 31;
3728 * SWT error constant indicating that a provided widget can
3729 * not be used as a parent in the current operation
3732 public static final int ERROR_INVALID_PARENT = 32;
3735 * SWT error constant indicating that a menu which needed
3736 * to have the menu bar style had some other style instead
3739 public static final int ERROR_MENU_NOT_BAR = 33;
3742 * SWT error constant indicating that the underlying operating
3743 * system was unable to provide count information
3746 public static final int ERROR_CANNOT_GET_COUNT = 36;
3749 * SWT error constant indicating that a menu which needed
3750 * to have the pop up menu style had some other style instead
3753 public static final int ERROR_MENU_NOT_POP_UP = 37;
3756 * SWT error constant indicating that a graphics operation
3757 * was attempted with an image of an unsupported depth
3760 public static final int ERROR_UNSUPPORTED_DEPTH = 38;
3763 * SWT error constant indicating that an input/output operation
3764 * failed during the execution of an SWT operation
3767 public static final int ERROR_IO = 39;
3770 * SWT error constant indicating that a graphics operation
3771 * was attempted with an image having an invalid format
3774 public static final int ERROR_INVALID_IMAGE = 40;
3777 * SWT error constant indicating that a graphics operation
3778 * was attempted with an image having a valid but unsupported
3782 public static final int ERROR_UNSUPPORTED_FORMAT = 42;
3785 * SWT error constant indicating that an attempt was made
3786 * to subclass an SWT widget class without implementing the
3787 * <code>checkSubclass()</code> method
3790 * For additional information see the comment in
3791 * <code>Widget.checkSubclass()</code>.
3793 * @see org.eclipse.swt.widgets.Widget#checkSubclass
3795 public static final int ERROR_INVALID_SUBCLASS = 43;
3798 * SWT error constant indicating that an attempt was made to
3799 * invoke an SWT operation using a graphics object which had
3800 * already been disposed
3803 public static final int ERROR_GRAPHIC_DISPOSED = 44;
3806 * SWT error constant indicating that an attempt was made to
3807 * invoke an SWT operation using a device which had already
3811 public static final int ERROR_DEVICE_DISPOSED = 45;
3814 * SWT error constant indicating that an exception happened
3815 * when executing a runnable
3818 public static final int ERROR_FAILED_EXEC = 46;
3821 * SWT error constant indicating that an unsatisfied link
3822 * error occurred while attempting to load a library
3827 public static final int ERROR_FAILED_LOAD_LIBRARY = 47;
3830 * SWT error constant indicating that a font is not valid
3835 public static final int ERROR_INVALID_FONT = 48;
3838 * SWT error constant indicating that an attempt was made to
3839 * use an BrowserFunction object which had already been disposed
3844 public static final int ERROR_FUNCTION_DISPOSED = 49;
3847 * SWT error constant indicating that an exception happened
3848 * when evaluating a javascript expression
3853 public static final int ERROR_FAILED_EVALUATE = 50;
3856 * SWT error constant indicating that an invalid value was returned
3861 public static final int ERROR_INVALID_RETURN_VALUE = 51;
3864 * Constant indicating that an image or operation is of type bitmap (value is 0).
3866 public static final int BITMAP = 0;
3869 * Constant indicating that an image or operation is of type icon (value is 1).
3871 public static final int ICON = 1;
3874 * The <code>Image</code> constructor argument indicating that
3875 * the new image should be a copy of the image provided as
3876 * an argument (value is 0).
3878 public static final int IMAGE_COPY = 0;
3881 * The <code>Image</code> constructor argument indicating that
3882 * the new image should have the appearance of a "disabled"
3883 * (using the platform's rules for how this should look)
3884 * copy of the image provided as an argument (value is 1).
3886 public static final int IMAGE_DISABLE = 1;
3889 * The <code>Image</code> constructor argument indicating that
3890 * the new image should have the appearance of a "gray scaled"
3891 * copy of the image provided as an argument (value is 2).
3893 public static final int IMAGE_GRAY = 2;
3896 * Constant to indicate an error state (value is 1).
3897 * <p><b>Used By:</b></p>
3899 * <li><code>ProgressBar</code></li>
3904 public static final int ERROR = 1;
3907 * Constant to a indicate a paused state (value is 4).
3908 * <p><b>Used By:</b></p>
3910 * <li><code>ProgressBar</code></li>
3915 public static final int PAUSED = 1 << 2;
3918 * The font style constant indicating a normal weight, non-italic font
3919 * (value is 0). This constant is also used with <code>ProgressBar</code>
3920 * to indicate a normal state.
3921 * <p><b>Used By:</b></p>
3923 * <li><code>ProgressBar</code></li>
3926 public static final int NORMAL = 0;
3929 * The font style constant indicating a bold weight font
3930 * (value is 1<<0).
3932 public static final int BOLD = 1 << 0;
3935 * The font style constant indicating an italic font
3936 * (value is 1<<1).
3938 public static final int ITALIC = 1 << 1;
3941 * System arrow cursor (value is 0).
3943 public static final int CURSOR_ARROW = 0;
3946 * System wait cursor (value is 1).
3948 public static final int CURSOR_WAIT = 1;
3951 * System cross hair cursor (value is 2).
3953 public static final int CURSOR_CROSS = 2;
3956 * System app startup cursor (value is 3).
3958 public static final int CURSOR_APPSTARTING = 3;
3961 * System help cursor (value is 4).
3963 public static final int CURSOR_HELP = 4;
3966 * System resize all directions cursor (value is 5).
3968 public static final int CURSOR_SIZEALL = 5;
3971 * System resize north-east-south-west cursor (value is 6).
3973 public static final int CURSOR_SIZENESW = 6;
3976 * System resize north-south cursor (value is 7).
3978 public static final int CURSOR_SIZENS = 7;
3981 * System resize north-west-south-east cursor (value is 8).
3983 public static final int CURSOR_SIZENWSE = 8;
3986 * System resize west-east cursor (value is 9).
3988 public static final int CURSOR_SIZEWE = 9;
3991 * System resize north cursor (value is 10).
3993 public static final int CURSOR_SIZEN = 10;
3996 * System resize south cursor (value is 11).
3998 public static final int CURSOR_SIZES = 11;
4001 * System resize east cursor (value is 12).
4003 public static final int CURSOR_SIZEE = 12;
4006 * System resize west cursor (value is 13).
4008 public static final int CURSOR_SIZEW = 13;
4011 * System resize north-east cursor (value is 14).
4013 public static final int CURSOR_SIZENE = 14;
4016 * System resize south-east cursor (value is 15).
4018 public static final int CURSOR_SIZESE = 15;
4021 * System resize south-west cursor (value is 16).
4023 public static final int CURSOR_SIZESW = 16;
4026 * System resize north-west cursor (value is 17).
4028 public static final int CURSOR_SIZENW = 17;
4031 * System up arrow cursor (value is 18).
4033 public static final int CURSOR_UPARROW = 18;
4036 * System i-beam cursor (value is 19).
4038 public static final int CURSOR_IBEAM = 19;
4041 * System "not allowed" cursor (value is 20).
4043 public static final int CURSOR_NO = 20;
4046 * System hand cursor (value is 21).
4048 public static final int CURSOR_HAND = 21;
4051 * Line drawing style for flat end caps (value is 1).
4053 * @see org.eclipse.swt.graphics.GC#setLineCap(int)
4054 * @see org.eclipse.swt.graphics.GC#getLineCap()
4058 public static final int CAP_FLAT = 1;
4061 * Line drawing style for rounded end caps (value is 2).
4063 * @see org.eclipse.swt.graphics.GC#setLineCap(int)
4064 * @see org.eclipse.swt.graphics.GC#getLineCap()
4068 public static final int CAP_ROUND = 2;
4071 * Line drawing style for square end caps (value is 3).
4073 * @see org.eclipse.swt.graphics.GC#setLineCap(int)
4074 * @see org.eclipse.swt.graphics.GC#getLineCap()
4078 public static final int CAP_SQUARE = 3;
4081 * Line drawing style for miter joins (value is 1).
4083 * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
4084 * @see org.eclipse.swt.graphics.GC#getLineJoin()
4088 public static final int JOIN_MITER = 1;
4091 * Line drawing style for rounded joins (value is 2).
4093 * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
4094 * @see org.eclipse.swt.graphics.GC#getLineJoin()
4098 public static final int JOIN_ROUND = 2;
4101 * Line drawing style for bevel joins (value is 3).
4103 * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
4104 * @see org.eclipse.swt.graphics.GC#getLineJoin()
4108 public static final int JOIN_BEVEL = 3;
4111 * Line drawing style for solid lines (value is 1).
4113 public static final int LINE_SOLID = 1;
4116 * Line drawing style for dashed lines (value is 2).
4118 public static final int LINE_DASH = 2;
4121 * Line drawing style for dotted lines (value is 3).
4123 public static final int LINE_DOT = 3;
4126 * Line drawing style for alternating dash-dot lines (value is 4).
4128 public static final int LINE_DASHDOT = 4;
4131 * Line drawing style for dash-dot-dot lines (value is 5).
4133 public static final int LINE_DASHDOTDOT = 5;
4136 * Line drawing style for custom dashed lines (value is 6).
4138 * @see org.eclipse.swt.graphics.GC#setLineDash(int[])
4139 * @see org.eclipse.swt.graphics.GC#getLineDash()
4143 public static final int LINE_CUSTOM = 6;
4146 * Path constant that represents a "move to" operation (value is 1).
4150 public static final int PATH_MOVE_TO = 1;
4153 * Path constant that represents a "line to" operation (value is 2).
4157 public static final int PATH_LINE_TO = 2;
4160 * Path constant that represents a "quadratic curve to" operation (value is 3).
4164 public static final int PATH_QUAD_TO = 3;
4167 * Path constant that represents a "cubic curve to" operation (value is 4).
4171 public static final int PATH_CUBIC_TO = 4;
4174 * Path constant that represents a "close" operation (value is 5).
4178 public static final int PATH_CLOSE = 5;
4181 * Even odd rule for filling operations (value is 1).
4185 public static final int FILL_EVEN_ODD = 1;
4188 * Winding rule for filling operations (value is 2).
4192 public static final int FILL_WINDING = 2;
4195 * Image format constant indicating an unknown image type (value is -1).
4197 public static final int IMAGE_UNDEFINED = -1;
4200 * Image format constant indicating a Windows BMP format image (value is 0).
4202 public static final int IMAGE_BMP = 0;
4205 * Image format constant indicating a run-length encoded
4206 * Windows BMP format image (value is 1).
4208 public static final int IMAGE_BMP_RLE = 1;
4211 * Image format constant indicating a GIF format image (value is 2).
4213 public static final int IMAGE_GIF = 2;
4216 * Image format constant indicating a ICO format image (value is 3).
4218 public static final int IMAGE_ICO = 3;
4221 * Image format constant indicating a JPEG format image (value is 4).
4223 public static final int IMAGE_JPEG = 4;
4226 * Image format constant indicating a PNG format image (value is 5).
4228 public static final int IMAGE_PNG = 5;
4231 * Image format constant indicating a TIFF format image (value is 6).
4233 public static final int IMAGE_TIFF = 6;
4236 * Image format constant indicating an OS/2 BMP format image (value is 7).
4238 public static final int IMAGE_OS2_BMP = 7;
4241 * Image format constant indicating a SVG format image (value is 8).
4242 * <br>Note that this is a <em>HINT</em> and is currently only supported on GTK.
4246 public static final int IMAGE_SVG = 8;
4249 * GIF image disposal method constants indicating that the
4250 * disposal method is unspecified (value is 0).
4252 public static final int DM_UNSPECIFIED = 0x0;
4255 * GIF image disposal method constants indicating that the
4256 * disposal method is to do nothing; that is, to leave the
4257 * previous image in place (value is 1).
4259 public static final int DM_FILL_NONE = 0x1;
4262 * GIF image disposal method constants indicating that the
4263 * the previous images should be covered with the background
4264 * color before displaying the next image (value is 2).
4266 public static final int DM_FILL_BACKGROUND = 0x2;
4269 * GIF image disposal method constants indicating that the
4270 * disposal method is to restore the previous picture
4273 public static final int DM_FILL_PREVIOUS = 0x3;
4276 * Image transparency constant indicating that the image
4277 * contains no transparency information (value is 0).
4279 public static final int TRANSPARENCY_NONE = 0x0;
4282 * Image transparency constant indicating that the image
4283 * contains alpha transparency information (value is 1<<0).
4285 public static final int TRANSPARENCY_ALPHA = 1 << 0;
4288 * Image transparency constant indicating that the image
4289 * contains a transparency mask (value is 1<<1).
4291 public static final int TRANSPARENCY_MASK = 1 << 1;
4294 * Image transparency constant indicating that the image
4295 * contains a transparent pixel (value is 1<<2).
4297 public static final int TRANSPARENCY_PIXEL = 1 << 2;
4300 * The character movement type (value is 1<<0).
4301 * This constant is used to move a text offset over a character.
4303 * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
4304 * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
4308 public static final int MOVEMENT_CHAR = 1 << 0;
4311 * The cluster movement type (value is 1<<1).
4312 * This constant is used to move a text offset over a cluster.
4313 * A cluster groups one or more characters. A cluster is
4314 * undivisible, this means that a caret offset can not be placed in the
4315 * middle of a cluster.
4317 * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
4318 * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
4322 public static final int MOVEMENT_CLUSTER = 1 << 1;
4325 * The word movement type (value is 1<<2).
4326 * This constant is used to move a text offset over a word.
4327 * The behavior of this constant depends on the platform and on the
4328 * direction of the movement. For example, on Windows the stop is
4329 * always at the start of the word. On GTK and Mac the stop is at the end
4330 * of the word if the direction is next and at the start of the word if the
4331 * direction is previous.
4333 * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
4334 * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
4338 public static final int MOVEMENT_WORD = 1 << 2;
4341 * The word end movement type (value is 1<<3).
4342 * This constant is used to move a text offset to the next or previous
4343 * word end. The behavior of this constant does not depend on the platform.
4346 * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
4347 * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
4351 public static final int MOVEMENT_WORD_END = 1 << 3;
4354 * The word start movement type (value is 1<<4).
4355 * This constant is used to move a text offset to the next or previous
4356 * word start. The behavior of this constant does not depend on the platform.
4358 * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
4359 * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
4363 public static final int MOVEMENT_WORD_START = 1 << 4;
4366 * A constant indicating that a given operation should be performed on
4367 * all widgets (value is 1<<0).
4369 * <p><b>Used By:</b></p>
4371 * <li><code>Composite</code> layout</li>
4374 * @see org.eclipse.swt.widgets.Composite#layout(org.eclipse.swt.widgets.Control[], int)
4378 public static final int ALL = 1 << 0;
4381 * ID for the About menu item (value is -1).
4383 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4384 * @see org.eclipse.swt.widgets.MenuItem#getID()
4388 public static final int ID_ABOUT = -1;
4391 * ID for the Preferences menu item (value is -2).
4393 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4394 * @see org.eclipse.swt.widgets.MenuItem#getID()
4398 public static final int ID_PREFERENCES = -2;
4401 * ID for the Hide menu item (value is -3).
4403 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4404 * @see org.eclipse.swt.widgets.MenuItem#getID()
4408 public static final int ID_HIDE = -3;
4411 * ID for the Hide Others menu item (value is -4).
4413 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4414 * @see org.eclipse.swt.widgets.MenuItem#getID()
4418 public static final int ID_HIDE_OTHERS = -4;
4421 * ID for the Show All menu item (value is -5).
4423 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4424 * @see org.eclipse.swt.widgets.MenuItem#getID()
4428 public static final int ID_SHOW_ALL = -5;
4431 * ID for the Quit menu item (value is -6).
4433 * @see org.eclipse.swt.widgets.MenuItem#setID(int)
4434 * @see org.eclipse.swt.widgets.MenuItem#getID()
4438 public static final int ID_QUIT = -6;
4441 * Key name for setting and getting the skin class of a widget.
4443 * Note: SWT currently doesn't read or process this property. The only
4444 * effect of setting this property is to trigger a call to
4445 * {@link Widget#reskin(int) Widget#reskin(SWT.ALL)}.
4448 * @see org.eclipse.swt.widgets.Widget#getData(String)
4449 * @see org.eclipse.swt.widgets.Widget#setData(String, Object)
4453 public static final String SKIN_CLASS = "org.eclipse.swt.skin.class"; //$NON-NLS-1$
4456 * Key name for setting and getting the skin id of a widget.
4458 * Note: SWT currently doesn't read or process this property. The only
4459 * effect of setting this property is to trigger a call to
4460 * {@link Widget#reskin(int) Widget#reskin(SWT.ALL)}.
4463 * @see org.eclipse.swt.widgets.Widget#getData(String)
4464 * @see org.eclipse.swt.widgets.Widget#setData(String, Object)
4468 public static final String SKIN_ID = "org.eclipse.swt.skin.id"; //$NON-NLS-1$
4471 * The <code>Scrollable</code> constant to indicate that
4472 * the receiver is using overlay scrollbars. (value is 1)
4476 public static final int SCROLLBAR_OVERLAY = 1 << 1;
4480 * Returns a boolean indicating whether this SWT implementation can
4481 * be loaded. Examples of criteria that may be used to determine this
4482 * include the OS and architecture of the JRE that is being used.
4484 * @return <code>true</code> if this SWT implementation can be loaded
4485 * and <code>false</code> otherwise
4489 public static boolean isLoadable () {
4490 return Platform.isLoadable ();
4494 * Answers a concise, human readable description of the error code.
4496 * @param code the SWT error code.
4497 * @return a description of the error code.
4501 static String findErrorText (int code) {
4503 case ERROR_UNSPECIFIED: return "Unspecified error"; //$NON-NLS-1$
4504 case ERROR_NO_HANDLES: return "No more handles"; //$NON-NLS-1$
4505 case ERROR_NO_MORE_CALLBACKS: return "No more callbacks"; //$NON-NLS-1$
4506 case ERROR_NULL_ARGUMENT: return "Argument cannot be null"; //$NON-NLS-1$
4507 case ERROR_INVALID_ARGUMENT: return "Argument not valid"; //$NON-NLS-1$
4508 case ERROR_INVALID_RETURN_VALUE: return "Return value not valid"; //$NON-NLS-1$
4509 case ERROR_INVALID_RANGE: return "Index out of bounds"; //$NON-NLS-1$
4510 case ERROR_CANNOT_BE_ZERO: return "Argument cannot be zero"; //$NON-NLS-1$
4511 case ERROR_CANNOT_GET_ITEM: return "Cannot get item"; //$NON-NLS-1$
4512 case ERROR_CANNOT_GET_SELECTION: return "Cannot get selection"; //$NON-NLS-1$
4513 case ERROR_CANNOT_GET_ITEM_HEIGHT: return "Cannot get item height"; //$NON-NLS-1$
4514 case ERROR_CANNOT_GET_TEXT: return "Cannot get text"; //$NON-NLS-1$
4515 case ERROR_CANNOT_SET_TEXT: return "Cannot set text"; //$NON-NLS-1$
4516 case ERROR_ITEM_NOT_ADDED: return "Item not added"; //$NON-NLS-1$
4517 case ERROR_ITEM_NOT_REMOVED: return "Item not removed"; //$NON-NLS-1$
4518 case ERROR_NOT_IMPLEMENTED: return "Not implemented"; //$NON-NLS-1$
4519 case ERROR_MENU_NOT_DROP_DOWN: return "Menu must be a drop down"; //$NON-NLS-1$
4520 case ERROR_THREAD_INVALID_ACCESS: return "Invalid thread access"; //$NON-NLS-1$
4521 case ERROR_WIDGET_DISPOSED: return "Widget is disposed"; //$NON-NLS-1$
4522 case ERROR_MENUITEM_NOT_CASCADE: return "Menu item is not a CASCADE"; //$NON-NLS-1$
4523 case ERROR_CANNOT_SET_SELECTION: return "Cannot set selection"; //$NON-NLS-1$
4524 case ERROR_CANNOT_SET_MENU: return "Cannot set menu"; //$NON-NLS-1$
4525 case ERROR_CANNOT_SET_ENABLED: return "Cannot set the enabled state"; //$NON-NLS-1$
4526 case ERROR_CANNOT_GET_ENABLED: return "Cannot get the enabled state"; //$NON-NLS-1$
4527 case ERROR_INVALID_PARENT: return "Widget has the wrong parent"; //$NON-NLS-1$
4528 case ERROR_MENU_NOT_BAR: return "Menu is not a BAR"; //$NON-NLS-1$
4529 case ERROR_CANNOT_GET_COUNT: return "Cannot get count"; //$NON-NLS-1$
4530 case ERROR_MENU_NOT_POP_UP: return "Menu is not a POP_UP"; //$NON-NLS-1$
4531 case ERROR_UNSUPPORTED_DEPTH: return "Unsupported color depth"; //$NON-NLS-1$
4532 case ERROR_IO: return "i/o error"; //$NON-NLS-1$
4533 case ERROR_INVALID_IMAGE: return "Invalid image"; //$NON-NLS-1$
4534 case ERROR_UNSUPPORTED_FORMAT: return "Unsupported or unrecognized format"; //$NON-NLS-1$
4535 case ERROR_INVALID_SUBCLASS: return "Subclassing not allowed"; //$NON-NLS-1$
4536 case ERROR_GRAPHIC_DISPOSED: return "Graphic is disposed"; //$NON-NLS-1$
4537 case ERROR_DEVICE_DISPOSED: return "Device is disposed"; //$NON-NLS-1$
4538 case ERROR_FUNCTION_DISPOSED: return "BrowserFunction is disposed"; //$NON-NLS-1$
4539 case ERROR_FAILED_EXEC: return "Failed to execute runnable"; //$NON-NLS-1$
4540 case ERROR_FAILED_EVALUATE: return "Failed to evaluate javascript expression"; //$NON-NLS-1$
4541 case ERROR_FAILED_LOAD_LIBRARY: return "Unable to load library"; //$NON-NLS-1$
4542 case ERROR_CANNOT_INVERT_MATRIX: return "Cannot invert matrix"; //$NON-NLS-1$
4543 case ERROR_NO_GRAPHICS_LIBRARY: return "Unable to load graphics library"; //$NON-NLS-1$
4544 case ERROR_INVALID_FONT: return "Font not valid"; //$NON-NLS-1$
4546 return "Unknown error"; //$NON-NLS-1$
4550 * Returns the NLS'ed message for the given argument.
4552 * @param key the key to look up
4553 * @return the message for the given key
4555 * @exception IllegalArgumentException <ul>
4556 * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
4559 public static String getMessage(String key) {
4560 return Compatibility.getMessage(key);
4564 * Returns the NLS'ed message for the given arguments.
4566 * @param key the key to look up
4567 * @param args the parameters to insert into the message
4568 * @return the message for the given parameterized key
4570 * @exception IllegalArgumentException <ul>
4571 * <li>ERROR_NULL_ARGUMENT - if the key or args are null</li>
4576 public static String getMessage(String key, Object[] args) {
4577 return Compatibility.getMessage(key, args);
4581 * Returns the SWT platform name.
4582 * Examples: "win32", "gtk", "cocoa"
4584 * @return the SWT platform name
4586 public static String getPlatform () {
4587 return Platform.PLATFORM;
4591 * Returns the SWT version number as an integer.
4592 * Example: "SWT051" == 51
4594 * @return the SWT version number
4596 public static int getVersion () {
4597 return Library.SWT_VERSION;
4601 * Throws an appropriate exception based on the passed in error code.
4603 * @param code the SWT error code
4605 public static void error (int code) {
4610 * Throws an appropriate exception based on the passed in error code.
4611 * The <code>throwable</code> argument should be either null, or the
4612 * throwable which caused SWT to throw an exception.
4614 * In SWT, errors are reported by throwing one of three exceptions:
4617 * <dd>java.lang.IllegalArgumentException</dd>
4618 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
4619 * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
4620 * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
4621 * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
4622 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
4624 * This method provides the logic which maps between error codes
4625 * and one of the above exceptions.
4627 * @param code the SWT error code.
4628 * @param throwable the exception which caused the error to occur.
4632 * @see IllegalArgumentException
4634 public static void error (int code, Throwable throwable) {
4635 error (code, throwable, null);
4639 * Throws an appropriate exception based on the passed in error code.
4640 * The <code>throwable</code> argument should be either null, or the
4641 * throwable which caused SWT to throw an exception.
4643 * In SWT, errors are reported by throwing one of three exceptions:
4646 * <dd>java.lang.IllegalArgumentException</dd>
4647 * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
4648 * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
4649 * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
4650 * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
4651 * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
4653 * This method provides the logic which maps between error codes
4654 * and one of the above exceptions.
4656 * @param code the SWT error code.
4657 * @param throwable the exception which caused the error to occur.
4658 * @param detail more information about error.
4662 * @see IllegalArgumentException
4666 public static void error (int code, Throwable throwable, String detail) {
4669 * This code prevents the creation of "chains" of SWTErrors and
4670 * SWTExceptions which in turn contain other SWTErrors and
4671 * SWTExceptions as their throwable. This can occur when low level
4672 * code throws an exception past a point where a higher layer is
4673 * being "safe" and catching all exceptions. (Note that, this is
4674 * _a_bad_thing_ which we always try to avoid.)
4676 * On the theory that the low level code is closest to the
4677 * original problem, we simply re-throw the original exception here.
4679 * NOTE: Exceptions thrown in syncExec and asyncExec must be
4682 if (code != SWT.ERROR_FAILED_EXEC) {
4683 if (throwable instanceof SWTError) throw (SWTError) throwable;
4684 if (throwable instanceof SWTException) throw (SWTException) throwable;
4687 String message = findErrorText (code);
4688 if (detail != null) message += detail;
4691 /* Illegal Arguments (non-fatal) */
4692 case ERROR_NULL_ARGUMENT:
4693 case ERROR_CANNOT_BE_ZERO:
4694 case ERROR_INVALID_ARGUMENT:
4695 case ERROR_MENU_NOT_BAR:
4696 case ERROR_MENU_NOT_DROP_DOWN:
4697 case ERROR_MENU_NOT_POP_UP:
4698 case ERROR_MENUITEM_NOT_CASCADE:
4699 case ERROR_INVALID_PARENT:
4700 case ERROR_INVALID_RANGE: {
4701 throw new IllegalArgumentException (message);
4704 /* SWT Exceptions (non-fatal) */
4705 case ERROR_INVALID_SUBCLASS:
4706 case ERROR_THREAD_INVALID_ACCESS:
4707 case ERROR_WIDGET_DISPOSED:
4708 case ERROR_GRAPHIC_DISPOSED:
4709 case ERROR_DEVICE_DISPOSED:
4710 case ERROR_FUNCTION_DISPOSED:
4711 case ERROR_INVALID_IMAGE:
4712 case ERROR_UNSUPPORTED_DEPTH:
4713 case ERROR_UNSUPPORTED_FORMAT:
4714 case ERROR_FAILED_EXEC:
4715 case ERROR_FAILED_EVALUATE:
4716 case ERROR_CANNOT_INVERT_MATRIX:
4717 case ERROR_NO_GRAPHICS_LIBRARY:
4718 case ERROR_INVALID_RETURN_VALUE:
4720 SWTException exception = new SWTException (code, message);
4721 exception.throwable = throwable;
4725 /* Operation System Errors (fatal, may occur only on some platforms) */
4726 case ERROR_CANNOT_GET_COUNT:
4727 case ERROR_CANNOT_GET_ENABLED:
4728 case ERROR_CANNOT_GET_ITEM:
4729 case ERROR_CANNOT_GET_ITEM_HEIGHT:
4730 case ERROR_CANNOT_GET_SELECTION:
4731 case ERROR_CANNOT_GET_TEXT:
4732 case ERROR_CANNOT_SET_ENABLED:
4733 case ERROR_CANNOT_SET_MENU:
4734 case ERROR_CANNOT_SET_SELECTION:
4735 case ERROR_CANNOT_SET_TEXT:
4736 case ERROR_ITEM_NOT_ADDED:
4737 case ERROR_ITEM_NOT_REMOVED:
4738 case ERROR_NO_HANDLES:
4741 /* SWT Errors (fatal, may occur only on some platforms) */
4742 case ERROR_FAILED_LOAD_LIBRARY:
4743 case ERROR_NO_MORE_CALLBACKS:
4744 case ERROR_NOT_IMPLEMENTED:
4745 case ERROR_UNSPECIFIED: {
4746 SWTError error = new SWTError (code, message);
4747 error.throwable = throwable;
4752 /* Unknown/Undefined Error */
4753 SWTError error = new SWTError (code, message);
4754 error.throwable = throwable;
4760 * These values represent bit masks that may need to
4761 * expand in the future. Therefore they are not initialized
4762 * in the declaration to stop the compiler from inlining.
4764 BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5;
4765 MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND | ALT_GR;
4768 * These values can be different on different platforms.
4769 * Therefore they are not initialized in the declaration
4770 * to stop the compiler from inlining.
4772 String platform = getPlatform ();
4773 if ("cocoa".equals (platform)) { //$NON-NLS-1$