public class CTabItem extends Item
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) int |
closeImageState |
(package private) Rectangle |
closeRect |
(package private) Control |
control |
(package private) Image |
disabledImage |
(package private) Font |
font |
(package private) int |
height |
(package private) CTabFolder |
parent |
(package private) java.lang.String |
shortenedText |
(package private) int |
shortenedTextWidth |
(package private) boolean |
showClose |
(package private) boolean |
showing |
(package private) int |
state |
(package private) java.lang.String |
toolTipText |
(package private) int |
width |
(package private) int |
x |
(package private) int |
y |
Constructor and Description |
---|
CTabItem(CTabFolder parent,
int style)
Constructs a new instance of this class given its parent
(which must be a
CTabFolder ) and a style value
describing its behavior and appearance. |
CTabItem(CTabFolder parent,
int style,
int index)
Constructs a new instance of this class given its parent
(which must be a
CTabFolder ), 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 |
---|---|
void |
dispose()
Disposes of the operating system resources associated with
the receiver and all its descendants.
|
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent.
|
Control |
getControl()
Gets the control that is displayed in the content area of the tab item.
|
Image |
getDisabledImage()
Deprecated.
the disabled image is not used
|
Font |
getFont()
Returns the font that the receiver will use to paint textual information.
|
CTabFolder |
getParent()
Returns the receiver's parent, which must be a
CTabFolder . |
boolean |
getShowClose()
Returns
true to indicate that the receiver's close button should be shown. |
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has
not been set.
|
boolean |
isShowing()
Returns
true if the item will be rendered in the visible area of the CTabFolder. |
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 |
setDisabledImage(Image image)
Deprecated.
This image is not used
|
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
for this item to the font specified by the argument, or to the default font
for that kind of control if the argument is null.
|
void |
setImage(Image image)
Sets the receiver's image to the argument, which may be
null indicating that no image should be displayed.
|
void |
setShowClose(boolean close)
Sets to
true to indicate that the receiver's close button should be shown. |
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.
|
checkSubclass, getImage, getText
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
CTabFolder parent
int x
int y
int width
int height
Control control
java.lang.String toolTipText
java.lang.String shortenedText
int shortenedTextWidth
Font font
Image disabledImage
Rectangle closeRect
int closeImageState
int state
boolean showClose
boolean showing
public CTabItem(CTabFolder parent, int style)
CTabFolder
) 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 CTabFolder which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.getStyle()
public CTabItem(CTabFolder parent, int style, int index)
CTabFolder
), 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 CTabFolder 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.getStyle()
public void dispose()
Widget
true
when sent the message isDisposed()
.
Any internal connections between the widgets in the tree will
have been removed to facilitate garbage collection.
This method does nothing if the widget is already disposed.
NOTE: This method is not called recursively on the descendants
of the receiver. This means that, widget implementers can not
detect when a widget is being disposed of by re-implementing
this method, but should instead listen for the Dispose
event.
public Rectangle getBounds()
SWTException
- public Control getControl()
SWTException
- public Image getDisabledImage()
SWTException
- public Font getFont()
SWTException
- public CTabFolder getParent()
CTabFolder
.SWTException
- public boolean getShowClose()
true
to indicate that the receiver's close button should be shown.
Otherwise return false
. The initial value is defined by the style (SWT.CLOSE)
that was used to create the receiver.true
if the close button should be shownSWTException
- public java.lang.String getToolTipText()
SWTException
- public boolean isShowing()
true
if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise.true
if the item will be rendered in the visible area of the CTabFolder. Returns false otherwise.SWTException
- public void setControl(Control control)
control
- the new control (or null)java.lang.IllegalArgumentException
- SWTException
- public void setDisabledImage(Image image)
image
- the image to be displayed when the item is disabled or nullSWTException
- public void setFont(Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public void setImage(Image image)
Item
public void setShowClose(boolean close)
true
to indicate that the receiver's close button should be shown.
If the parent (CTabFolder) was created with SWT.CLOSE style, changing this value has
no effect.close
- the new state of the close buttonSWTException
- public void setText(java.lang.String string)
Item
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
-