public abstract class Item extends Widget
| Modifier and Type | Field and Description | 
|---|---|
| (package private) Image | image | 
| (package private) java.lang.String | text | 
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE| Constructor and Description | 
|---|
| Item(Widget parent,
    int style)Constructs a new instance of this class given its parent
 and a style value describing its behavior and appearance. | 
| Item(Widget parent,
    int style,
    int index)Constructs a new instance of this class given its parent
 and a style value describing its behavior and appearance,
 and the index at which to place it in the items maintained
 by its parent. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | checkSubclass()Checks that this class can be subclassed. | 
| Image | getImage()Returns the receiver's image if it has one, or null
 if it does not. | 
| (package private) java.lang.String | getNameText() | 
| java.lang.String | getText()Returns the receiver's text, which will be an empty
 string if it has never been set. | 
| (package private) void | releaseWidget() | 
| void | setImage(Image image)Sets the receiver's image to the argument, which may be
 null indicating that no image should be displayed. | 
| void | setText(java.lang.String string)Sets the receiver's text. | 
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, destroyWidget, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getMenu, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mapEvent, new_GC, notifyListeners, postEvent, postEvent, release, releaseChildren, releaseHandle, releaseParent, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendFocusEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, setTabItemFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUpjava.lang.String text
Image image
public Item(Widget parent, int style)
 The style value is either one of the style constants defined in
 class SWT which is applicable to instances of this
 class, or must be built by bitwise OR'ing together 
 (that is, using the int "|" operator) two or more
 of those SWT style constants. The class description
 lists the style constants that are applicable to the class.
 Style bits are also inherited from superclasses.
 
parent - a widget which will be the parent of the new instance (cannot be null)style - the style of item to constructjava.lang.IllegalArgumentException - SWTException - SWT, 
Widget.getStyle()public Item(Widget parent, int style, int index)
 The style value is either one of the style constants defined in
 class SWT which is applicable to instances of this
 class, or must be built by bitwise OR'ing together 
 (that is, using the int "|" operator) two or more
 of those SWT style constants. The class description
 lists the style constants that are applicable to the class.
 Style bits are also inherited from superclasses.
 
parent - a widget which will be the parent of the new instance (cannot be null)style - the style of item to constructindex - the zero-relative index at which to store the receiver in its parentjava.lang.IllegalArgumentException - SWTException - SWT, 
Widget.getStyle()protected void checkSubclass()
Widget
 The SWT class library is intended to be subclassed 
 only at specific, controlled points (most notably, 
 Composite and Canvas when
 implementing new widgets). This method enforces this
 rule unless it is overridden.
 
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass in class Widgetpublic Image getImage()
SWTException - java.lang.String getNameText()
getNameText in class Widgetpublic java.lang.String getText()
SWTException - void releaseWidget()
releaseWidget in class Widgetpublic void setImage(Image image)
image - the image to display on the receiver (may be null)java.lang.IllegalArgumentException - SWTException - public void setText(java.lang.String string)
string - the new textjava.lang.IllegalArgumentException - SWTException -