0001: /*******************************************************************************
0002: * Copyright (c) 2000, 2007 IBM Corporation and others.
0003: * All rights reserved. This program and the accompanying materials
0004: * are made available under the terms of the Eclipse Public License v1.0
0005: * which accompanies this distribution, and is available at
0006: * http://www.eclipse.org/legal/epl-v10.html
0007: *
0008: * Contributors:
0009: * IBM Corporation - initial API and implementation
0010: *******************************************************************************/package org.eclipse.swt;
0011:
0012: import org.eclipse.swt.internal.*;
0013:
0014: /**
0015: * This class provides access to a small number of SWT system-wide
0016: * methods, and in addition defines the public constants provided
0017: * by SWT.
0018: * <p>
0019: * By defining constants like UP and DOWN in a single class, SWT
0020: * can share common names and concepts at the same time minimizing
0021: * the number of classes, names and constants for the application
0022: * programmer.
0023: * </p><p>
0024: * Note that some of the constants provided by this class represent
0025: * optional, appearance related aspects of widgets which are available
0026: * either only on some window systems, or for a differing set of
0027: * widgets on each window system. These constants are marked
0028: * as <em>HINT</em>s. The set of widgets which support a particular
0029: * <em>HINT</em> may change from release to release, although we typically
0030: * will not withdraw support for a <em>HINT</em> once it is made available.
0031: * </p>
0032: */
0033:
0034: /* NOTE:
0035: * Good javadoc coding style is to put the values of static final
0036: * constants in the comments. This reinforces the fact that
0037: * consumers are allowed to rely on the value (and they must
0038: * since the values are compiled inline in their code). We
0039: * can <em>not</em> change the values of these constants between
0040: * releases.
0041: */
0042: public class SWT {
0043:
0044: /* Widget Event Constants */
0045:
0046: /**
0047: * The null event type (value is 0).
0048: *
0049: * @since 3.0
0050: */
0051: public static final int None = 0;
0052:
0053: /**
0054: * The key down event type (value is 1).
0055: *
0056: * @see org.eclipse.swt.widgets.Widget#addListener
0057: * @see org.eclipse.swt.widgets.Display#addFilter
0058: * @see org.eclipse.swt.widgets.Event
0059: *
0060: * @see org.eclipse.swt.widgets.Control#addKeyListener
0061: * @see org.eclipse.swt.widgets.Tracker#addKeyListener
0062: * @see org.eclipse.swt.events.KeyListener#keyPressed
0063: * @see org.eclipse.swt.events.KeyEvent
0064: */
0065: public static final int KeyDown = 1;
0066:
0067: /**
0068: * The key up event type (value is 2).
0069: *
0070: * @see org.eclipse.swt.widgets.Widget#addListener
0071: * @see org.eclipse.swt.widgets.Display#addFilter
0072: * @see org.eclipse.swt.widgets.Event
0073: *
0074: * @see org.eclipse.swt.widgets.Control#addKeyListener
0075: * @see org.eclipse.swt.widgets.Tracker#addKeyListener
0076: * @see org.eclipse.swt.events.KeyListener#keyReleased
0077: * @see org.eclipse.swt.events.KeyEvent
0078: */
0079: public static final int KeyUp = 2;
0080:
0081: /**
0082: * The mouse down event type (value is 3).
0083: *
0084: * @see org.eclipse.swt.widgets.Widget#addListener
0085: * @see org.eclipse.swt.widgets.Display#addFilter
0086: * @see org.eclipse.swt.widgets.Event
0087: *
0088: * @see org.eclipse.swt.widgets.Control#addMouseListener
0089: * @see org.eclipse.swt.events.MouseListener#mouseDown
0090: * @see org.eclipse.swt.events.MouseEvent
0091: */
0092: public static final int MouseDown = 3;
0093:
0094: /**
0095: * The mouse up event type (value is 4).
0096: *
0097: * @see org.eclipse.swt.widgets.Widget#addListener
0098: * @see org.eclipse.swt.widgets.Display#addFilter
0099: * @see org.eclipse.swt.widgets.Event
0100: *
0101: * @see org.eclipse.swt.widgets.Control#addMouseListener
0102: * @see org.eclipse.swt.events.MouseListener#mouseUp
0103: * @see org.eclipse.swt.events.MouseEvent
0104: */
0105: public static final int MouseUp = 4;
0106:
0107: /**
0108: * The mouse move event type (value is 5).
0109: *
0110: * @see org.eclipse.swt.widgets.Widget#addListener
0111: * @see org.eclipse.swt.widgets.Display#addFilter
0112: * @see org.eclipse.swt.widgets.Event
0113: *
0114: * @see org.eclipse.swt.widgets.Control#addMouseMoveListener
0115: * @see org.eclipse.swt.events.MouseMoveListener#mouseMove
0116: * @see org.eclipse.swt.events.MouseEvent
0117: */
0118: public static final int MouseMove = 5;
0119:
0120: /**
0121: * The mouse enter event type (value is 6).
0122: *
0123: * @see org.eclipse.swt.widgets.Widget#addListener
0124: * @see org.eclipse.swt.widgets.Display#addFilter
0125: * @see org.eclipse.swt.widgets.Event
0126: *
0127: * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
0128: * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter
0129: * @see org.eclipse.swt.events.MouseEvent
0130: */
0131: public static final int MouseEnter = 6;
0132:
0133: /**
0134: * The mouse exit event type (value is 7).
0135: *
0136: * @see org.eclipse.swt.widgets.Widget#addListener
0137: * @see org.eclipse.swt.widgets.Display#addFilter
0138: * @see org.eclipse.swt.widgets.Event
0139: *
0140: * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
0141: * @see org.eclipse.swt.events.MouseTrackListener#mouseExit
0142: * @see org.eclipse.swt.events.MouseEvent
0143: */
0144: public static final int MouseExit = 7;
0145:
0146: /**
0147: * The mouse double click event type (value is 8).
0148: *
0149: * @see org.eclipse.swt.widgets.Widget#addListener
0150: * @see org.eclipse.swt.widgets.Display#addFilter
0151: * @see org.eclipse.swt.widgets.Event
0152: *
0153: * @see org.eclipse.swt.widgets.Control#addMouseListener
0154: * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick
0155: * @see org.eclipse.swt.events.MouseEvent
0156: */
0157: public static final int MouseDoubleClick = 8;
0158:
0159: /**
0160: * The paint event type (value is 9).
0161: *
0162: * @see org.eclipse.swt.widgets.Widget#addListener
0163: * @see org.eclipse.swt.widgets.Display#addFilter
0164: * @see org.eclipse.swt.widgets.Event
0165: *
0166: * @see org.eclipse.swt.widgets.Control#addPaintListener
0167: * @see org.eclipse.swt.events.PaintListener#paintControl
0168: * @see org.eclipse.swt.events.PaintEvent
0169: */
0170: public static final int Paint = 9;
0171:
0172: /**
0173: * The move event type (value is 10).
0174: *
0175: * @see org.eclipse.swt.widgets.Widget#addListener
0176: * @see org.eclipse.swt.widgets.Display#addFilter
0177: * @see org.eclipse.swt.widgets.Event
0178: *
0179: * @see org.eclipse.swt.widgets.Control#addControlListener
0180: * @see org.eclipse.swt.widgets.TableColumn#addControlListener
0181: * @see org.eclipse.swt.widgets.Tracker#addControlListener
0182: * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
0183: * @see org.eclipse.swt.events.ControlListener#controlMoved
0184: * @see org.eclipse.swt.events.ControlEvent
0185: */
0186: public static final int Move = 10;
0187:
0188: /**
0189: * The resize event type (value is 11).
0190: *
0191: * @see org.eclipse.swt.widgets.Widget#addListener
0192: * @see org.eclipse.swt.widgets.Display#addFilter
0193: * @see org.eclipse.swt.widgets.Event
0194: *
0195: * @see org.eclipse.swt.widgets.Control#addControlListener
0196: * @see org.eclipse.swt.widgets.TableColumn#addControlListener
0197: * @see org.eclipse.swt.widgets.Tracker#addControlListener
0198: * @see org.eclipse.swt.widgets.TreeColumn#addControlListener
0199: * @see org.eclipse.swt.events.ControlListener#controlResized
0200: * @see org.eclipse.swt.events.ControlEvent
0201: */
0202: public static final int Resize = 11;
0203:
0204: /**
0205: * The dispose event type (value is 12).
0206: *
0207: * @see org.eclipse.swt.widgets.Widget#addListener
0208: * @see org.eclipse.swt.widgets.Display#addListener
0209: * @see org.eclipse.swt.widgets.Display#addFilter
0210: * @see org.eclipse.swt.widgets.Event
0211: *
0212: * @see org.eclipse.swt.widgets.Widget#addDisposeListener
0213: * @see org.eclipse.swt.events.DisposeListener#widgetDisposed
0214: * @see org.eclipse.swt.events.DisposeEvent
0215: */
0216: public static final int Dispose = 12;
0217:
0218: /**
0219: * The selection event type (value is 13).
0220: *
0221: * @see org.eclipse.swt.widgets.Widget#addListener
0222: * @see org.eclipse.swt.widgets.Display#addFilter
0223: * @see org.eclipse.swt.widgets.Event
0224: *
0225: * @see org.eclipse.swt.widgets.Button#addSelectionListener
0226: * @see org.eclipse.swt.widgets.Combo#addSelectionListener
0227: * @see org.eclipse.swt.widgets.CoolItem#addSelectionListener
0228: * @see org.eclipse.swt.widgets.Link#addSelectionListener
0229: * @see org.eclipse.swt.widgets.List#addSelectionListener
0230: * @see org.eclipse.swt.widgets.MenuItem#addSelectionListener
0231: * @see org.eclipse.swt.widgets.Sash#addSelectionListener
0232: * @see org.eclipse.swt.widgets.Scale#addSelectionListener
0233: * @see org.eclipse.swt.widgets.ScrollBar#addSelectionListener
0234: * @see org.eclipse.swt.widgets.Slider#addSelectionListener
0235: * @see org.eclipse.swt.widgets.TabFolder#addSelectionListener
0236: * @see org.eclipse.swt.widgets.Table#addSelectionListener
0237: * @see org.eclipse.swt.widgets.TableColumn#addSelectionListener
0238: * @see org.eclipse.swt.widgets.ToolItem#addSelectionListener
0239: * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
0240: * @see org.eclipse.swt.widgets.Tree#addSelectionListener
0241: * @see org.eclipse.swt.widgets.TreeColumn#addSelectionListener
0242: * @see org.eclipse.swt.events.SelectionListener#widgetSelected
0243: * @see org.eclipse.swt.events.SelectionEvent
0244: */
0245: public static final int Selection = 13;
0246:
0247: /**
0248: * The default selection event type (value is 14).
0249: *
0250: * @see org.eclipse.swt.widgets.Widget#addListener
0251: * @see org.eclipse.swt.widgets.Display#addFilter
0252: * @see org.eclipse.swt.widgets.Event
0253: *
0254: * @see org.eclipse.swt.widgets.Combo#addSelectionListener
0255: * @see org.eclipse.swt.widgets.List#addSelectionListener
0256: * @see org.eclipse.swt.widgets.Spinner#addSelectionListener
0257: * @see org.eclipse.swt.widgets.Table#addSelectionListener
0258: * @see org.eclipse.swt.widgets.Text#addSelectionListener
0259: * @see org.eclipse.swt.widgets.TrayItem#addSelectionListener
0260: * @see org.eclipse.swt.widgets.Tree#addSelectionListener
0261: * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected
0262: * @see org.eclipse.swt.events.SelectionEvent
0263: */
0264: public static final int DefaultSelection = 14;
0265:
0266: /**
0267: * The focus in event type (value is 15).
0268: *
0269: * @see org.eclipse.swt.widgets.Widget#addListener
0270: * @see org.eclipse.swt.widgets.Display#addFilter
0271: * @see org.eclipse.swt.widgets.Event
0272: *
0273: * @see org.eclipse.swt.widgets.Control#addFocusListener
0274: * @see org.eclipse.swt.events.FocusListener#focusGained
0275: * @see org.eclipse.swt.events.FocusEvent
0276: */
0277: public static final int FocusIn = 15;
0278:
0279: /**
0280: * The focus out event type (value is 16).
0281: *
0282: * @see org.eclipse.swt.widgets.Widget#addListener
0283: * @see org.eclipse.swt.widgets.Display#addFilter
0284: * @see org.eclipse.swt.widgets.Event
0285: *
0286: * @see org.eclipse.swt.widgets.Control#addFocusListener
0287: * @see org.eclipse.swt.events.FocusListener#focusLost
0288: * @see org.eclipse.swt.events.FocusEvent
0289: */
0290: public static final int FocusOut = 16;
0291:
0292: /**
0293: * The expand event type (value is 17).
0294: *
0295: * @see org.eclipse.swt.widgets.Widget#addListener
0296: * @see org.eclipse.swt.widgets.Display#addFilter
0297: * @see org.eclipse.swt.widgets.Event
0298: *
0299: * @see org.eclipse.swt.widgets.Tree#addTreeListener
0300: * @see org.eclipse.swt.events.TreeListener#treeExpanded
0301: * @see org.eclipse.swt.events.TreeEvent
0302: */
0303: public static final int Expand = 17;
0304:
0305: /**
0306: * The collapse event type (value is 18).
0307: *
0308: * @see org.eclipse.swt.widgets.Widget#addListener
0309: * @see org.eclipse.swt.widgets.Display#addFilter
0310: * @see org.eclipse.swt.widgets.Event
0311: *
0312: * @see org.eclipse.swt.widgets.Tree#addTreeListener
0313: * @see org.eclipse.swt.events.TreeListener#treeCollapsed
0314: * @see org.eclipse.swt.events.TreeEvent
0315: */
0316: public static final int Collapse = 18;
0317:
0318: /**
0319: * The iconify event type (value is 19).
0320: *
0321: * @see org.eclipse.swt.widgets.Widget#addListener
0322: * @see org.eclipse.swt.widgets.Display#addFilter
0323: * @see org.eclipse.swt.widgets.Event
0324: *
0325: * @see org.eclipse.swt.widgets.Shell#addShellListener
0326: * @see org.eclipse.swt.events.ShellListener#shellIconified
0327: * @see org.eclipse.swt.events.ShellEvent
0328: */
0329: public static final int Iconify = 19;
0330:
0331: /**
0332: * The de-iconify event type (value is 20).
0333: *
0334: * @see org.eclipse.swt.widgets.Widget#addListener
0335: * @see org.eclipse.swt.widgets.Display#addFilter
0336: * @see org.eclipse.swt.widgets.Event
0337: *
0338: * @see org.eclipse.swt.widgets.Shell#addShellListener
0339: * @see org.eclipse.swt.events.ShellListener#shellDeiconified
0340: * @see org.eclipse.swt.events.ShellEvent
0341: */
0342: public static final int Deiconify = 20;
0343:
0344: /**
0345: * The close event type (value is 21).
0346: *
0347: * @see org.eclipse.swt.widgets.Widget#addListener
0348: * @see org.eclipse.swt.widgets.Display#addListener
0349: * @see org.eclipse.swt.widgets.Display#addFilter
0350: * @see org.eclipse.swt.widgets.Event
0351: *
0352: * @see org.eclipse.swt.widgets.Shell#addShellListener
0353: * @see org.eclipse.swt.events.ShellListener#shellClosed
0354: * @see org.eclipse.swt.events.ShellEvent
0355: */
0356: public static final int Close = 21;
0357:
0358: /**
0359: * The show event type (value is 22).
0360: *
0361: * @see org.eclipse.swt.widgets.Widget#addListener
0362: * @see org.eclipse.swt.widgets.Display#addFilter
0363: * @see org.eclipse.swt.widgets.Event
0364: *
0365: * @see org.eclipse.swt.widgets.Menu#addMenuListener
0366: * @see org.eclipse.swt.events.MenuListener#menuShown
0367: * @see org.eclipse.swt.events.MenuEvent
0368: */
0369: public static final int Show = 22;
0370:
0371: /**
0372: * The hide event type (value is 23).
0373: *
0374: * @see org.eclipse.swt.widgets.Widget#addListener
0375: * @see org.eclipse.swt.widgets.Display#addFilter
0376: * @see org.eclipse.swt.widgets.Event
0377: *
0378: * @see org.eclipse.swt.widgets.Menu#addMenuListener
0379: * @see org.eclipse.swt.events.MenuListener#menuHidden
0380: * @see org.eclipse.swt.events.MenuEvent
0381: */
0382: public static final int Hide = 23;
0383:
0384: /**
0385: * The modify event type (value is 24).
0386: *
0387: * @see org.eclipse.swt.widgets.Widget#addListener
0388: * @see org.eclipse.swt.widgets.Display#addFilter
0389: * @see org.eclipse.swt.widgets.Event
0390: *
0391: * @see org.eclipse.swt.widgets.Combo#addModifyListener
0392: * @see org.eclipse.swt.widgets.Spinner#addModifyListener
0393: * @see org.eclipse.swt.widgets.Text#addModifyListener
0394: * @see org.eclipse.swt.events.ModifyListener#modifyText
0395: * @see org.eclipse.swt.events.ModifyEvent
0396: */
0397: public static final int Modify = 24;
0398:
0399: /**
0400: * The verify event type (value is 25).
0401: *
0402: * @see org.eclipse.swt.widgets.Widget#addListener
0403: * @see org.eclipse.swt.widgets.Display#addFilter
0404: * @see org.eclipse.swt.widgets.Event
0405: *
0406: * @see org.eclipse.swt.widgets.Combo#addVerifyListener
0407: * @see org.eclipse.swt.widgets.Text#addVerifyListener
0408: * @see org.eclipse.swt.events.VerifyListener#verifyText
0409: * @see org.eclipse.swt.events.VerifyEvent
0410: */
0411: public static final int Verify = 25;
0412:
0413: /**
0414: * The activate event type (value is 26).
0415: *
0416: * @see org.eclipse.swt.widgets.Widget#addListener
0417: * @see org.eclipse.swt.widgets.Display#addFilter
0418: * @see org.eclipse.swt.widgets.Event
0419: *
0420: * @see org.eclipse.swt.widgets.Shell#addShellListener
0421: * @see org.eclipse.swt.events.ShellListener#shellActivated
0422: * @see org.eclipse.swt.events.ShellEvent
0423: */
0424: public static final int Activate = 26;
0425:
0426: /**
0427: * The deactivate event type (value is 27).
0428: *
0429: * @see org.eclipse.swt.widgets.Widget#addListener
0430: * @see org.eclipse.swt.widgets.Display#addFilter
0431: * @see org.eclipse.swt.widgets.Event
0432: *
0433: * @see org.eclipse.swt.widgets.Shell#addShellListener
0434: * @see org.eclipse.swt.events.ShellListener#shellDeactivated
0435: * @see org.eclipse.swt.events.ShellEvent
0436: */
0437: public static final int Deactivate = 27;
0438:
0439: /**
0440: * The help event type (value is 28).
0441: *
0442: * @see org.eclipse.swt.widgets.Widget#addListener
0443: * @see org.eclipse.swt.widgets.Display#addFilter
0444: * @see org.eclipse.swt.widgets.Event
0445: *
0446: * @see org.eclipse.swt.widgets.Control#addHelpListener
0447: * @see org.eclipse.swt.widgets.Menu#addHelpListener
0448: * @see org.eclipse.swt.widgets.MenuItem#addHelpListener
0449: * @see org.eclipse.swt.events.HelpListener#helpRequested
0450: * @see org.eclipse.swt.events.HelpEvent
0451: */
0452: public static final int Help = 28;
0453:
0454: /**
0455: * The drag detect event type (value is 29).
0456: *
0457: * @see org.eclipse.swt.widgets.Widget#addListener
0458: * @see org.eclipse.swt.widgets.Display#addFilter
0459: * @see org.eclipse.swt.widgets.Event
0460: *
0461: * @see org.eclipse.swt.dnd.DragSource
0462: */
0463: public static final int DragDetect = 29;
0464:
0465: /**
0466: * The arm event type (value is 30).
0467: *
0468: * @see org.eclipse.swt.widgets.Widget#addListener
0469: * @see org.eclipse.swt.widgets.Display#addFilter
0470: * @see org.eclipse.swt.widgets.Event
0471: *
0472: * @see org.eclipse.swt.widgets.MenuItem#addArmListener
0473: * @see org.eclipse.swt.events.ArmListener#widgetArmed
0474: * @see org.eclipse.swt.events.ArmEvent
0475: */
0476: public static final int Arm = 30;
0477:
0478: /**
0479: * The traverse event type (value is 31).
0480: *
0481: * @see org.eclipse.swt.widgets.Widget#addListener
0482: * @see org.eclipse.swt.widgets.Display#addFilter
0483: * @see org.eclipse.swt.widgets.Event
0484: *
0485: * @see org.eclipse.swt.widgets.Control#addTraverseListener
0486: * @see org.eclipse.swt.events.TraverseListener#keyTraversed
0487: * @see org.eclipse.swt.events.TraverseEvent
0488: */
0489: public static final int Traverse = 31;
0490:
0491: /**
0492: * The mouse hover event type (value is 32).
0493: *
0494: * @see org.eclipse.swt.widgets.Widget#addListener
0495: * @see org.eclipse.swt.widgets.Display#addFilter
0496: * @see org.eclipse.swt.widgets.Event
0497: *
0498: * @see org.eclipse.swt.widgets.Control#addMouseTrackListener
0499: * @see org.eclipse.swt.events.MouseTrackListener#mouseHover
0500: * @see org.eclipse.swt.events.MouseEvent
0501: */
0502: public static final int MouseHover = 32;
0503:
0504: /**
0505: * The hardware key down event type (value is 33).
0506: *
0507: * @see org.eclipse.swt.widgets.Widget#addListener
0508: * @see org.eclipse.swt.widgets.Display#addFilter
0509: * @see org.eclipse.swt.widgets.Event
0510: */
0511: public static final int HardKeyDown = 33;
0512:
0513: /**
0514: * The hardware key up event type (value is 34).
0515: *
0516: * @see org.eclipse.swt.widgets.Widget#addListener
0517: * @see org.eclipse.swt.widgets.Display#addFilter
0518: * @see org.eclipse.swt.widgets.Event
0519: */
0520: public static final int HardKeyUp = 34;
0521:
0522: /**
0523: * The menu detect event type (value is 35).
0524: *
0525: * @see org.eclipse.swt.widgets.Widget#addListener
0526: * @see org.eclipse.swt.widgets.Display#addFilter
0527: * @see org.eclipse.swt.widgets.Event
0528: *
0529: * @since 3.0
0530: */
0531: public static final int MenuDetect = 35;
0532:
0533: /**
0534: * The set data event type (value is 36).
0535: *
0536: * @see org.eclipse.swt.widgets.Widget#addListener
0537: * @see org.eclipse.swt.widgets.Display#addFilter
0538: * @see org.eclipse.swt.widgets.Event
0539: *
0540: * @see org.eclipse.swt.widgets.Table
0541: * @see org.eclipse.swt.widgets.Tree
0542: *
0543: * @since 3.0
0544: */
0545: public static final int SetData = 36;
0546:
0547: /**
0548: * The mouse wheel event type (value is 37).
0549: *
0550: * @see org.eclipse.swt.widgets.Widget#addListener
0551: * @see org.eclipse.swt.widgets.Display#addFilter
0552: * @see org.eclipse.swt.widgets.Event
0553: *
0554: * @since 3.1
0555: */
0556: public static final int MouseWheel = 37;
0557:
0558: /**
0559: * The settings changed event type (value is 39).
0560: * <p>
0561: * The settings changed event is sent when an operating system
0562: * property, such as a system font or color, has been changed.
0563: * The event occurs after the property has been changed, but
0564: * before any widget is redrawn. Applications that cache operating
0565: * system properties can use this event to update their caches.
0566: * A specific property change can be detected by querying the
0567: * new value of a property and comparing it with the equivalent
0568: * cached value. The operating system automatically redraws and
0569: * lays out all widgets after this event is sent.
0570: * </p>
0571: *
0572: * @see org.eclipse.swt.widgets.Display#addListener
0573: * @see org.eclipse.swt.widgets.Event
0574: *
0575: * @since 3.2
0576: */
0577: public static final int Settings = 39;
0578:
0579: /**
0580: * The erase item event type (value is 40).
0581: *
0582: * @see org.eclipse.swt.widgets.Widget#addListener
0583: * @see org.eclipse.swt.widgets.Display#addFilter
0584: * @see org.eclipse.swt.widgets.Event
0585: *
0586: * @since 3.2
0587: */
0588: public static final int EraseItem = 40;
0589:
0590: /**
0591: * The measure item event type (value is 41).
0592: *
0593: * @see org.eclipse.swt.widgets.Widget#addListener
0594: * @see org.eclipse.swt.widgets.Display#addFilter
0595: * @see org.eclipse.swt.widgets.Event
0596: *
0597: * @since 3.2
0598: */
0599: public static final int MeasureItem = 41;
0600:
0601: /**
0602: * The paint item event type (value is 42).
0603: *
0604: * @see org.eclipse.swt.widgets.Widget#addListener
0605: * @see org.eclipse.swt.widgets.Display#addFilter
0606: * @see org.eclipse.swt.widgets.Event
0607: *
0608: * @since 3.2
0609: */
0610: public static final int PaintItem = 42;
0611:
0612: /**
0613: * The IME composition event type (value is 43).
0614: * <p>
0615: * The IME composition event is sent to allow
0616: * custom text editors to implement in-line
0617: * editing of international text.
0618: * </p>
0619: *
0620: * The detail field indicates the action to be taken:
0621: * <p><ul>
0622: * <li>{@link SWT#COMPOSITION_CHANGED}</li>
0623: * <li>{@link SWT#COMPOSITION_HITTEST}</li>
0624: * </ul></p>
0625: *
0626: * @see org.eclipse.swt.widgets.Widget#addListener
0627: * @see org.eclipse.swt.widgets.Display#addFilter
0628: * @see org.eclipse.swt.widgets.Event
0629: *
0630: * @since 3.4
0631: */
0632: public static final int ImeComposition = 43;
0633:
0634: /* Event Details */
0635:
0636: /**
0637: * The IME composition event detail that indicates
0638: * a change in the IME composition. The text, ranges,
0639: * and styles fields of the event define the appearance
0640: * of the composition text. The index field of the event
0641: * indicates the offset of the caret within the text.
0642: * The wideCaret field indicates that the caret should
0643: * be set to the width of the text (value is 1).
0644: *
0645: * @see SWT#ImeComposition
0646: *
0647: * @since 3.4
0648: */
0649: public static final int COMPOSITION_CHANGED = 1;
0650:
0651: /**
0652: * The IME composition event detail that indicates
0653: * that an IME hit test occurred. The x and y fields
0654: * of the event are used by the application to set
0655: * the hitTest, index and trailing fields of the event.
0656: *
0657: * The hitTest values are:
0658: * <p><ul>
0659: * <li>{@link SWT#HITTEST_OUTSIDE_TEXT}</li>
0660: * <li>{@link SWT#HITTEST_INSIDE_TEXT}</li>
0661: * <li>{@link SWT#HITTEST_INSIDE_COMPOSITION}</li>
0662: * </ul></p>
0663: *
0664: * The index field of the event is the caret offset
0665: * relative to the composition text. The trailing field
0666: * is used to indicate that the hit test occurred in the
0667: * leading edge (0) or trailing edge (1) of the character
0668: * at index (value is 2).
0669: *
0670: * @see SWT#ImeComposition
0671: * @see org.eclipse.swt.graphics.TextLayout#getOffset(int, int, int[])
0672: *
0673: * @since 3.4
0674: */
0675: public static final int COMPOSITION_HITTEST = 2;
0676:
0677: /**
0678: * Indicates that a hit test has occurred outside of
0679: * the text (value is 1).
0680: *
0681: * @see SWT#COMPOSITION_HITTEST
0682: * @see org.eclipse.swt.widgets.Event#hitTest
0683: *
0684: * @since 3.4
0685: */
0686: public static final int HITTEST_OUTSIDE_TEXT = 1;
0687:
0688: /**
0689: * Indicates that a hit test has occurred inside of
0690: * the text (value is 2).
0691: *
0692: * @see SWT#COMPOSITION_HITTEST
0693: * @see org.eclipse.swt.widgets.Event#hitTest
0694: *
0695: * @since 3.4
0696: */
0697: public static final int HITTEST_INSIDE_TEXT = 2;
0698:
0699: /**
0700: * Indicates that a hit test has occurred inside of
0701: * the IME composition text (value is 3).
0702: *
0703: * @see SWT#COMPOSITION_HITTEST
0704: * @see org.eclipse.swt.widgets.Event#hitTest
0705: *
0706: * @since 3.4
0707: */
0708: public static final int HITTEST_INSIDE_COMPOSITION = 3;
0709:
0710: /**
0711: * Indicates that a user-interface component is being dragged,
0712: * for example dragging the thumb of a scroll bar (value is 1).
0713: */
0714: public static final int DRAG = 1;
0715:
0716: /**
0717: * Event detail field that indicates a user-interface component
0718: * state is selected (value is 1<<1).
0719: *
0720: * @since 3.2
0721: */
0722: public static final int SELECTED = 1 << 1;
0723:
0724: /**
0725: * Event detail field that indicates a user-interface component
0726: * state is focused (value is 1<<2).
0727: *
0728: * @since 3.2
0729: */
0730: public static final int FOCUSED = 1 << 2;
0731:
0732: /**
0733: * Event detail field that indicates a user-interface component
0734: * draws the background (value is 1<<3).
0735: *
0736: * @since 3.2
0737: */
0738: public static final int BACKGROUND = 1 << 3;
0739:
0740: /**
0741: * Event detail field that indicates a user-interface component
0742: * draws the foreground (value is 1<<4).
0743: *
0744: * @since 3.2
0745: */
0746: public static final int FOREGROUND = 1 << 4;
0747:
0748: /**
0749: * Event detail field that indicates a user-interface component
0750: * state is hot (value is 1<<5).
0751: *
0752: * @since 3.3
0753: */
0754: public static final int HOT = 1 << 5;
0755:
0756: /* This code is intentionally commented */
0757: //public static final int PRESSED = 1 << 3;
0758: //public static final int ACTIVE = 1 << 4;
0759: //public static final int DISABLED = 1 << 5;
0760: //public static final int HOT = 1 << 6;
0761: //public static final int DEFAULTED = 1 << 7;
0762: /**
0763: * Traversal event detail field value indicating that no
0764: * traversal action should be taken
0765: * (value is 0).
0766: */
0767: public static final int TRAVERSE_NONE = 0;
0768:
0769: /**
0770: * Traversal event detail field value indicating that the
0771: * key which designates that a dialog should be cancelled was
0772: * pressed; typically, this is the ESC key
0773: * (value is 1<<1).
0774: */
0775: public static final int TRAVERSE_ESCAPE = 1 << 1;
0776:
0777: /**
0778: * Traversal event detail field value indicating that the
0779: * key which activates the default button in a dialog was
0780: * pressed; typically, this is the ENTER key
0781: * (value is 1<<2).
0782: */
0783: public static final int TRAVERSE_RETURN = 1 << 2;
0784:
0785: /**
0786: * Traversal event detail field value indicating that the
0787: * key which designates that focus should be given to the
0788: * previous tab group was pressed; typically, this is the
0789: * SHIFT-TAB key sequence
0790: * (value is 1<<3).
0791: */
0792: public static final int TRAVERSE_TAB_PREVIOUS = 1 << 3;
0793:
0794: /**
0795: * Traversal event detail field value indicating that the
0796: * key which designates that focus should be given to the
0797: * next tab group was pressed; typically, this is the
0798: * TAB key
0799: * (value is 1<<4).
0800: */
0801: public static final int TRAVERSE_TAB_NEXT = 1 << 4;
0802:
0803: /**
0804: * Traversal event detail field value indicating that the
0805: * key which designates that focus should be given to the
0806: * previous tab item was pressed; typically, this is either
0807: * the LEFT-ARROW or UP-ARROW keys
0808: * (value is 1<<5).
0809: */
0810: public static final int TRAVERSE_ARROW_PREVIOUS = 1 << 5;
0811:
0812: /**
0813: * Traversal event detail field value indicating that the
0814: * key which designates that focus should be given to the
0815: * previous tab item was pressed; typically, this is either
0816: * the RIGHT-ARROW or DOWN-ARROW keys
0817: * (value is 1<<6).
0818: */
0819: public static final int TRAVERSE_ARROW_NEXT = 1 << 6;
0820:
0821: /**
0822: * Traversal event detail field value indicating that a
0823: * mnemonic key sequence was pressed
0824: * (value is 1<<7).
0825: */
0826: public static final int TRAVERSE_MNEMONIC = 1 << 7;
0827:
0828: /**
0829: * Traversal event detail field value indicating that the
0830: * key which designates that the previous page of a multi-page
0831: * window should be shown was pressed; typically, this
0832: * is the CTRL-PAGEUP key sequence
0833: * (value is 1<<8).
0834: */
0835: public static final int TRAVERSE_PAGE_PREVIOUS = 1 << 8;
0836:
0837: /**
0838: * Traversal event detail field value indicating that the
0839: * key which designates that the next page of a multi-page
0840: * window should be shown was pressed; typically, this
0841: * is the CTRL-PAGEDOWN key sequence
0842: * (value is 1<<9).
0843: */
0844: public static final int TRAVERSE_PAGE_NEXT = 1 << 9;
0845:
0846: /**
0847: * A constant known to be zero (0), typically used in operations
0848: * which take bit flags to indicate that "no bits are set".
0849: */
0850: public static final int NONE = 0;
0851:
0852: /**
0853: * A constant known to be zero (0), used in operations which
0854: * take pointers to indicate a null argument.
0855: */
0856: public static final int NULL = 0;
0857:
0858: /**
0859: * Indicates that a default should be used (value is -1).
0860: */
0861: public static final int DEFAULT = -1;
0862:
0863: /**
0864: * Indicates that a property is off (value is 0).
0865: *
0866: * @since 3.1
0867: */
0868: public static final int OFF = 0;
0869:
0870: /**
0871: * Indicates that a property is on (value is 1).
0872: *
0873: * @since 3.1
0874: */
0875: public static final int ON = 1;
0876:
0877: /**
0878: * Indicates low quality (value is 1).
0879: *
0880: * @since 3.1
0881: */
0882: public static final int LOW = 1;
0883:
0884: /**
0885: * Indicates high quality (value is 2).
0886: *
0887: * @since 3.1
0888: */
0889: public static final int HIGH = 2;
0890:
0891: /**
0892: * Style constant for menu bar behavior (value is 1<<1).
0893: * <p><b>Used By:</b><ul>
0894: * <li><code>Menu</code></li>
0895: * </ul></p>
0896: */
0897: public static final int BAR = 1 << 1;
0898:
0899: /**
0900: * Style constant for drop down menu/list behavior (value is 1<<2).
0901: * <p><b>Used By:</b><ul>
0902: * <li><code>Menu</code></li>
0903: * <li><code>ToolItem</code></li>
0904: * <li><code>CoolItem</code></li>
0905: * <li><code>Combo</code></li>
0906: * </ul></p>
0907: */
0908: public static final int DROP_DOWN = 1 << 2;
0909:
0910: /**
0911: * Style constant for pop up menu behavior (value is 1<<3).
0912: * <p><b>Used By:</b><ul>
0913: * <li><code>Menu</code></li>
0914: * </ul></p>
0915: */
0916: public static final int POP_UP = 1 << 3;
0917:
0918: /**
0919: * Style constant for line separator behavior (value is 1<<1).
0920: * <p><b>Used By:</b><ul>
0921: * <li><code>Label</code></li>
0922: * <li><code>MenuItem</code></li>
0923: * <li><code>ToolItem</code></li>
0924: * </ul></p>
0925: */
0926: public static final int SEPARATOR = 1 << 1;
0927:
0928: /**
0929: * Style constant for toggle button behavior (value is 1<<1).
0930: * <p><b>Used By:</b><ul>
0931: * <li><code>Button</code></li>
0932: * </ul></p>
0933: */
0934: public static final int TOGGLE = 1 << 1;
0935:
0936: /**
0937: * Style constant for arrow button behavior (value is 1<<2).
0938: * <p><b>Used By:</b><ul>
0939: * <li><code>Button</code></li>
0940: * </ul></p>
0941: */
0942: public static final int ARROW = 1 << 2;
0943:
0944: /**
0945: * Style constant for push button behavior (value is 1<<3).
0946: * <p><b>Used By:</b><ul>
0947: * <li><code>Button</code></li>
0948: * <li><code>MenuItem</code></li>
0949: * <li><code>ToolItem</code></li>
0950: * </ul></p>
0951: */
0952: public static final int PUSH = 1 << 3;
0953:
0954: /**
0955: * Style constant for radio button behavior (value is 1<<4).
0956: * <p><b>Used By:</b><ul>
0957: * <li><code>Button</code></li>
0958: * <li><code>MenuItem</code></li>
0959: * <li><code>ToolItem</code></li>
0960: * </ul></p>
0961: */
0962: public static final int RADIO = 1 << 4;
0963:
0964: /**
0965: * Style constant for check box behavior (value is 1<<5).
0966: * <p><b>Used By:</b><ul>
0967: * <li><code>Button</code></li>
0968: * <li><code>MenuItem</code></li>
0969: * <li><code>ToolItem</code></li>
0970: * <li><code>Table</code></li>
0971: * <li><code>Tree</code></li>
0972: * </ul></p>
0973: */
0974: public static final int CHECK = 1 << 5;
0975:
0976: /**
0977: * Style constant for cascade behavior (value is 1<<6).
0978: * <p><b>Used By:</b><ul>
0979: * <li><code>MenuItem</code></li>
0980: * </ul></p>
0981: */
0982: public static final int CASCADE = 1 << 6;
0983:
0984: /**
0985: * Style constant for multi-selection behavior in lists
0986: * and multiple line support on text fields (value is 1<<1).
0987: * <p><b>Used By:</b><ul>
0988: * <li><code>Text</code></li>
0989: * <li><code>List</code></li>
0990: * <li><code>FileDialog</code></li>
0991: * </ul></p>
0992: */
0993: public static final int MULTI = 1 << 1;
0994:
0995: /**
0996: * Style constant for single selection behavior in lists
0997: * and single line support on text fields (value is 1<<2).
0998: * <p><b>Used By:</b><ul>
0999: * <li><code>Text</code></li>
1000: * <li><code>List</code></li>
1001: * <li><code>Table</code></li>
1002: * <li><code>Tree</code></li>
1003: * </ul></p>
1004: */
1005: public static final int SINGLE = 1 << 2;
1006:
1007: /**
1008: * Style constant for read-only behavior (value is 1<<3).
1009: * <p><b>Used By:</b><ul>
1010: * <li><code>Combo</code></li>
1011: * <li><code>Text</code></li>
1012: * </ul></p>
1013: */
1014: public static final int READ_ONLY = 1 << 3;
1015:
1016: /**
1017: * Style constant for automatic line wrap behavior (value is 1<<6).
1018: * <p><b>Used By:</b><ul>
1019: * <li><code>Label</code></li>
1020: * <li><code>Text</code></li>
1021: * <li><code>ToolBar</code></li>
1022: * <li><code>Spinner</code></li>
1023: * </ul></p>
1024: */
1025: public static final int WRAP = 1 << 6;
1026:
1027: /**
1028: * Style constant for search behavior (value is 1<<7).
1029: * <p><b>Used By:</b><ul>
1030: * <li><code>Text</code></li>
1031: * </ul></p>
1032: *
1033: * @since 3.3
1034: */
1035: public static final int SEARCH = 1 << 7;
1036:
1037: /**
1038: * Style constant for simple (not drop down) behavior (value is 1<<6).
1039: * <p><b>Used By:</b><ul>
1040: * <li><code>Combo</code></li>
1041: * </ul></p>
1042: */
1043: public static final int SIMPLE = 1 << 6;
1044:
1045: /**
1046: * Style constant for password behavior (value is 1<<22).
1047: * <p><b>Used By:</b><ul>
1048: * <li><code>Text</code></li>
1049: * </ul></p>
1050: *
1051: * @since 3.0
1052: */
1053: public static final int PASSWORD = 1 << 22;
1054:
1055: /**
1056: * Style constant for shadow in behavior (value is 1<<2).
1057: * <br>Note that this is a <em>HINT</em>.
1058: * <p><b>Used By:</b><ul>
1059: * <li><code>Label</code></li>
1060: * <li><code>Group</code></li>
1061: * </ul></p>
1062: */
1063: public static final int SHADOW_IN = 1 << 2;
1064:
1065: /**
1066: * Style constant for shadow out behavior (value is 1<<3).
1067: * <br>Note that this is a <em>HINT</em>.
1068: * <p><b>Used By:</b><ul>
1069: * <li><code>Label</code></li>
1070: * <li><code>Group</code></li>
1071: * <li><code>ToolBar</code></li>
1072: * </ul></p>
1073: */
1074: public static final int SHADOW_OUT = 1 << 3;
1075:
1076: /**
1077: * Style constant for shadow etched in behavior (value is 1<<4).
1078: * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
1079: * <p><b>Used By:</b><ul>
1080: * <li><code>Group</code></li>
1081: * </ul></p>
1082: */
1083: public static final int SHADOW_ETCHED_IN = 1 << 4;
1084:
1085: /**
1086: * Style constant for shadow etched out behavior (value is 1<<6).
1087: * <br>Note that this is a <em>HINT</em>. It is ignored on all platforms except Motif.
1088: * <p><b>Used By:</b><ul>
1089: * <li><code>Group</code></li>
1090: * </ul></p>
1091: */
1092: public static final int SHADOW_ETCHED_OUT = 1 << 6;
1093:
1094: /**
1095: * Style constant for no shadow behavior (value is 1<<5).
1096: * <br>Note that this is a <em>HINT</em>.
1097: * <p><b>Used By:</b><ul>
1098: * <li><code>Label</code></li>
1099: * <li><code>Group</code></li>
1100: * </ul></p>
1101: */
1102: public static final int SHADOW_NONE = 1 << 5;
1103:
1104: /**
1105: * Style constant for progress bar behavior (value is 1<<1).
1106: * <p><b>Used By:</b><ul>
1107: * <li><code>ProgressBar</code></li>
1108: * </ul></p>
1109: */
1110: public static final int INDETERMINATE = 1 << 1;
1111:
1112: /**
1113: * Style constant for tool window behavior (value is 1<<2).
1114: * <p>
1115: * A tool window is a window intended to be used as a floating toolbar.
1116: * It typically has a title bar that is shorter than a normal title bar,
1117: * and the window title is typically drawn using a smaller font.
1118: * <br>Note that this is a <em>HINT</em>.
1119: * </p><p><b>Used By:</b><ul>
1120: * <li><code>Decorations</code> and subclasses</li>
1121: * </ul></p>
1122: */
1123: public static final int TOOL = 1 << 2;
1124:
1125: /**
1126: * Style constant to ensure no trimmings are used (value is 1<<3).
1127: * <br>Note that this overrides all other trim styles.
1128: * <p><b>Used By:</b><ul>
1129: * <li><code>Decorations</code> and subclasses</li>
1130: * </ul></p>
1131: */
1132: public static final int NO_TRIM = 1 << 3;
1133:
1134: /**
1135: * Style constant for resize box trim (value is 1<<4).
1136: * <p><b>Used By:</b><ul>
1137: * <li><code>Decorations</code> and subclasses</li>
1138: * <li><code>Tracker</code></li>
1139: * </ul></p>
1140: */
1141: public static final int RESIZE = 1 << 4;
1142:
1143: /**
1144: * Style constant for title area trim (value is 1<<5).
1145: * <p><b>Used By:</b><ul>
1146: * <li><code>Decorations</code> and subclasses</li>
1147: * </ul></p>
1148: */
1149: public static final int TITLE = 1 << 5;
1150:
1151: /**
1152: * Style constant for close box trim (value is 1<<6,
1153: * since we do not distinguish between CLOSE style and MENU style).
1154: * <p><b>Used By:</b><ul>
1155: * <li><code>Decorations</code> and subclasses</li>
1156: * </ul></p>
1157: */
1158: public static final int CLOSE = 1 << 6;
1159:
1160: /**
1161: * Style constant for shell menu trim (value is 1<<6,
1162: * since we do not distinguish between CLOSE style and MENU style).
1163: * <p><b>Used By:</b><ul>
1164: * <li><code>Decorations</code> and subclasses</li>
1165: * </ul></p>
1166: */
1167: public static final int MENU = CLOSE;
1168:
1169: /**
1170: * Style constant for minimize box trim (value is 1<<7).
1171: * <p><b>Used By:</b><ul>
1172: * <li><code>Decorations</code> and subclasses</li>
1173: * </ul></p>
1174: */
1175: public static final int MIN = 1 << 7;
1176:
1177: /**
1178: * Style constant for maximize box trim (value is 1<<10).
1179: * <p><b>Used By:</b><ul>
1180: * <li><code>Decorations</code> and subclasses</li>
1181: * </ul></p>
1182: */
1183: public static final int MAX = 1 << 10;
1184:
1185: /**
1186: * Style constant for horizontal scrollbar behavior (value is 1<<8).
1187: * <p><b>Used By:</b><ul>
1188: * <li><code>Scrollable</code> and subclasses</li>
1189: * </ul></p>
1190: */
1191: public static final int H_SCROLL = 1 << 8;
1192:
1193: /**
1194: * Style constant for vertical scrollbar behavior (value is 1<<9).
1195: * <p><b>Used By:</b><ul>
1196: * <li><code>Scrollable</code> and subclasses</li>
1197: * </ul></p>
1198: */
1199: public static final int V_SCROLL = 1 << 9;
1200:
1201: /**
1202: * Style constant for bordered behavior (value is 1<<11).
1203: * <br>Note that this is a <em>HINT</em>.
1204: * <p><b>Used By:</b><ul>
1205: * <li><code>Control</code> and subclasses</li>
1206: * </ul></p>
1207: */
1208: public static final int BORDER = 1 << 11;
1209:
1210: /**
1211: * Style constant indicating that the window manager should clip
1212: * a widget's children with respect to its viewable area. (value is 1<<12).
1213: * <br>Note that this is a <em>HINT</em>.
1214: * <p><b>Used By:</b><ul>
1215: * <li><code>Control</code> and subclasses</li>
1216: * </ul></p>
1217: */
1218: public static final int CLIP_CHILDREN = 1 << 12;
1219:
1220: /**
1221: * Style constant indicating that the window manager should clip
1222: * a widget's siblings with respect to its viewable area. (value is 1<<13).
1223: * <br>Note that this is a <em>HINT</em>.
1224: * <p><b>Used By:</b><ul>
1225: * <li><code>Control</code> and subclasses</li>
1226: * </ul></p>
1227: */
1228: public static final int CLIP_SIBLINGS = 1 << 13;
1229:
1230: /**
1231: * Style constant for always on top behavior (value is 1<<14).
1232: * <br>Note that this is a <em>HINT</em>.
1233: * <p><b>Used By:</b><ul>
1234: * <li><code>Shell</code> and subclasses</li>
1235: * </ul></p>
1236: */
1237: public static final int ON_TOP = 1 << 14;
1238:
1239: /**
1240: * Trim style convenience constant for the most common top level shell appearance
1241: * (value is CLOSE|TITLE|MIN|MAX|RESIZE).
1242: * <p><b>Used By:</b><ul>
1243: * <li><code>Shell</code></li>
1244: * </ul></p>
1245: */
1246: public static final int SHELL_TRIM = CLOSE | TITLE | MIN | MAX
1247: | RESIZE;
1248:
1249: /**
1250: * Trim style convenience constant for the most common dialog shell appearance
1251: * (value is CLOSE|TITLE|BORDER).
1252: * <p><b>Used By:</b><ul>
1253: * <li><code>Shell</code></li>
1254: * </ul></p>
1255: */
1256: public static final int DIALOG_TRIM = TITLE | CLOSE | BORDER;
1257:
1258: /**
1259: * Style constant for modeless behavior (value is 0).
1260: * <br>Note that this is a <em>HINT</em>.
1261: * <p><b>Used By:</b><ul>
1262: * <li><code>Dialog</code></li>
1263: * <li><code>Shell</code></li>
1264: * </ul></p>
1265: */
1266: public static final int MODELESS = 0;
1267:
1268: /**
1269: * Style constant for primary modal behavior (value is 1<<15).
1270: * <br>Note that this is a <em>HINT</em>.
1271: * <p><b>Used By:</b><ul>
1272: * <li><code>Dialog</code></li>
1273: * <li><code>Shell</code></li>
1274: * </ul></p>
1275: */
1276: public static final int PRIMARY_MODAL = 1 << 15;
1277:
1278: /**
1279: * Style constant for application modal behavior (value is 1<<16).
1280: * <br>Note that this is a <em>HINT</em>.
1281: * <p><b>Used By:</b><ul>
1282: * <li><code>Dialog</code></li>
1283: * <li><code>Shell</code></li>
1284: * </ul></p>
1285: */
1286: public static final int APPLICATION_MODAL = 1 << 16;
1287:
1288: /**
1289: * Style constant for system modal behavior (value is 1<<17).
1290: * <br>Note that this is a <em>HINT</em>.
1291: * <p><b>Used By:</b><ul>
1292: * <li><code>Dialog</code></li>
1293: * <li><code>Shell</code></li>
1294: * </ul></p>
1295: */
1296: public static final int SYSTEM_MODAL = 1 << 17;
1297:
1298: /**
1299: * Style constant for selection hiding behavior when the widget loses focus (value is 1<<15).
1300: * <br>Note that this is a <em>HINT</em>.
1301: * <p><b>Used By:</b><ul>
1302: * <li><code>Table</code></li>
1303: * </ul></p>
1304: */
1305: public static final int HIDE_SELECTION = 1 << 15;
1306:
1307: /**
1308: * Style constant for full row selection behavior and
1309: * selection constant indicating that a full line should be
1310: * drawn. (value is 1<<16).
1311: * <br>Note that for some widgets this is a <em>HINT</em>.
1312: * <p><b>Used By:</b><ul>
1313: * <li><code>Table</code></li>
1314: * <li><code>Tree</code></li>
1315: * <li><code>StyledText</code></li>
1316: * <li><code>TextLayout</code></li>
1317: * </ul></p>
1318: */
1319: public static final int FULL_SELECTION = 1 << 16;
1320:
1321: /**
1322: * Style constant for flat appearance. (value is 1<<23).
1323: * <br>Note that this is a <em>HINT</em>.
1324: * <p><b>Used By:</b><ul>
1325: * <li><code>Button</code></li>
1326: * <li><code>ToolBar</code></li>
1327: * </ul></p>
1328: */
1329: public static final int FLAT = 1 << 23;
1330:
1331: /**
1332: * Style constant for smooth appearance. (value is 1<<16).
1333: * <br>Note that this is a <em>HINT</em>.
1334: * <p><b>Used By:</b><ul>
1335: * <li><code>ProgressBar</code></li>
1336: * <li><code>Sash</code></li>
1337: * </ul></p>
1338: */
1339: public static final int SMOOTH = 1 << 16;
1340:
1341: /**
1342: * Style constant for no background behavior (value is 1<<18).
1343: * <p>
1344: * By default, before a widget paints, the client area is filled with the current background.
1345: * When this style is specified, the background is not filled, and the application is responsible
1346: * for filling every pixel of the client area.
1347: * This style might be used as an alternative to "double-buffering" in order to reduce flicker.
1348: * This style does not mean "transparent" - widgets that are obscured will not draw through.
1349: * </p><p><b>Used By:</b><ul>
1350: * <li><code>Composite</code></li>
1351: * </ul></p>
1352: */
1353: public static final int NO_BACKGROUND = 1 << 18;
1354:
1355: /**
1356: * Style constant for no focus from the mouse behavior (value is 1<<19).
1357: * <br>Note that this is a <em>HINT</em>.
1358: * <p><b>Used By:</b><ul>
1359: * <li><code>Composite</code></li>
1360: * </ul></p>
1361: */
1362: public static final int NO_FOCUS = 1 << 19;
1363:
1364: /**
1365: * Style constant for no redraw on resize behavior (value is 1<<20).
1366: * <p>
1367: * This style stops the entire client area from being invalidated when the size
1368: * of the Canvas changes. Specifically, when the size of the Canvas gets smaller,
1369: * the SWT.Paint event is not sent. When it gets bigger, an SWT.Paint event is
1370: * sent with a GC clipped to only the new areas to be painted. Without this
1371: * style, the entire client area will be repainted.
1372: * </p><p><b>Used By:</b><ul>
1373: * <li><code>Composite</code></li>
1374: * </ul></p>
1375: */
1376: public static final int NO_REDRAW_RESIZE = 1 << 20;
1377:
1378: /**
1379: * Style constant for no paint event merging behavior (value is 1<<21).
1380: * <p><b>Used By:</b><ul>
1381: * <li><code>Composite</code></li>
1382: * </ul></p>
1383: */
1384: public static final int NO_MERGE_PAINTS = 1 << 21;
1385:
1386: /**
1387: * Style constant for preventing child radio group behavior (value is 1<<22).
1388: * <p><b>Used By:</b><ul>
1389: * <li><code>Composite</code></li>
1390: * </ul></p>
1391: */
1392: public static final int NO_RADIO_GROUP = 1 << 22;
1393:
1394: /**
1395: * Style constant for left to right orientation (value is 1<<25).
1396: * <p>
1397: * When orientation is not explicitly specified, orientation is
1398: * inherited. This means that children will be assigned the
1399: * orientation of their parent. To override this behavior and
1400: * force an orientation for a child, explicitly set the orientation
1401: * of the child when that child is created.
1402: * <br>Note that this is a <em>HINT</em>.
1403: * </p>
1404: * <p><b>Used By:</b><ul>
1405: * <li><code>Control</code></li>
1406: * <li><code>Menu</code></li>
1407: * <li><code>GC</code></li>
1408: * </ul></p>
1409: *
1410: * @since 2.1.2
1411: */
1412: public static final int LEFT_TO_RIGHT = 1 << 25;
1413:
1414: /**
1415: * Style constant for right to left orientation (value is 1<<26).
1416: * <p>
1417: * When orientation is not explicitly specified, orientation is
1418: * inherited. This means that children will be assigned the
1419: * orientation of their parent. To override this behavior and
1420: * force an orientation for a child, explicitly set the orientation
1421: * of the child when that child is created.
1422: * <br>Note that this is a <em>HINT</em>.
1423: * </p>
1424: * <p><b>Used By:</b><ul>
1425: * <li><code>Control</code></li>
1426: * <li><code>Menu</code></li>
1427: * <li><code>GC</code></li>
1428: * </ul></p>
1429: *
1430: * @since 2.1.2
1431: */
1432: public static final int RIGHT_TO_LEFT = 1 << 26;
1433:
1434: /**
1435: * Style constant to indicate coordinate mirroring (value is 1<<27).
1436: * <p><b>Used By:</b><ul>
1437: * <li><code>Control</code></li>
1438: * <li><code>Menu</code></li>
1439: * </ul></p>
1440: *
1441: * @since 2.1.2
1442: */
1443: public static final int MIRRORED = 1 << 27;
1444:
1445: /**
1446: * Style constant to allow embedding (value is 1<<24).
1447: * <p><b>Used By:</b><ul>
1448: * <li><code>Composite</code></li>
1449: * </ul></p>
1450: *
1451: * @since 3.0
1452: */
1453: public static final int EMBEDDED = 1 << 24;
1454:
1455: /**
1456: * Style constant to allow virtual data (value is 1<<28).
1457: * <p><b>Used By:</b><ul>
1458: * <li><code>Table</code></li>
1459: * <li><code>Tree</code></li>
1460: * </ul></p>
1461: *
1462: * @since 3.0
1463: */
1464: public static final int VIRTUAL = 1 << 28;
1465:
1466: /**
1467: * Style constant to indicate double buffering (value is 1<<29).
1468: * <p><b>Used By:</b><ul>
1469: * <li><code>Control</code></li>
1470: * </ul></p>
1471: *
1472: * @since 3.1
1473: */
1474: public static final int DOUBLE_BUFFERED = 1 << 29;
1475:
1476: /**
1477: * Style constant for align up behavior (value is 1<<7,
1478: * since align UP and align TOP are considered the same).
1479: * <p><b>Used By:</b><ul>
1480: * <li><code>Button</code> with <code>ARROW</code> style</li>
1481: * <li><code>Tracker</code></li>
1482: * </ul></p>
1483: */
1484: public static final int UP = 1 << 7;
1485:
1486: /**
1487: * Style constant to indicate single underline (value is 0).
1488: * <p><b>Used By:</b><ul>
1489: * <li><code>TextStyle</code></li>
1490: * </ul></p>
1491: *
1492: * @since 3.4
1493: */
1494: public static final int UNDERLINE_SINGLE = 0;
1495:
1496: /**
1497: * Style constant to indicate double underline (value is 1).
1498: * <p><b>Used By:</b><ul>
1499: * <li><code>TextStyle</code></li>
1500: * </ul></p>
1501: *
1502: * @since 3.4
1503: */
1504: public static final int UNDERLINE_DOUBLE = 1;
1505:
1506: /**
1507: * Style constant to indicate error underline (value is 2).
1508: * <p><b>Used By:</b><ul>
1509: * <li><code>TextStyle</code></li>
1510: * </ul></p>
1511: *
1512: * @since 3.4
1513: */
1514: public static final int UNDERLINE_ERROR = 2;
1515:
1516: /**
1517: * Style constant for align top behavior (value is 1<<7,
1518: * since align UP and align TOP are considered the same).
1519: * <p><b>Used By:</b><ul>
1520: * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1521: * </ul></p>
1522: */
1523: public static final int TOP = UP;
1524:
1525: /**
1526: * Style constant for align down behavior (value is 1<<10,
1527: * since align DOWN and align BOTTOM are considered the same).
1528: * <p><b>Used By:</b><ul>
1529: * <li><code>Button</code> with <code>ARROW</code> style</li>
1530: * <li><code>Tracker</code></li>
1531: * </ul></p>
1532: */
1533: public static final int DOWN = 1 << 10;
1534:
1535: /**
1536: * Style constant for align bottom behavior (value is 1<<10,
1537: * since align DOWN and align BOTTOM are considered the same).
1538: * <p><b>Used By:</b><ul>
1539: * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1540: * </ul></p>
1541: */
1542: public static final int BOTTOM = DOWN;
1543:
1544: /**
1545: * Style constant for leading alignment (value is 1<<14).
1546: * <p><b>Used By:</b><ul>
1547: * <li><code>Button</code></li>
1548: * <li><code>Label</code></li>
1549: * <li><code>TableColumn</code></li>
1550: * <li><code>Tracker</code></li>
1551: * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1552: * </ul></p>
1553: *
1554: * @since 2.1.2
1555: */
1556: public static final int LEAD = 1 << 14;
1557:
1558: /**
1559: * Style constant for align left behavior (value is 1<<14).
1560: * This is a synonym for LEAD (value is 1<<14). Newer
1561: * applications should use LEAD instead of LEFT to make code more
1562: * understandable on right-to-left platforms.
1563: */
1564: public static final int LEFT = LEAD;
1565:
1566: /**
1567: * Style constant for trailing alignment (value is 1<<17).
1568: * <p><b>Used By:</b><ul>
1569: * <li><code>Button</code></li>
1570: * <li><code>Label</code></li>
1571: * <li><code>TableColumn</code></li>
1572: * <li><code>Tracker</code></li>
1573: * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1574: * </ul></p>
1575: *
1576: * @since 2.1.2
1577: */
1578: public static final int TRAIL = 1 << 17;
1579:
1580: /**
1581: * Style constant for align right behavior (value is 1<<17).
1582: * This is a synonym for TRAIL (value is 1<<17). Newer
1583: * applications should use TRAIL instead of RIGHT to make code more
1584: * understandable on right-to-left platforms.
1585: */
1586: public static final int RIGHT = TRAIL;
1587:
1588: /**
1589: * Style constant for align center behavior (value is 1<<24).
1590: * <p><b>Used By:</b><ul>
1591: * <li><code>Button</code></li>
1592: * <li><code>Label</code></li>
1593: * <li><code>TableColumn</code></li>
1594: * <li><code>FormAttachment</code> in a <code>FormLayout</code></li>
1595: * </ul></p>
1596: */
1597: public static final int CENTER = 1 << 24;
1598:
1599: /**
1600: * Style constant for horizontal alignment or orientation behavior (value is 1<<8).
1601: * <p><b>Used By:</b><ul>
1602: * <li><code>Label</code></li>
1603: * <li><code>ProgressBar</code></li>
1604: * <li><code>Sash</code></li>
1605: * <li><code>Scale</code></li>
1606: * <li><code>ScrollBar</code></li>
1607: * <li><code>Slider</code></li>
1608: * <li><code>ToolBar</code></li>
1609: * <li><code>FillLayout</code> type</li>
1610: * <li><code>RowLayout</code> type</li>
1611: * </ul></p>
1612: */
1613: public static final int HORIZONTAL = 1 << 8;
1614:
1615: /**
1616: * Style constant for vertical alignment or orientation behavior (value is 1<<9).
1617: * <p><b>Used By:</b><ul>
1618: * <li><code>Label</code></li>
1619: * <li><code>ProgressBar</code></li>
1620: * <li><code>Sash</code></li>
1621: * <li><code>Scale</code></li>
1622: * <li><code>ScrollBar</code></li>
1623: * <li><code>Slider</code></li>
1624: * <li><code>ToolBar</code></li>
1625: * <li><code>CoolBar</code></li>
1626: * <li><code>FillLayout</code> type</li>
1627: * <li><code>RowLayout</code> type</li>
1628: * </ul></p>
1629: */
1630: public static final int VERTICAL = 1 << 9;
1631:
1632: /**
1633: * Style constant for date display (value is 1<<5).
1634: * <p><b>Used By:</b><ul>
1635: * <li><code>DateTime</code></li>
1636: * </ul></p>
1637: *
1638: * @since 3.3
1639: */
1640: public static final int DATE = 1 << 5;
1641:
1642: /**
1643: * Style constant for time display (value is 1<<7).
1644: * <p><b>Used By:</b><ul>
1645: * <li><code>DateTime</code></li>
1646: * </ul></p>
1647: *
1648: * @since 3.3
1649: */
1650: public static final int TIME = 1 << 7;
1651:
1652: /**
1653: * Style constant for calendar display (value is 1<<10).
1654: * <p><b>Used By:</b><ul>
1655: * <li><code>DateTime</code></li>
1656: * </ul></p>
1657: *
1658: * @since 3.3
1659: */
1660: public static final int CALENDAR = 1 << 10;
1661:
1662: /**
1663: * Style constant for short date/time format (value is 1<<15).
1664: * <p>
1665: * A short date displays the month and year.
1666: * A short time displays hours and minutes.
1667: * <br>Note that this is a <em>HINT</em>.
1668: * </p>
1669: * <p><b>Used By:</b><ul>
1670: * <li><code>DateTime</code></li>
1671: * </ul></p>
1672: *
1673: * @since 3.3
1674: */
1675: public static final int SHORT = 1 << 15;
1676:
1677: /**
1678: * Style constant for medium date/time format (value is 1<<16).
1679: * <p>
1680: * A medium date displays the day, month and year.
1681: * A medium time displays hours, minutes, and seconds.
1682: * <br>Note that this is a <em>HINT</em>.
1683: * </p>
1684: * <p><b>Used By:</b><ul>
1685: * <li><code>DateTime</code></li>
1686: * </ul></p>
1687: *
1688: * @since 3.3
1689: */
1690: public static final int MEDIUM = 1 << 16;
1691:
1692: /**
1693: * Style constant for long date/time format (value is 1<<28).
1694: * <p>
1695: * A long date displays the day, month and year.
1696: * A long time displays hours, minutes, and seconds.
1697: * The day and month names may be displayed.
1698: * <br>Note that this is a <em>HINT</em>.
1699: * </p>
1700: * <p><b>Used By:</b><ul>
1701: * <li><code>DateTime</code></li>
1702: * </ul></p>
1703: *
1704: * @since 3.3
1705: */
1706: public static final int LONG = 1 << 28;
1707:
1708: /**
1709: * Style constant specifying that a Browser should use a Mozilla GRE
1710: * for rendering its content (value is 1<<15).
1711: * <p>
1712: * <p><b>Used By:</b><ul>
1713: * <li><code>Browser</code></li>
1714: * </ul></p>
1715: *
1716: * @since 3.3
1717: */
1718: public static final int MOZILLA = 1 << 15;
1719:
1720: /**
1721: * Style constant for balloon behavior (value is 1<<12).
1722: * <p><b>Used By:</b><ul>
1723: * <li><code>ToolTip</code></li>
1724: * </ul></p>
1725: *
1726: * @since 3.2
1727: */
1728: public static final int BALLOON = 1 << 12;
1729:
1730: /**
1731: * Style constant for vertical alignment or orientation behavior (value is 1).
1732: * <p><b>Used By:</b><ul>
1733: * <li><code>GridLayout</code> type</li>
1734: * </ul></p>
1735: */
1736: public static final int BEGINNING = 1;
1737:
1738: /**
1739: * Style constant for vertical alignment or orientation behavior (value is 4).
1740: * <p><b>Used By:</b><ul>
1741: * <li><code>GridLayout</code> type</li>
1742: * </ul></p>
1743: */
1744: public static final int FILL = 4;
1745:
1746: /**
1747: * Input Method Editor style constant for double byte
1748: * input behavior (value is 1<<1).
1749: */
1750: public static final int DBCS = 1 << 1;
1751:
1752: /**
1753: * Input Method Editor style constant for alpha
1754: * input behavior (value is 1<<2).
1755: */
1756: public static final int ALPHA = 1 << 2;
1757:
1758: /**
1759: * Input Method Editor style constant for native
1760: * input behavior (value is 1<<3).
1761: */
1762: public static final int NATIVE = 1 << 3;
1763:
1764: /**
1765: * Input Method Editor style constant for phonetic
1766: * input behavior (value is 1<<4).
1767: */
1768: public static final int PHONETIC = 1 << 4;
1769:
1770: /**
1771: * Input Method Editor style constant for romanicized
1772: * input behavior (value is 1<<5).
1773: */
1774: public static final int ROMAN = 1 << 5;
1775:
1776: /**
1777: * ASCII character convenience constant for the backspace character
1778: * (value is the <code>char</code> '\b').
1779: */
1780: public static final char BS = '\b';
1781:
1782: /**
1783: * ASCII character convenience constant for the carriage return character
1784: * (value is the <code>char</code> '\r').
1785: */
1786: public static final char CR = '\r';
1787:
1788: /**
1789: * ASCII character convenience constant for the delete character
1790: * (value is the <code>char</code> with value 127).
1791: */
1792: public static final char DEL = 0x7F;
1793:
1794: /**
1795: * ASCII character convenience constant for the escape character
1796: * (value is the <code>char</code> with value 27).
1797: */
1798: public static final char ESC = 0x1B;
1799:
1800: /**
1801: * ASCII character convenience constant for the line feed character
1802: * (value is the <code>char</code> '\n').
1803: */
1804: public static final char LF = '\n';
1805:
1806: /**
1807: * ASCII character convenience constant for the tab character
1808: * (value is the <code>char</code> '\t').
1809: *
1810: * @since 2.1
1811: */
1812: public static final char TAB = '\t';
1813:
1814: /**
1815: * keyboard and/or mouse event mask indicating that the ALT key
1816: * was pushed on the keyboard when the event was generated
1817: * (value is 1<<16).
1818: */
1819: public static final int ALT = 1 << 16;
1820:
1821: /**
1822: * Keyboard and/or mouse event mask indicating that the SHIFT key
1823: * was pushed on the keyboard when the event was generated
1824: * (value is 1<<17).
1825: */
1826: public static final int SHIFT = 1 << 17;
1827:
1828: /**
1829: * Keyboard and/or mouse event mask indicating that the CTRL key
1830: * was pushed on the keyboard when the event was generated
1831: * (value is 1<<18).
1832: */
1833: public static final int CTRL = 1 << 18;
1834:
1835: /**
1836: * Keyboard and/or mouse event mask indicating that the CTRL key
1837: * was pushed on the keyboard when the event was generated. This
1838: * is a synonym for CTRL (value is 1<<18).
1839: */
1840: public static final int CONTROL = CTRL;
1841:
1842: /**
1843: * Keyboard and/or mouse event mask indicating that the COMMAND key
1844: * was pushed on the keyboard when the event was generated
1845: * (value is 1<<22).
1846: *
1847: * @since 2.1
1848: */
1849: public static final int COMMAND = 1 << 22;
1850:
1851: /**
1852: * Keyboard and/or mouse event mask indicating all possible
1853: * keyboard modifiers.
1854: *
1855: * To allow for the future, this mask is intended to be used in
1856: * place of code that references each individual keyboard mask.
1857: * For example, the following expression will determine whether
1858: * any modifier is pressed and will continue to work as new modifier
1859: * masks are added.
1860: *
1861: * <code>(stateMask & SWT.MODIFIER_MASK) != 0</code>.
1862: *
1863: * @since 2.1
1864: */
1865: public static final int MODIFIER_MASK;
1866:
1867: /**
1868: * Keyboard and/or mouse event mask indicating that mouse button one
1869: * was pushed when the event was generated. (value is 1<<19).
1870: */
1871: public static final int BUTTON1 = 1 << 19;
1872:
1873: /**
1874: * Keyboard and/or mouse event mask indicating that mouse button two
1875: * was pushed when the event was generated. (value is 1<<20).
1876: */
1877: public static final int BUTTON2 = 1 << 20;
1878:
1879: /**
1880: * Keyboard and/or mouse event mask indicating that mouse button three
1881: * was pushed when the event was generated. (value is 1<<21).
1882: */
1883: public static final int BUTTON3 = 1 << 21;
1884:
1885: /**
1886: * Keyboard and/or mouse event mask indicating that mouse button four
1887: * was pushed when the event was generated. (value is 1<<23).
1888: *
1889: * @since 3.1
1890: */
1891: public static final int BUTTON4 = 1 << 23;
1892:
1893: /**
1894: * Keyboard and/or mouse event mask indicating that mouse button five
1895: * was pushed when the event was generated. (value is 1<<25).
1896: *
1897: * @since 3.1
1898: */
1899: public static final int BUTTON5 = 1 << 25;
1900:
1901: /**
1902: * Keyboard and/or mouse event mask indicating all possible
1903: * mouse buttons.
1904: *
1905: * To allow for the future, this mask is intended to be used
1906: * in place of code that references each individual button mask.
1907: * For example, the following expression will determine whether
1908: * any button is pressed and will continue to work as new button
1909: * masks are added.
1910: *
1911: * <code>(stateMask & SWT.BUTTON_MASK) != 0</code>.
1912: *
1913: * @since 2.1
1914: */
1915: public static final int BUTTON_MASK;
1916:
1917: /**
1918: * Keyboard and/or mouse event mask indicating that the MOD1 key
1919: * was pushed on the keyboard when the event was generated.
1920: *
1921: * This is the primary keyboard modifier for the platform.
1922: *
1923: * @since 2.1
1924: */
1925: public static final int MOD1;
1926:
1927: /**
1928: * Keyboard and/or mouse event mask indicating that the MOD2 key
1929: * was pushed on the keyboard when the event was generated.
1930: *
1931: * This is the secondary keyboard modifier for the platform.
1932: *
1933: * @since 2.1
1934: */
1935: public static final int MOD2;
1936:
1937: /**
1938: * Keyboard and/or mouse event mask indicating that the MOD3 key
1939: * was pushed on the keyboard when the event was generated.
1940: *
1941: * @since 2.1
1942: */
1943: public static final int MOD3;
1944:
1945: /**
1946: * Keyboard and/or mouse event mask indicating that the MOD4 key
1947: * was pushed on the keyboard when the event was generated.
1948: *
1949: * @since 2.1
1950: */
1951: public static final int MOD4;
1952:
1953: /**
1954: * Constants to indicate line scrolling (value is 1).
1955: * <p><b>Used By:</b><ul>
1956: * <li><code>Control</code></li>
1957: * </ul></p>
1958: *
1959: * @since 3.1
1960: */
1961: public static final int SCROLL_LINE = 1;
1962:
1963: /**
1964: * Constants to indicate page scrolling (value is 2).
1965: * <p><b>Used By:</b><ul>
1966: * <li><code>Control</code></li>
1967: * </ul></p>
1968: *
1969: * @since 3.1
1970: */
1971: public static final int SCROLL_PAGE = 2;
1972:
1973: /**
1974: * Accelerator constant used to differentiate a key code from a
1975: * unicode character.
1976: *
1977: * If this bit is set, then the key stroke
1978: * portion of an accelerator represents a key code. If this bit
1979: * is not set, then the key stroke portion of an accelerator is
1980: * a unicode character.
1981: *
1982: * The following expression is false:
1983: *
1984: * <code>((SWT.MOD1 | SWT.MOD2 | 'T') & SWT.KEYCODE_BIT) != 0</code>.
1985: *
1986: * The following expression is true:
1987: *
1988: * <code>((SWT.MOD3 | SWT.F2) & SWT.KEYCODE_BIT) != 0</code>.
1989: *
1990: * (value is (1<<24))
1991: *
1992: * @since 2.1
1993: */
1994: public static final int KEYCODE_BIT = (1 << 24);
1995:
1996: /**
1997: * Accelerator constant used to extract the key stroke portion of
1998: * an accelerator.
1999: *
2000: * The key stroke may be a key code or a unicode
2001: * value. If the key stroke is a key code <code>KEYCODE_BIT</code>
2002: * will be set.
2003: *
2004: * @since 2.1
2005: */
2006: public static final int KEY_MASK = KEYCODE_BIT + 0xFFFF;
2007:
2008: /**
2009: * Keyboard event constant representing the UP ARROW key
2010: * (value is (1<<24)+1).
2011: */
2012: public static final int ARROW_UP = KEYCODE_BIT + 1;
2013:
2014: /**
2015: * Keyboard event constant representing the DOWN ARROW key
2016: * (value is (1<<24)+2).
2017: */
2018: public static final int ARROW_DOWN = KEYCODE_BIT + 2;
2019:
2020: /**
2021: * Keyboard event constant representing the LEFT ARROW key
2022: * (value is (1<<24)+3).
2023: */
2024: public static final int ARROW_LEFT = KEYCODE_BIT + 3;
2025:
2026: /**
2027: * Keyboard event constant representing the RIGHT ARROW key
2028: * (value is (1<<24)+4).
2029: */
2030: public static final int ARROW_RIGHT = KEYCODE_BIT + 4;
2031:
2032: /**
2033: * Keyboard event constant representing the PAGE UP key
2034: * (value is (1<<24)+5).
2035: */
2036: public static final int PAGE_UP = KEYCODE_BIT + 5;
2037:
2038: /**
2039: * Keyboard event constant representing the PAGE DOWN key
2040: * (value is (1<<24)+6).
2041: */
2042: public static final int PAGE_DOWN = KEYCODE_BIT + 6;
2043:
2044: /**
2045: * Keyboard event constant representing the HOME key
2046: * (value is (1<<24)+7).
2047: */
2048: public static final int HOME = KEYCODE_BIT + 7;
2049:
2050: /**
2051: * Keyboard event constant representing the END key
2052: * (value is (1<<24)+8).
2053: */
2054: public static final int END = KEYCODE_BIT + 8;
2055:
2056: /**
2057: * Keyboard event constant representing the INSERT key
2058: * (value is (1<<24)+9).
2059: */
2060: public static final int INSERT = KEYCODE_BIT + 9;
2061:
2062: /**
2063: * Keyboard event constant representing the F1 key
2064: * (value is (1<<24)+10).
2065: */
2066: public static final int F1 = KEYCODE_BIT + 10;
2067:
2068: /**
2069: * Keyboard event constant representing the F2 key
2070: * (value is (1<<24)+11).
2071: */
2072: public static final int F2 = KEYCODE_BIT + 11;
2073:
2074: /**
2075: * Keyboard event constant representing the F3 key
2076: * (value is (1<<24)+12).
2077: */
2078: public static final int F3 = KEYCODE_BIT + 12;
2079:
2080: /**
2081: * Keyboard event constant representing the F4 key
2082: * (value is (1<<24)+13).
2083: */
2084: public static final int F4 = KEYCODE_BIT + 13;
2085:
2086: /**
2087: * Keyboard event constant representing the F5 key
2088: * (value is (1<<24)+14).
2089: */
2090: public static final int F5 = KEYCODE_BIT + 14;
2091:
2092: /**
2093: * Keyboard event constant representing the F6 key
2094: * (value is (1<<24)+15).
2095: */
2096: public static final int F6 = KEYCODE_BIT + 15;
2097:
2098: /**
2099: * Keyboard event constant representing the F7 key
2100: * (value is (1<<24)+16).
2101: */
2102: public static final int F7 = KEYCODE_BIT + 16;
2103:
2104: /**
2105: * Keyboard event constant representing the F8 key
2106: * (value is (1<<24)+17).
2107: */
2108: public static final int F8 = KEYCODE_BIT + 17;
2109:
2110: /**
2111: * Keyboard event constant representing the F9 key
2112: * (value is (1<<24)+18).
2113: */
2114: public static final int F9 = KEYCODE_BIT + 18;
2115:
2116: /**
2117: * Keyboard event constant representing the F10 key
2118: * (value is (1<<24)+19).
2119: */
2120: public static final int F10 = KEYCODE_BIT + 19;
2121:
2122: /**
2123: * Keyboard event constant representing the F11 key
2124: * (value is (1<<24)+20).
2125: */
2126: public static final int F11 = KEYCODE_BIT + 20;
2127:
2128: /**
2129: * Keyboard event constant representing the F12 key
2130: * (value is (1<<24)+21).
2131: */
2132: public static final int F12 = KEYCODE_BIT + 21;
2133:
2134: /**
2135: * Keyboard event constant representing the F13 key
2136: * (value is (1<<24)+22).
2137: *
2138: * @since 3.0
2139: */
2140: public static final int F13 = KEYCODE_BIT + 22;
2141:
2142: /**
2143: * Keyboard event constant representing the F14 key
2144: * (value is (1<<24)+23).
2145: *
2146: * @since 3.0
2147: */
2148: public static final int F14 = KEYCODE_BIT + 23;
2149:
2150: /**
2151: * Keyboard event constant representing the F15 key
2152: * (value is (1<<24)+24).
2153: *
2154: * @since 3.0
2155: */
2156: public static final int F15 = KEYCODE_BIT + 24;
2157:
2158: /**
2159: * Keyboard event constant representing the numeric key
2160: * pad multiply key (value is (1<<24)+42).
2161: *
2162: * @since 3.0
2163: */
2164: public static final int KEYPAD_MULTIPLY = KEYCODE_BIT + 42;
2165:
2166: /**
2167: * Keyboard event constant representing the numeric key
2168: * pad add key (value is (1<<24)+43).
2169: *
2170: * @since 3.0
2171: */
2172: public static final int KEYPAD_ADD = KEYCODE_BIT + 43;
2173:
2174: /**
2175: * Keyboard event constant representing the numeric key
2176: * pad subtract key (value is (1<<24)+45).
2177: *
2178: * @since 3.0
2179: */
2180: public static final int KEYPAD_SUBTRACT = KEYCODE_BIT + 45;
2181:
2182: /**
2183: * Keyboard event constant representing the numeric key
2184: * pad decimal key (value is (1<<24)+46).
2185: *
2186: * @since 3.0
2187: */
2188: public static final int KEYPAD_DECIMAL = KEYCODE_BIT + 46;
2189:
2190: /**
2191: * Keyboard event constant representing the numeric key
2192: * pad divide key (value is (1<<24)+47).
2193: *
2194: * @since 3.0
2195: */
2196: public static final int KEYPAD_DIVIDE = KEYCODE_BIT + 47;
2197:
2198: /**
2199: * Keyboard event constant representing the numeric key
2200: * pad zero key (value is (1<<24)+48).
2201: *
2202: * @since 3.0
2203: */
2204: public static final int KEYPAD_0 = KEYCODE_BIT + 48;
2205:
2206: /**
2207: * Keyboard event constant representing the numeric key
2208: * pad one key (value is (1<<24)+49).
2209: *
2210: * @since 3.0
2211: */
2212: public static final int KEYPAD_1 = KEYCODE_BIT + 49;
2213:
2214: /**
2215: * Keyboard event constant representing the numeric key
2216: * pad two key (value is (1<<24)+50).
2217: *
2218: * @since 3.0
2219: */
2220: public static final int KEYPAD_2 = KEYCODE_BIT + 50;
2221:
2222: /**
2223: * Keyboard event constant representing the numeric key
2224: * pad three key (value is (1<<24)+51).
2225: *
2226: * @since 3.0
2227: */
2228: public static final int KEYPAD_3 = KEYCODE_BIT + 51;
2229:
2230: /**
2231: * Keyboard event constant representing the numeric key
2232: * pad four key (value is (1<<24)+52).
2233: *
2234: * @since 3.0
2235: */
2236: public static final int KEYPAD_4 = KEYCODE_BIT + 52;
2237:
2238: /**
2239: * Keyboard event constant representing the numeric key
2240: * pad five key (value is (1<<24)+53).
2241: *
2242: * @since 3.0
2243: */
2244: public static final int KEYPAD_5 = KEYCODE_BIT + 53;
2245:
2246: /**
2247: * Keyboard event constant representing the numeric key
2248: * pad six key (value is (1<<24)+54).
2249: *
2250: * @since 3.0
2251: */
2252: public static final int KEYPAD_6 = KEYCODE_BIT + 54;
2253:
2254: /**
2255: * Keyboard event constant representing the numeric key
2256: * pad seven key (value is (1<<24)+55).
2257: *
2258: * @since 3.0
2259: */
2260: public static final int KEYPAD_7 = KEYCODE_BIT + 55;
2261:
2262: /**
2263: * Keyboard event constant representing the numeric key
2264: * pad eight key (value is (1<<24)+56).
2265: *
2266: * @since 3.0
2267: */
2268: public static final int KEYPAD_8 = KEYCODE_BIT + 56;
2269:
2270: /**
2271: * Keyboard event constant representing the numeric key
2272: * pad nine key (value is (1<<24)+57).
2273: *
2274: * @since 3.0
2275: */
2276: public static final int KEYPAD_9 = KEYCODE_BIT + 57;
2277:
2278: /**
2279: * Keyboard event constant representing the numeric key
2280: * pad equal key (value is (1<<24)+61).
2281: *
2282: * @since 3.0
2283: */
2284: public static final int KEYPAD_EQUAL = KEYCODE_BIT + 61;
2285:
2286: /**
2287: * Keyboard event constant representing the numeric key
2288: * pad enter key (value is (1<<24)+80).
2289: *
2290: * @since 3.0
2291: */
2292: public static final int KEYPAD_CR = KEYCODE_BIT + 80;
2293:
2294: /**
2295: * Keyboard event constant representing the help
2296: * key (value is (1<<24)+81).
2297: *
2298: * NOTE: The HELP key maps to the key labeled "help",
2299: * not "F1". If your keyboard does not have a HELP key,
2300: * you will never see this key press. To listen for
2301: * help on a control, use SWT.Help.
2302: *
2303: * @since 3.0
2304: *
2305: * @see SWT#Help
2306: */
2307: public static final int HELP = KEYCODE_BIT + 81;
2308:
2309: /**
2310: * Keyboard event constant representing the caps
2311: * lock key (value is (1<<24)+82).
2312: *
2313: * @since 3.0
2314: */
2315: public static final int CAPS_LOCK = KEYCODE_BIT + 82;
2316:
2317: /**
2318: * Keyboard event constant representing the num
2319: * lock key (value is (1<<24)+83).
2320: *
2321: * @since 3.0
2322: */
2323: public static final int NUM_LOCK = KEYCODE_BIT + 83;
2324:
2325: /**
2326: * Keyboard event constant representing the scroll
2327: * lock key (value is (1<<24)+84).
2328: *
2329: * @since 3.0
2330: */
2331: public static final int SCROLL_LOCK = KEYCODE_BIT + 84;
2332:
2333: /**
2334: * Keyboard event constant representing the pause
2335: * key (value is (1<<24)+85).
2336: *
2337: * @since 3.0
2338: */
2339: public static final int PAUSE = KEYCODE_BIT + 85;
2340:
2341: /**
2342: * Keyboard event constant representing the break
2343: * key (value is (1<<24)+86).
2344: *
2345: * @since 3.0
2346: */
2347: public static final int BREAK = KEYCODE_BIT + 86;
2348:
2349: /**
2350: * Keyboard event constant representing the print screen
2351: * key (value is (1<<24)+87).
2352: *
2353: * @since 3.0
2354: */
2355: public static final int PRINT_SCREEN = KEYCODE_BIT + 87;
2356:
2357: /**
2358: * The <code>MessageBox</code> style constant for error icon
2359: * behavior (value is 1).
2360: */
2361: public static final int ICON_ERROR = 1;
2362:
2363: /**
2364: * The <code>MessageBox</code> style constant for information icon
2365: * behavior (value is 1<<1).
2366: */
2367: public static final int ICON_INFORMATION = 1 << 1;
2368:
2369: /**
2370: * The <code>MessageBox</code> style constant for question icon
2371: * behavior (value is 1<<2).
2372: */
2373: public static final int ICON_QUESTION = 1 << 2;
2374:
2375: /**
2376: * The <code>MessageBox</code> style constant for warning icon
2377: * behavior (value is 1<<3).
2378: */
2379: public static final int ICON_WARNING = 1 << 3;
2380:
2381: /**
2382: * The <code>MessageBox</code> style constant for "working" icon
2383: * behavior (value is 1<<4).
2384: */
2385: public static final int ICON_WORKING = 1 << 4;
2386:
2387: /**
2388: * The <code>MessageBox</code> style constant for an OK button;
2389: * valid combinations are OK, OK|CANCEL
2390: * (value is 1<<5).
2391: */
2392: public static final int OK = 1 << 5;
2393:
2394: /**
2395: * The <code>MessageBox</code> style constant for YES button;
2396: * valid combinations are YES|NO, YES|NO|CANCEL
2397: * (value is 1<<6).
2398: */
2399: public static final int YES = 1 << 6;
2400:
2401: /**
2402: * The <code>MessageBox</code> style constant for NO button;
2403: * valid combinations are YES|NO, YES|NO|CANCEL
2404: * (value is 1<<7).
2405: */
2406: public static final int NO = 1 << 7;
2407:
2408: /**
2409: * The <code>MessageBox</code> style constant for a CANCEL button;
2410: * valid combinations are OK|CANCEL, YES|NO|CANCEL, RETRY|CANCEL
2411: * (value is 1<<8). This style constant is also used with
2412: * <code>Text</code> in combination with SEARCH.
2413: *
2414: * <p><b>Used By:</b><ul>
2415: * <li><code>MessageBox</code></li>
2416: * <li><code>Text</code></li>
2417: * </ul></p>
2418: */
2419: public static final int CANCEL = 1 << 8;
2420:
2421: /**
2422: * The <code>MessageBox</code> style constant for an ABORT button;
2423: * the only valid combination is ABORT|RETRY|IGNORE
2424: * (value is 1<<9).
2425: */
2426: public static final int ABORT = 1 << 9;
2427:
2428: /**
2429: * The <code>MessageBox</code> style constant for a RETRY button;
2430: * valid combinations are ABORT|RETRY|IGNORE, RETRY|CANCEL
2431: * (value is 1<<10).
2432: */
2433: public static final int RETRY = 1 << 10;
2434:
2435: /**
2436: * The <code>MessageBox</code> style constant for an IGNORE button;
2437: * the only valid combination is ABORT|RETRY|IGNORE
2438: * (value is 1<<11).
2439: */
2440: public static final int IGNORE = 1 << 11;
2441:
2442: /**
2443: * The <code>FileDialog</code> style constant for open file dialog behavior
2444: * (value is 1<<12).
2445: */
2446: public static final int OPEN = 1 << 12;
2447:
2448: /**
2449: * The <code>FileDialog</code> style constant for save file dialog behavior
2450: * (value is 1<<13).
2451: */
2452: public static final int SAVE = 1 << 13;
2453:
2454: /**
2455: * The <code>Composite</code> constant to indicate that
2456: * an attribute (such as background) is not inherited
2457: * by the children (value is 0).
2458: *
2459: * @since 3.2
2460: */
2461: public static final int INHERIT_NONE = 0;
2462:
2463: /**
2464: * The <code>Composite</code> constant to indicate that
2465: * an attribute (such as background) is inherited by
2466: * children who choose this value as their "default"
2467: * (value is 1). For example, a label child will
2468: * typically choose to inherit the background color
2469: * of a composite while a list or table will not.
2470: *
2471: * @since 3.2
2472: */
2473: public static final int INHERIT_DEFAULT = 1;
2474:
2475: /**
2476: * The <code>Composite</code> constant to indicate that
2477: * an attribute (such as background) is inherited by
2478: * all children.
2479: *
2480: * @since 3.2
2481: */
2482: public static final int INHERIT_FORCE = 2;
2483:
2484: /**
2485: * Default color white (value is 1).
2486: */
2487: public static final int COLOR_WHITE = 1;
2488:
2489: /**
2490: * Default color black (value is 2).
2491: */
2492: public static final int COLOR_BLACK = 2;
2493:
2494: /**
2495: * Default color red (value is 3).
2496: */
2497: public static final int COLOR_RED = 3;
2498:
2499: /**
2500: * Default color dark red (value is 4).
2501: */
2502: public static final int COLOR_DARK_RED = 4;
2503:
2504: /**
2505: * Default color green (value is 5).
2506: */
2507: public static final int COLOR_GREEN = 5;
2508:
2509: /**
2510: * Default color dark green (value is 6).
2511: */
2512: public static final int COLOR_DARK_GREEN = 6;
2513:
2514: /**
2515: * Default color yellow (value is 7).
2516: */
2517: public static final int COLOR_YELLOW = 7;
2518:
2519: /**
2520: * Default color dark yellow (value is 8).
2521: */
2522: public static final int COLOR_DARK_YELLOW = 8;
2523:
2524: /**
2525: * Default color blue (value is 9).
2526: */
2527: public static final int COLOR_BLUE = 9;
2528:
2529: /**
2530: * Default color dark blue (value is 10).
2531: */
2532: public static final int COLOR_DARK_BLUE = 10;
2533:
2534: /**
2535: * Default color magenta (value is 11).
2536: */
2537: public static final int COLOR_MAGENTA = 11;
2538:
2539: /**
2540: * Default color dark magenta (value is 12).
2541: */
2542: public static final int COLOR_DARK_MAGENTA = 12;
2543:
2544: /**
2545: * Default color cyan (value is 13).
2546: */
2547: public static final int COLOR_CYAN = 13;
2548:
2549: /**
2550: * Default color dark cyan (value is 14).
2551: */
2552: public static final int COLOR_DARK_CYAN = 14;
2553:
2554: /**
2555: * Default color gray (value is 15).
2556: */
2557: public static final int COLOR_GRAY = 15;
2558:
2559: /**
2560: * Default color dark gray (value is 16).
2561: */
2562: public static final int COLOR_DARK_GRAY = 16;
2563:
2564: /*
2565: * System Colors
2566: *
2567: * Dealing with system colors is an area where there are
2568: * many platform differences. On some platforms, system
2569: * colors can change dynamically while the program is
2570: * running. On other platforms, system colors can be
2571: * changed for all instances of a particular widget.
2572: * Therefore, the only truly portable method to obtain
2573: * a widget color query is to query the color from an
2574: * instance of the widget.
2575: *
2576: * It is expected that the list of supported colors
2577: * will grow over time.
2578: */
2579:
2580: /**
2581: * System color used to paint dark shadow areas (value is 17).
2582: */
2583: public static final int COLOR_WIDGET_DARK_SHADOW = 17;
2584:
2585: /**
2586: * System color used to paint normal shadow areas (value is 18).
2587: */
2588: public static final int COLOR_WIDGET_NORMAL_SHADOW = 18;
2589:
2590: /**
2591: * System color used to paint light shadow areas (value is 19).
2592: */
2593: public static final int COLOR_WIDGET_LIGHT_SHADOW = 19;
2594:
2595: /**
2596: * System color used to paint highlight shadow areas (value is 20).
2597: */
2598: public static final int COLOR_WIDGET_HIGHLIGHT_SHADOW = 20;
2599:
2600: /**
2601: * System color used to paint foreground areas (value is 21).
2602: */
2603: public static final int COLOR_WIDGET_FOREGROUND = 21;
2604:
2605: /**
2606: * System color used to paint background areas (value is 22).
2607: */
2608: public static final int COLOR_WIDGET_BACKGROUND = 22;
2609:
2610: /**
2611: * System color used to paint border areas (value is 23).
2612: */
2613: public static final int COLOR_WIDGET_BORDER = 23;
2614:
2615: /**
2616: * System color used to paint list foreground areas (value is 24).
2617: */
2618: public static final int COLOR_LIST_FOREGROUND = 24;
2619:
2620: /**
2621: * System color used to paint list background areas (value is 25).
2622: */
2623: public static final int COLOR_LIST_BACKGROUND = 25;
2624:
2625: /**
2626: * System color used to paint list selection background areas (value is 26).
2627: */
2628: public static final int COLOR_LIST_SELECTION = 26;
2629:
2630: /**
2631: * System color used to paint list selected text (value is 27).
2632: */
2633: public static final int COLOR_LIST_SELECTION_TEXT = 27;
2634:
2635: /**
2636: * System color used to paint tooltip text (value is 28).
2637: */
2638: public static final int COLOR_INFO_FOREGROUND = 28;
2639:
2640: /**
2641: * System color used to paint tooltip background areas (value is 29).
2642: */
2643: public static final int COLOR_INFO_BACKGROUND = 29;
2644:
2645: /**
2646: * System color used to paint title text (value is 30).
2647: */
2648: public static final int COLOR_TITLE_FOREGROUND = 30;
2649:
2650: /**
2651: * System color used to paint title background areas (value is 31).
2652: */
2653: public static final int COLOR_TITLE_BACKGROUND = 31;
2654:
2655: /**
2656: * System color used to paint title background gradient (value is 32).
2657: */
2658: public static final int COLOR_TITLE_BACKGROUND_GRADIENT = 32;
2659:
2660: /**
2661: * System color used to paint inactive title text (value is 33).
2662: */
2663: public static final int COLOR_TITLE_INACTIVE_FOREGROUND = 33;
2664:
2665: /**
2666: * System color used to paint inactive title background areas (value is 34).
2667: */
2668: public static final int COLOR_TITLE_INACTIVE_BACKGROUND = 34;
2669:
2670: /**
2671: * System color used to paint inactive title background gradient (value is 35).
2672: */
2673: public static final int COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT = 35;
2674:
2675: /**
2676: * Draw constant indicating whether the drawing operation
2677: * should fill the background (value is 1<<0).
2678: */
2679: public static final int DRAW_TRANSPARENT = 1 << 0;
2680:
2681: /**
2682: * Draw constant indicating whether the string drawing operation
2683: * should handle line-delimiters (value is 1<<1).
2684: */
2685: public static final int DRAW_DELIMITER = 1 << 1;
2686:
2687: /**
2688: * Draw constant indicating whether the string drawing operation
2689: * should expand TAB characters (value is 1<<2).
2690: */
2691: public static final int DRAW_TAB = 1 << 2;
2692:
2693: /**
2694: * Draw constant indicating whether the string drawing operation
2695: * should handle mnemonics (value is 1<<3).
2696: */
2697: public static final int DRAW_MNEMONIC = 1 << 3;
2698:
2699: /**
2700: * Selection constant indicating that a line delimiter should be
2701: * drawn (value is 1<<17).
2702: *
2703: * <p><b>Used By:</b><ul>
2704: * <li><code>TextLayout</code></li>
2705: * </ul></p>
2706: *
2707: * @see #FULL_SELECTION
2708: * @see #LAST_LINE_SELECTION
2709: *
2710: * @since 3.3
2711: */
2712: public static final int DELIMITER_SELECTION = 1 << 17;
2713:
2714: /**
2715: * Selection constant indicating that the last line is selected
2716: * to the end and should be drawn using either a line delimiter
2717: * or full line selection (value is 1<<20).
2718: *
2719: * <p><b>Used By:</b><ul>
2720: * <li><code>TextLayout</code></li>
2721: * </ul></p>
2722: *
2723: * @see #DELIMITER_SELECTION
2724: * @see #FULL_SELECTION
2725: *
2726: * @since 3.3
2727: */
2728: public static final int LAST_LINE_SELECTION = 1 << 20;
2729:
2730: /**
2731: * SWT error constant indicating that no error number was specified
2732: * (value is 1).
2733: */
2734: public static final int ERROR_UNSPECIFIED = 1;
2735:
2736: /**
2737: * SWT error constant indicating that no more handles for an
2738: * operating system resource are available
2739: * (value is 2).
2740: */
2741: public static final int ERROR_NO_HANDLES = 2;
2742:
2743: /**
2744: * SWT error constant indicating that no more callback resources are available
2745: * (value is 3).
2746: */
2747: public static final int ERROR_NO_MORE_CALLBACKS = 3;
2748:
2749: /**
2750: * SWT error constant indicating that a null argument was passed in
2751: * (value is 4).
2752: */
2753: public static final int ERROR_NULL_ARGUMENT = 4;
2754:
2755: /**
2756: * SWT error constant indicating that an invalid argument was passed in
2757: * (value is 5).
2758: */
2759: public static final int ERROR_INVALID_ARGUMENT = 5;
2760:
2761: /**
2762: * SWT error constant indicating that a value was found to be
2763: * outside the allowable range
2764: * (value is 6).
2765: */
2766: public static final int ERROR_INVALID_RANGE = 6;
2767:
2768: /**
2769: * SWT error constant indicating that a value which can not be
2770: * zero was found to be
2771: * (value is 7).
2772: */
2773: public static final int ERROR_CANNOT_BE_ZERO = 7;
2774:
2775: /**
2776: * SWT error constant indicating that the underlying operating
2777: * system was unable to provide the value of an item
2778: * (value is 8).
2779: */
2780: public static final int ERROR_CANNOT_GET_ITEM = 8;
2781:
2782: /**
2783: * SWT error constant indicating that the underlying operating
2784: * system was unable to provide the selection
2785: * (value is 9).
2786: */
2787: public static final int ERROR_CANNOT_GET_SELECTION = 9;
2788:
2789: /**
2790: * SWT error constant indicating that the matrix is not invertible
2791: * (value is 10).
2792: *
2793: * @since 3.1
2794: */
2795: public static final int ERROR_CANNOT_INVERT_MATRIX = 10;
2796:
2797: /**
2798: * SWT error constant indicating that the underlying operating
2799: * system was unable to provide the height of an item
2800: * (value is 11).
2801: */
2802: public static final int ERROR_CANNOT_GET_ITEM_HEIGHT = 11;
2803:
2804: /**
2805: * SWT error constant indicating that the underlying operating
2806: * system was unable to provide the text of a widget
2807: * (value is 12).
2808: */
2809: public static final int ERROR_CANNOT_GET_TEXT = 12;
2810:
2811: /**
2812: * SWT error constant indicating that the underlying operating
2813: * system was unable to set the text of a widget
2814: * (value is 13).
2815: */
2816: public static final int ERROR_CANNOT_SET_TEXT = 13;
2817:
2818: /**
2819: * SWT error constant indicating that the underlying operating
2820: * system was unable to add an item
2821: * (value is 14).
2822: */
2823: public static final int ERROR_ITEM_NOT_ADDED = 14;
2824:
2825: /**
2826: * SWT error constant indicating that the underlying operating
2827: * system was unable to remove an item
2828: * (value is 15).
2829: */
2830: public static final int ERROR_ITEM_NOT_REMOVED = 15;
2831:
2832: /**
2833: * SWT error constant indicating that the graphics library
2834: * is not available
2835: * (value is 16).
2836: */
2837: public static final int ERROR_NO_GRAPHICS_LIBRARY = 16;
2838:
2839: /**
2840: * SWT error constant indicating that a particular feature has
2841: * not been implemented on this platform
2842: * (value is 20).
2843: */
2844: public static final int ERROR_NOT_IMPLEMENTED = 20;
2845:
2846: /**
2847: * SWT error constant indicating that a menu which needed
2848: * to have the drop down style had some other style instead
2849: * (value is 21).
2850: */
2851: public static final int ERROR_MENU_NOT_DROP_DOWN = 21;
2852:
2853: /**
2854: * SWT error constant indicating that an attempt was made to
2855: * invoke an SWT operation which can only be executed by the
2856: * user-interface thread from some other thread
2857: * (value is 22).
2858: */
2859: public static final int ERROR_THREAD_INVALID_ACCESS = 22;
2860:
2861: /**
2862: * SWT error constant indicating that an attempt was made to
2863: * invoke an SWT operation using a widget which had already
2864: * been disposed
2865: * (value is 24).
2866: */
2867: public static final int ERROR_WIDGET_DISPOSED = 24;
2868:
2869: /**
2870: * SWT error constant indicating that a menu item which needed
2871: * to have the cascade style had some other style instead
2872: * (value is 27).
2873: */
2874: public static final int ERROR_MENUITEM_NOT_CASCADE = 27;
2875:
2876: /**
2877: * SWT error constant indicating that the underlying operating
2878: * system was unable to set the selection of a widget
2879: * (value is 28).
2880: */
2881: public static final int ERROR_CANNOT_SET_SELECTION = 28;
2882:
2883: /**
2884: * SWT error constant indicating that the underlying operating
2885: * system was unable to set the menu
2886: * (value is 29).
2887: */
2888: public static final int ERROR_CANNOT_SET_MENU = 29;
2889:
2890: /**
2891: * SWT error constant indicating that the underlying operating
2892: * system was unable to set the enabled state
2893: * (value is 30).
2894: */
2895: public static final int ERROR_CANNOT_SET_ENABLED = 30;
2896:
2897: /**
2898: * SWT error constant indicating that the underlying operating
2899: * system was unable to provide enabled/disabled state information
2900: * (value is 31).
2901: */
2902: public static final int ERROR_CANNOT_GET_ENABLED = 31;
2903:
2904: /**
2905: * SWT error constant indicating that a provided widget can
2906: * not be used as a parent in the current operation
2907: * (value is 32).
2908: */
2909: public static final int ERROR_INVALID_PARENT = 32;
2910:
2911: /**
2912: * SWT error constant indicating that a menu which needed
2913: * to have the menu bar style had some other style instead
2914: * (value is 33).
2915: */
2916: public static final int ERROR_MENU_NOT_BAR = 33;
2917:
2918: /**
2919: * SWT error constant indicating that the underlying operating
2920: * system was unable to provide count information
2921: * (value is 36).
2922: */
2923: public static final int ERROR_CANNOT_GET_COUNT = 36;
2924:
2925: /**
2926: * SWT error constant indicating that a menu which needed
2927: * to have the pop up menu style had some other style instead
2928: * (value is 37).
2929: */
2930: public static final int ERROR_MENU_NOT_POP_UP = 37;
2931:
2932: /**
2933: * SWT error constant indicating that a graphics operation
2934: * was attempted with an image of an unsupported depth
2935: * (value is 38).
2936: */
2937: public static final int ERROR_UNSUPPORTED_DEPTH = 38;
2938:
2939: /**
2940: * SWT error constant indicating that an input/output operation
2941: * failed during the execution of an SWT operation
2942: * (value is 39).
2943: */
2944: public static final int ERROR_IO = 39;
2945:
2946: /**
2947: * SWT error constant indicating that a graphics operation
2948: * was attempted with an image having an invalid format
2949: * (value is 40).
2950: */
2951: public static final int ERROR_INVALID_IMAGE = 40;
2952:
2953: /**
2954: * SWT error constant indicating that a graphics operation
2955: * was attempted with an image having a valid but unsupported
2956: * format
2957: * (value is 42).
2958: */
2959: public static final int ERROR_UNSUPPORTED_FORMAT = 42;
2960:
2961: /**
2962: * SWT error constant indicating that an attempt was made
2963: * to subclass an SWT widget class without implementing the
2964: * <code>checkSubclass()</code> method
2965: * (value is 43).
2966: *
2967: * For additional information see the comment in
2968: * <code>Widget.checkSubclass()</code>.
2969: *
2970: * @see org.eclipse.swt.widgets.Widget#checkSubclass
2971: */
2972: public static final int ERROR_INVALID_SUBCLASS = 43;
2973:
2974: /**
2975: * SWT error constant indicating that an attempt was made to
2976: * invoke an SWT operation using a graphics object which had
2977: * already been disposed
2978: * (value is 44).
2979: */
2980: public static final int ERROR_GRAPHIC_DISPOSED = 44;
2981:
2982: /**
2983: * SWT error constant indicating that an attempt was made to
2984: * invoke an SWT operation using a device which had already
2985: * been disposed
2986: * (value is 45).
2987: */
2988: public static final int ERROR_DEVICE_DISPOSED = 45;
2989:
2990: /**
2991: * SWT error constant indicating that an exception happened
2992: * when executing a runnable
2993: * (value is 46).
2994: */
2995: public static final int ERROR_FAILED_EXEC = 46;
2996:
2997: /**
2998: * SWT error constant indicating that an unsatisfied link
2999: * error occurred while attempting to load a library
3000: * (value is 47).
3001: *
3002: * @since 3.1
3003: */
3004: public static final int ERROR_FAILED_LOAD_LIBRARY = 47;
3005:
3006: /**
3007: * SWT error constant indicating that a font is not valid
3008: * (value is 48).
3009: *
3010: * @since 3.1
3011: */
3012: public static final int ERROR_INVALID_FONT = 48;
3013:
3014: /**
3015: * Constant indicating that an image or operation is of type bitmap (value is 0).
3016: */
3017: public static final int BITMAP = 0;
3018:
3019: /**
3020: * Constant indicating that an image or operation is of type icon (value is 1).
3021: */
3022: public static final int ICON = 1;
3023:
3024: /**
3025: * The <code>Image</code> constructor argument indicating that
3026: * the new image should be a copy of the image provided as
3027: * an argument (value is 0).
3028: */
3029: public static final int IMAGE_COPY = 0;
3030:
3031: /**
3032: * The <code>Image</code> constructor argument indicating that
3033: * the new image should have the appearance of a "disabled"
3034: * (using the platform's rules for how this should look)
3035: * copy of the image provided as an argument (value is 1).
3036: */
3037: public static final int IMAGE_DISABLE = 1;
3038:
3039: /**
3040: * The <code>Image</code> constructor argument indicating that
3041: * the new image should have the appearance of a "gray scaled"
3042: * copy of the image provided as an argument (value is 2).
3043: */
3044: public static final int IMAGE_GRAY = 2;
3045:
3046: /**
3047: * The font style constant indicating a normal weight, non-italic font
3048: * (value is 0).
3049: */
3050: public static final int NORMAL = 0;
3051:
3052: /**
3053: * The font style constant indicating a bold weight font
3054: * (value is 1<<0).
3055: */
3056: public static final int BOLD = 1 << 0;
3057:
3058: /**
3059: * The font style constant indicating an italic font
3060: * (value is 1<<1).
3061: */
3062: public static final int ITALIC = 1 << 1;
3063:
3064: /**
3065: * System arrow cursor (value is 0).
3066: */
3067: public static final int CURSOR_ARROW = 0;
3068:
3069: /**
3070: * System wait cursor (value is 1).
3071: */
3072: public static final int CURSOR_WAIT = 1;
3073:
3074: /**
3075: * System cross hair cursor (value is 2).
3076: */
3077: public static final int CURSOR_CROSS = 2;
3078:
3079: /**
3080: * System app startup cursor (value is 3).
3081: */
3082: public static final int CURSOR_APPSTARTING = 3;
3083:
3084: /**
3085: * System help cursor (value is 4).
3086: */
3087: public static final int CURSOR_HELP = 4;
3088:
3089: /**
3090: * System resize all directions cursor (value is 5).
3091: */
3092: public static final int CURSOR_SIZEALL = 5;
3093:
3094: /**
3095: * System resize north-east-south-west cursor (value is 6).
3096: */
3097: public static final int CURSOR_SIZENESW = 6;
3098:
3099: /**
3100: * System resize north-south cursor (value is 7).
3101: */
3102: public static final int CURSOR_SIZENS = 7;
3103:
3104: /**
3105: * System resize north-west-south-east cursor (value is 8).
3106: */
3107: public static final int CURSOR_SIZENWSE = 8;
3108:
3109: /**
3110: * System resize west-east cursor (value is 9).
3111: */
3112: public static final int CURSOR_SIZEWE = 9;
3113:
3114: /**
3115: * System resize north cursor (value is 10).
3116: */
3117: public static final int CURSOR_SIZEN = 10;
3118:
3119: /**
3120: * System resize south cursor (value is 11).
3121: */
3122: public static final int CURSOR_SIZES = 11;
3123:
3124: /**
3125: * System resize east cursor (value is 12).
3126: */
3127: public static final int CURSOR_SIZEE = 12;
3128:
3129: /**
3130: * System resize west cursor (value is 13).
3131: */
3132: public static final int CURSOR_SIZEW = 13;
3133:
3134: /**
3135: * System resize north-east cursor (value is 14).
3136: */
3137: public static final int CURSOR_SIZENE = 14;
3138:
3139: /**
3140: * System resize south-east cursor (value is 15).
3141: */
3142: public static final int CURSOR_SIZESE = 15;
3143:
3144: /**
3145: * System resize south-west cursor (value is 16).
3146: */
3147: public static final int CURSOR_SIZESW = 16;
3148:
3149: /**
3150: * System resize north-west cursor (value is 17).
3151: */
3152: public static final int CURSOR_SIZENW = 17;
3153:
3154: /**
3155: * System up arrow cursor (value is 18).
3156: */
3157: public static final int CURSOR_UPARROW = 18;
3158:
3159: /**
3160: * System i-beam cursor (value is 19).
3161: */
3162: public static final int CURSOR_IBEAM = 19;
3163:
3164: /**
3165: * System "not allowed" cursor (value is 20).
3166: */
3167: public static final int CURSOR_NO = 20;
3168:
3169: /**
3170: * System hand cursor (value is 21).
3171: */
3172: public static final int CURSOR_HAND = 21;
3173:
3174: /**
3175: * Line drawing style for flat end caps (value is 1).
3176: *
3177: * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3178: * @see org.eclipse.swt.graphics.GC#getLineCap()
3179: *
3180: * @since 3.1
3181: */
3182: public static final int CAP_FLAT = 1;
3183:
3184: /**
3185: * Line drawing style for rounded end caps (value is 2).
3186: *
3187: * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3188: * @see org.eclipse.swt.graphics.GC#getLineCap()
3189: *
3190: * @since 3.1
3191: */
3192: public static final int CAP_ROUND = 2;
3193:
3194: /**
3195: * Line drawing style for square end caps (value is 3).
3196: *
3197: * @see org.eclipse.swt.graphics.GC#setLineCap(int)
3198: * @see org.eclipse.swt.graphics.GC#getLineCap()
3199: *
3200: * @since 3.1
3201: */
3202: public static final int CAP_SQUARE = 3;
3203:
3204: /**
3205: * Line drawing style for miter joins (value is 1).
3206: *
3207: * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3208: * @see org.eclipse.swt.graphics.GC#getLineJoin()
3209: *
3210: * @since 3.1
3211: */
3212: public static final int JOIN_MITER = 1;
3213:
3214: /**
3215: * Line drawing style for rounded joins (value is 2).
3216: *
3217: * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3218: * @see org.eclipse.swt.graphics.GC#getLineJoin()
3219: *
3220: * @since 3.1
3221: */
3222: public static final int JOIN_ROUND = 2;
3223:
3224: /**
3225: * Line drawing style for bevel joins (value is 3).
3226: *
3227: * @see org.eclipse.swt.graphics.GC#setLineJoin(int)
3228: * @see org.eclipse.swt.graphics.GC#getLineJoin()
3229: *
3230: * @since 3.1
3231: */
3232: public static final int JOIN_BEVEL = 3;
3233:
3234: /**
3235: * Line drawing style for solid lines (value is 1).
3236: */
3237: public static final int LINE_SOLID = 1;
3238:
3239: /**
3240: * Line drawing style for dashed lines (value is 2).
3241: */
3242: public static final int LINE_DASH = 2;
3243:
3244: /**
3245: * Line drawing style for dotted lines (value is 3).
3246: */
3247: public static final int LINE_DOT = 3;
3248:
3249: /**
3250: * Line drawing style for alternating dash-dot lines (value is 4).
3251: */
3252: public static final int LINE_DASHDOT = 4;
3253:
3254: /**
3255: * Line drawing style for dash-dot-dot lines (value is 5).
3256: */
3257: public static final int LINE_DASHDOTDOT = 5;
3258:
3259: /**
3260: * Line drawing style for custom dashed lines (value is 6).
3261: *
3262: * @see org.eclipse.swt.graphics.GC#setLineDash(int[])
3263: * @see org.eclipse.swt.graphics.GC#getLineDash()
3264: *
3265: * @since 3.1
3266: */
3267: public static final int LINE_CUSTOM = 6;
3268:
3269: /**
3270: * Path constant that represents a "move to" operation (value is 1).
3271: *
3272: * @since 3.1
3273: */
3274: public static final int PATH_MOVE_TO = 1;
3275:
3276: /**
3277: * Path constant that represents a "line to" operation (value is 2).
3278: *
3279: * @since 3.1
3280: */
3281: public static final int PATH_LINE_TO = 2;
3282:
3283: /**
3284: * Path constant that represents a "quadratic curve to" operation (value is 3).
3285: *
3286: * @since 3.1
3287: */
3288: public static final int PATH_QUAD_TO = 3;
3289:
3290: /**
3291: * Path constant that represents a "cubic curve to" operation (value is 4).
3292: *
3293: * @since 3.1
3294: */
3295: public static final int PATH_CUBIC_TO = 4;
3296:
3297: /**
3298: * Path constant that represents a "close" operation (value is 5).
3299: *
3300: * @since 3.1
3301: */
3302: public static final int PATH_CLOSE = 5;
3303:
3304: /**
3305: * Even odd rule for filling operations (value is 1).
3306: *
3307: * @since 3.1
3308: */
3309: public static final int FILL_EVEN_ODD = 1;
3310:
3311: /**
3312: * Winding rule for filling operations (value is 2).
3313: *
3314: * @since 3.1
3315: */
3316: public static final int FILL_WINDING = 2;
3317:
3318: /**
3319: * Image format constant indicating an unknown image type (value is -1).
3320: */
3321: public static final int IMAGE_UNDEFINED = -1;
3322:
3323: /**
3324: * Image format constant indicating a Windows BMP format image (value is 0).
3325: */
3326: public static final int IMAGE_BMP = 0;
3327:
3328: /**
3329: * Image format constant indicating a run-length encoded
3330: * Windows BMP format image (value is 1).
3331: */
3332: public static final int IMAGE_BMP_RLE = 1;
3333:
3334: /**
3335: * Image format constant indicating a GIF format image (value is 2).
3336: */
3337: public static final int IMAGE_GIF = 2;
3338:
3339: /**
3340: * Image format constant indicating a ICO format image (value is 3).
3341: */
3342: public static final int IMAGE_ICO = 3;
3343:
3344: /**
3345: * Image format constant indicating a JPEG format image (value is 4).
3346: */
3347: public static final int IMAGE_JPEG = 4;
3348:
3349: /**
3350: * Image format constant indicating a PNG format image (value is 5).
3351: */
3352: public static final int IMAGE_PNG = 5;
3353:
3354: /**
3355: * Image format constant indicating a TIFF format image (value is 6).
3356: */
3357: public static final int IMAGE_TIFF = 6;
3358:
3359: /**
3360: * Image format constant indicating an OS/2 BMP format image (value is 7).
3361: */
3362: public static final int IMAGE_OS2_BMP = 7;
3363:
3364: /**
3365: * GIF image disposal method constants indicating that the
3366: * disposal method is unspecified (value is 0).
3367: */
3368: public static final int DM_UNSPECIFIED = 0x0;
3369:
3370: /**
3371: * GIF image disposal method constants indicating that the
3372: * disposal method is to do nothing; that is, to leave the
3373: * previous image in place (value is 1).
3374: */
3375: public static final int DM_FILL_NONE = 0x1;
3376:
3377: /**
3378: * GIF image disposal method constants indicating that the
3379: * the previous images should be covered with the background
3380: * color before displaying the next image (value is 2).
3381: */
3382: public static final int DM_FILL_BACKGROUND = 0x2;
3383:
3384: /**
3385: * GIF image disposal method constants indicating that the
3386: * disposal method is to restore the previous picture
3387: * (value is 3).
3388: */
3389: public static final int DM_FILL_PREVIOUS = 0x3;
3390:
3391: /**
3392: * Image transparency constant indicating that the image
3393: * contains no transparency information (value is 0).
3394: */
3395: public static final int TRANSPARENCY_NONE = 0x0;
3396:
3397: /**
3398: * Image transparency constant indicating that the image
3399: * contains alpha transparency information (value is 1<<0).
3400: */
3401: public static final int TRANSPARENCY_ALPHA = 1 << 0;
3402:
3403: /**
3404: * Image transparency constant indicating that the image
3405: * contains a transparency mask (value is 1<<1).
3406: */
3407: public static final int TRANSPARENCY_MASK = 1 << 1;
3408:
3409: /**
3410: * Image transparency constant indicating that the image
3411: * contains a transparent pixel (value is 1<<2).
3412: */
3413: public static final int TRANSPARENCY_PIXEL = 1 << 2;
3414:
3415: /**
3416: * The character movement type (value is 1<<0).
3417: * This constant is used to move a text offset over a character.
3418: *
3419: * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3420: * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3421: *
3422: * @since 3.0
3423: */
3424: public static final int MOVEMENT_CHAR = 1 << 0;
3425:
3426: /**
3427: * The cluster movement type (value is 1<<1).
3428: * This constant is used to move a text offset over a cluster.
3429: * A cluster groups one or more characters. A cluster is
3430: * undivisible, this means that a caret offset can not be placed in the
3431: * middle of a cluster.
3432: *
3433: * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3434: * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3435: *
3436: * @since 3.0
3437: */
3438: public static final int MOVEMENT_CLUSTER = 1 << 1;
3439:
3440: /**
3441: * The word movement type (value is 1<<2).
3442: * This constant is used to move a text offset over a word.
3443: * The behavior of this constant depends on the platform and on the
3444: * direction of the movement. For example, on Windows the stop is
3445: * always at the start of the word. On GTK and Mac the stop is at the end
3446: * of the word if the direction is next and at the start of the word if the
3447: * direction is previous.
3448: *
3449: * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3450: * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3451: *
3452: * @since 3.0
3453: */
3454: public static final int MOVEMENT_WORD = 1 << 2;
3455:
3456: /**
3457: * The word end movement type (value is 1<<3).
3458: * This constant is used to move a text offset to the next or previous
3459: * word end. The behavior of this constant does not depend on the platform.
3460: *
3461: *
3462: * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3463: * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3464: *
3465: * @since 3.3
3466: */
3467: public static final int MOVEMENT_WORD_END = 1 << 3;
3468:
3469: /**
3470: * The word start movement type (value is 1<<4).
3471: * This constant is used to move a text offset to the next or previous
3472: * word start. The behavior of this constant does not depend on the platform.
3473: *
3474: * @see org.eclipse.swt.graphics.TextLayout#getNextOffset(int, int)
3475: * @see org.eclipse.swt.graphics.TextLayout#getPreviousOffset(int, int)
3476: *
3477: * @since 3.3
3478: */
3479: public static final int MOVEMENT_WORD_START = 1 << 4;
3480:
3481: /**
3482: * Answers a concise, human readable description of the error code.
3483: *
3484: * @param code the SWT error code.
3485: * @return a description of the error code.
3486: *
3487: * @see SWT
3488: */
3489: static String findErrorText(int code) {
3490: switch (code) {
3491: case ERROR_UNSPECIFIED:
3492: return "Unspecified error"; //$NON-NLS-1$
3493: case ERROR_NO_HANDLES:
3494: return "No more handles"; //$NON-NLS-1$
3495: case ERROR_NO_MORE_CALLBACKS:
3496: return "No more callbacks"; //$NON-NLS-1$
3497: case ERROR_NULL_ARGUMENT:
3498: return "Argument cannot be null"; //$NON-NLS-1$
3499: case ERROR_INVALID_ARGUMENT:
3500: return "Argument not valid"; //$NON-NLS-1$
3501: case ERROR_INVALID_RANGE:
3502: return "Index out of bounds"; //$NON-NLS-1$
3503: case ERROR_CANNOT_BE_ZERO:
3504: return "Argument cannot be zero"; //$NON-NLS-1$
3505: case ERROR_CANNOT_GET_ITEM:
3506: return "Cannot get item"; //$NON-NLS-1$
3507: case ERROR_CANNOT_GET_SELECTION:
3508: return "Cannot get selection"; //$NON-NLS-1$
3509: case ERROR_CANNOT_GET_ITEM_HEIGHT:
3510: return "Cannot get item height"; //$NON-NLS-1$
3511: case ERROR_CANNOT_GET_TEXT:
3512: return "Cannot get text"; //$NON-NLS-1$
3513: case ERROR_CANNOT_SET_TEXT:
3514: return "Cannot set text"; //$NON-NLS-1$
3515: case ERROR_ITEM_NOT_ADDED:
3516: return "Item not added"; //$NON-NLS-1$
3517: case ERROR_ITEM_NOT_REMOVED:
3518: return "Item not removed"; //$NON-NLS-1$
3519: case ERROR_NOT_IMPLEMENTED:
3520: return "Not implemented"; //$NON-NLS-1$
3521: case ERROR_MENU_NOT_DROP_DOWN:
3522: return "Menu must be a drop down"; //$NON-NLS-1$
3523: case ERROR_THREAD_INVALID_ACCESS:
3524: return "Invalid thread access"; //$NON-NLS-1$
3525: case ERROR_WIDGET_DISPOSED:
3526: return "Widget is disposed"; //$NON-NLS-1$
3527: case ERROR_MENUITEM_NOT_CASCADE:
3528: return "Menu item is not a CASCADE"; //$NON-NLS-1$
3529: case ERROR_CANNOT_SET_SELECTION:
3530: return "Cannot set selection"; //$NON-NLS-1$
3531: case ERROR_CANNOT_SET_MENU:
3532: return "Cannot set menu"; //$NON-NLS-1$
3533: case ERROR_CANNOT_SET_ENABLED:
3534: return "Cannot set the enabled state"; //$NON-NLS-1$
3535: case ERROR_CANNOT_GET_ENABLED:
3536: return "Cannot get the enabled state"; //$NON-NLS-1$
3537: case ERROR_INVALID_PARENT:
3538: return "Widget has the wrong parent"; //$NON-NLS-1$
3539: case ERROR_MENU_NOT_BAR:
3540: return "Menu is not a BAR"; //$NON-NLS-1$
3541: case ERROR_CANNOT_GET_COUNT:
3542: return "Cannot get count"; //$NON-NLS-1$
3543: case ERROR_MENU_NOT_POP_UP:
3544: return "Menu is not a POP_UP"; //$NON-NLS-1$
3545: case ERROR_UNSUPPORTED_DEPTH:
3546: return "Unsupported color depth"; //$NON-NLS-1$
3547: case ERROR_IO:
3548: return "i/o error"; //$NON-NLS-1$
3549: case ERROR_INVALID_IMAGE:
3550: return "Invalid image"; //$NON-NLS-1$
3551: case ERROR_UNSUPPORTED_FORMAT:
3552: return "Unsupported or unrecognized format"; //$NON-NLS-1$
3553: case ERROR_INVALID_SUBCLASS:
3554: return "Subclassing not allowed"; //$NON-NLS-1$
3555: case ERROR_GRAPHIC_DISPOSED:
3556: return "Graphic is disposed"; //$NON-NLS-1$
3557: case ERROR_DEVICE_DISPOSED:
3558: return "Device is disposed"; //$NON-NLS-1$
3559: case ERROR_FAILED_EXEC:
3560: return "Failed to execute runnable"; //$NON-NLS-1$
3561: case ERROR_FAILED_LOAD_LIBRARY:
3562: return "Unable to load library"; //$NON-NLS-1$
3563: case ERROR_CANNOT_INVERT_MATRIX:
3564: return "Cannot invert matrix"; //$NON-NLS-1$
3565: case ERROR_NO_GRAPHICS_LIBRARY:
3566: return "Unable to load graphics library"; //$NON-NLS-1$
3567: case ERROR_INVALID_FONT:
3568: return "Font not valid"; //$NON-NLS-1$
3569: }
3570: return "Unknown error"; //$NON-NLS-1$
3571: }
3572:
3573: /**
3574: * Returns the NLS'ed message for the given argument.
3575: *
3576: * @param key the key to look up
3577: * @return the message for the given key
3578: *
3579: * @exception IllegalArgumentException <ul>
3580: * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
3581: * </ul>
3582: */
3583: public static String getMessage(String key) {
3584: return Compatibility.getMessage(key);
3585: }
3586:
3587: /**
3588: * Returns the SWT platform name.
3589: * Examples: "win32", "motif", "gtk", "photon", "carbon"
3590: *
3591: * @return the SWT platform name
3592: */
3593: public static String getPlatform() {
3594: return Platform.PLATFORM;
3595: }
3596:
3597: /**
3598: * Returns the SWT version number as an integer.
3599: * Example: "SWT051" == 51
3600: *
3601: * @return the SWT version number
3602: */
3603: public static int getVersion() {
3604: return Library.SWT_VERSION;
3605: }
3606:
3607: /**
3608: * Throws an appropriate exception based on the passed in error code.
3609: *
3610: * @param code the SWT error code
3611: */
3612: public static void error(int code) {
3613: error(code, null);
3614: }
3615:
3616: /**
3617: * Throws an appropriate exception based on the passed in error code.
3618: * The <code>throwable</code> argument should be either null, or the
3619: * throwable which caused SWT to throw an exception.
3620: * <p>
3621: * In SWT, errors are reported by throwing one of three exceptions:
3622: * <dl>
3623: * <dd>java.lang.IllegalArgumentException</dd>
3624: * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
3625: * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
3626: * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
3627: * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
3628: * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
3629: * </dl>
3630: * This method provides the logic which maps between error codes
3631: * and one of the above exceptions.
3632: * </p>
3633: *
3634: * @param code the SWT error code.
3635: * @param throwable the exception which caused the error to occur.
3636: *
3637: * @see SWTError
3638: * @see SWTException
3639: * @see IllegalArgumentException
3640: */
3641: public static void error(int code, Throwable throwable) {
3642: error(code, throwable, null);
3643: }
3644:
3645: /**
3646: * Throws an appropriate exception based on the passed in error code.
3647: * The <code>throwable</code> argument should be either null, or the
3648: * throwable which caused SWT to throw an exception.
3649: * <p>
3650: * In SWT, errors are reported by throwing one of three exceptions:
3651: * <dl>
3652: * <dd>java.lang.IllegalArgumentException</dd>
3653: * <dt>thrown whenever one of the API methods is invoked with an illegal argument</dt>
3654: * <dd>org.eclipse.swt.SWTException (extends java.lang.RuntimeException)</dd>
3655: * <dt>thrown whenever a recoverable error happens internally in SWT</dt>
3656: * <dd>org.eclipse.swt.SWTError (extends java.lang.Error)</dd>
3657: * <dt>thrown whenever a <b>non-recoverable</b> error happens internally in SWT</dt>
3658: * </dl>
3659: * This method provides the logic which maps between error codes
3660: * and one of the above exceptions.
3661: * </p>
3662: *
3663: * @param code the SWT error code.
3664: * @param throwable the exception which caused the error to occur.
3665: * @param detail more information about error.
3666: *
3667: * @see SWTError
3668: * @see SWTException
3669: * @see IllegalArgumentException
3670: *
3671: * @since 3.0
3672: */
3673: public static void error(int code, Throwable throwable,
3674: String detail) {
3675:
3676: /*
3677: * This code prevents the creation of "chains" of SWTErrors and
3678: * SWTExceptions which in turn contain other SWTErrors and
3679: * SWTExceptions as their throwable. This can occur when low level
3680: * code throws an exception past a point where a higher layer is
3681: * being "safe" and catching all exceptions. (Note that, this is
3682: * _a_bad_thing_ which we always try to avoid.)
3683: *
3684: * On the theory that the low level code is closest to the
3685: * original problem, we simply re-throw the original exception here.
3686: *
3687: * NOTE: Exceptions thrown in syncExec and asyncExec must be
3688: * wrapped.
3689: */
3690: if (code != SWT.ERROR_FAILED_EXEC) {
3691: if (throwable instanceof SWTError)
3692: throw (SWTError) throwable;
3693: if (throwable instanceof SWTException)
3694: throw (SWTException) throwable;
3695: }
3696:
3697: String message = findErrorText(code);
3698: if (detail != null)
3699: message += detail;
3700: switch (code) {
3701:
3702: /* Illegal Arguments (non-fatal) */
3703: case ERROR_NULL_ARGUMENT:
3704: case ERROR_CANNOT_BE_ZERO:
3705: case ERROR_INVALID_ARGUMENT:
3706: case ERROR_MENU_NOT_BAR:
3707: case ERROR_MENU_NOT_DROP_DOWN:
3708: case ERROR_MENU_NOT_POP_UP:
3709: case ERROR_MENUITEM_NOT_CASCADE:
3710: case ERROR_INVALID_PARENT:
3711: case ERROR_INVALID_RANGE: {
3712: throw new IllegalArgumentException(message);
3713: }
3714:
3715: /* SWT Exceptions (non-fatal) */
3716: case ERROR_INVALID_SUBCLASS:
3717: case ERROR_THREAD_INVALID_ACCESS:
3718: case ERROR_WIDGET_DISPOSED:
3719: case ERROR_GRAPHIC_DISPOSED:
3720: case ERROR_DEVICE_DISPOSED:
3721: case ERROR_INVALID_IMAGE:
3722: case ERROR_UNSUPPORTED_DEPTH:
3723: case ERROR_UNSUPPORTED_FORMAT:
3724: case ERROR_FAILED_EXEC:
3725: case ERROR_CANNOT_INVERT_MATRIX:
3726: case ERROR_NO_GRAPHICS_LIBRARY:
3727: case ERROR_IO: {
3728: SWTException exception = new SWTException(code, message);
3729: exception.throwable = throwable;
3730: throw exception;
3731: }
3732:
3733: /* Operation System Errors (fatal, may occur only on some platforms) */
3734: case ERROR_CANNOT_GET_COUNT:
3735: case ERROR_CANNOT_GET_ENABLED:
3736: case ERROR_CANNOT_GET_ITEM:
3737: case ERROR_CANNOT_GET_ITEM_HEIGHT:
3738: case ERROR_CANNOT_GET_SELECTION:
3739: case ERROR_CANNOT_GET_TEXT:
3740: case ERROR_CANNOT_SET_ENABLED:
3741: case ERROR_CANNOT_SET_MENU:
3742: case ERROR_CANNOT_SET_SELECTION:
3743: case ERROR_CANNOT_SET_TEXT:
3744: case ERROR_ITEM_NOT_ADDED:
3745: case ERROR_ITEM_NOT_REMOVED:
3746: case ERROR_NO_HANDLES:
3747: //FALL THROUGH
3748:
3749: /* SWT Errors (fatal, may occur only on some platforms) */
3750: case ERROR_FAILED_LOAD_LIBRARY:
3751: case ERROR_NO_MORE_CALLBACKS:
3752: case ERROR_NOT_IMPLEMENTED:
3753: case ERROR_UNSPECIFIED: {
3754: SWTError error = new SWTError(code, message);
3755: error.throwable = throwable;
3756: throw error;
3757: }
3758: }
3759:
3760: /* Unknown/Undefined Error */
3761: SWTError error = new SWTError(code, message);
3762: error.throwable = throwable;
3763: throw error;
3764: }
3765:
3766: static {
3767: /*
3768: * These values represent bit masks that may need to
3769: * expand in the future. Therefore they are not initialized
3770: * in the declaration to stop the compiler from inlining.
3771: */
3772: BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5;
3773: MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND;
3774:
3775: /*
3776: * These values can be different on different platforms.
3777: * Therefore they are not initialized in the declaration
3778: * to stop the compiler from inlining.
3779: */
3780: String platform = getPlatform();
3781: if ("carbon".equals(platform)) { //$NON-NLS-1$
3782: MOD1 = COMMAND;
3783: MOD2 = SHIFT;
3784: MOD3 = ALT;
3785: MOD4 = CONTROL;
3786: } else {
3787: MOD1 = CONTROL;
3788: MOD2 = SHIFT;
3789: MOD3 = ALT;
3790: MOD4 = 0;
3791: }
3792: }
3793: }
|