public class TabItem extends Item
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) Control |
control |
(package private) TabFolder |
parent |
(package private) java.lang.String |
toolTipText |
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 |
---|
TabItem(TabFolder parent,
int style)
Constructs a new instance of this class given its parent
(which must be a
TabFolder ) and a style value
describing its behavior and appearance. |
TabItem(TabFolder parent,
int style,
int index)
Constructs a new instance of this class given its parent
(which must be a
TabFolder ), 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 |
---|---|
(package private) void |
_setText(int index,
java.lang.String string) |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent.
|
Control |
getControl()
Returns the control that is used to fill the client area of
the tab folder when the user selects the tab item.
|
TabFolder |
getParent()
Returns the receiver's parent, which must be a
TabFolder . |
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has
not been set.
|
(package private) void |
releaseHandle() |
(package private) void |
releaseParent() |
(package private) void |
releaseWidget() |
void |
setControl(Control control)
Sets the control that is used to fill the client area of
the tab folder when the user selects the tab item.
|
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.
|
void |
setToolTipText(java.lang.String string)
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
getImage, getNameText, getText
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, 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, 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, wmXButtonUp
TabFolder parent
Control control
java.lang.String toolTipText
public TabItem(TabFolder parent, int style)
TabFolder
) and a style value
describing its behavior and appearance. The item is added
to the end of the items maintained by its parent.
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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
public TabItem(TabFolder parent, int style, int index)
TabFolder
), a style value
describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent.
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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructindex
- the zero-relative index to store the receiver in its parentjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
void _setText(int index, java.lang.String string)
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 Item
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Widget
Widget.dispose()
public Control getControl()
null
.
SWTException
- public Rectangle getBounds()
SWTException
- public TabFolder getParent()
TabFolder
.SWTException
- public java.lang.String getToolTipText()
SWTException
- void releaseHandle()
releaseHandle
in class Widget
void releaseParent()
releaseParent
in class Widget
void releaseWidget()
releaseWidget
in class Item
public void setControl(Control control)
control
- the new control (or null)java.lang.IllegalArgumentException
- SWTException
- public void setImage(Image image)
Item
public void setText(java.lang.String string)
Mnemonics are indicated by an '&' that causes the next character to be the mnemonic. When the user presses a key sequence that matches the mnemonic, a selection event occurs. On most platforms, the mnemonic appears underlined but may be emphasised in a platform specific manner. The mnemonic indicator character '&' can be escaped by doubling it in the string, causing a single '&' to be displayed.
setText
in class Item
string
- the new textjava.lang.IllegalArgumentException
- SWTException
- public void setToolTipText(java.lang.String string)
The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
string
- the new tool tip text (or null)SWTException
-