Top Description Fields Constructors Methods
org.eclipse.swt.widgets

public Class TabItem

extends Item
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.graphics.*, org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*, org.eclipse.swt.internal.gtk3.*, org.eclipse.swt.internal.gtk4.*

Instances of this class represent a selectable user interface object corresponding to a tab for a page in a tab folder.
Styles:
(none)
Events:
(none)

Important Note

This class is not intended to be subclassed.

See Also
TabFolder, TabItem snippets, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv Control
pack-priv long
pack-priv long
pack-priv long
pack-priv long
pack-priv TabFolder
pack-priv String
Inherited from org.eclipse.swt.widgets.Item:
ELLIPSISimagetextTEXT_LIMIT

Constructor Summary

AccessConstructor and Description
public
TabItem(TabFolder
a composite control which will be the parent of the new instance (cannot be null)
parent
,
int
the style of control to construct
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.

public
TabItem(TabFolder
a composite control which will be the parent of the new instance (cannot be null)
parent
,
int
the style of control to construct
style
,
int
the zero-relative index to store the receiver in its parent
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.

Method Summary

Modifier and TypeMethod and Description
protected void
checkSubclass()

Overrides org.eclipse.swt.widgets.Item.checkSubclass.

Checks that this class can be subclassed.
pack-priv void
pack-priv void
pack-priv void
pack-priv long
dpiChanged(long object, long arg0)

Overrides org.eclipse.swt.widgets.Widget.dpiChanged.

public Rectangle

Returns:

the receiver's bounding rectangle
getBounds
()

Returns a rectangle describing the receiver's size and location relative to its parent.

pack-priv Rectangle
public Control

Returns:

the control
getControl
()

Returns the control that is used to fill the client area of the tab folder when the user selects the tab item.

public TabFolder

Returns:

the receiver's parent
getParent
()

Returns the receiver's parent, which must be a TabFolder.

public String

Returns:

the receiver's tool tip text
getToolTipText
()

Returns the receiver's tool tip text, or null if it has not been set.

pack-priv void
gtk_css_provider_load_from_css(long
the GtkStyleContext belonging to the widget which the CSS is to be applied to
styleContext
,
String
Java string representing the CSS
css
)

pack-priv long
pack-priv long
pack-priv void
pack-priv void
pack-priv void
pack-priv void
pack-priv void
public void
setControl(Control
the new control (or null)
control
)

Sets the control that is used to fill the client area of the tab folder when the user selects the tab item.

pack-priv void
setFontDescription(long font)

pack-priv void
setForegroundGdkRGBA(long handle, GdkRGBA rgba)

pack-priv void
public void
setImage(Image
the image to display on the receiver (may be null)
image
)

Overrides org.eclipse.swt.widgets.Item.setImage.

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.
pack-priv void
public void
setText(String
the new text
string
)

Overrides org.eclipse.swt.widgets.Item.setText.

Sets the receiver's text.
public void
setToolTipText(String
the new tool tip text (or null)
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.

Inherited from org.eclipse.swt.widgets.Item:
getImagegetNameTextgetTextreleaseWidgetupdateTextDirection

Field Detail

controlback to summary
pack-priv Control control
cssProviderback to summary
pack-priv long cssProvider
imageHandleback to summary
pack-priv long imageHandle
labelHandleback to summary
pack-priv long labelHandle
pageHandleback to summary
pack-priv long pageHandle
parentback to summary
pack-priv TabFolder parent
toolTipTextback to summary
pack-priv String toolTipText

Constructor Detail

TabItemback to summary
public 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. 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.

Parameters
parent:TabFolder

a composite control which will be the parent of the new instance (cannot be null)

style:int

the style of control to construct

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the parent is null
SWTException:
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
  • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also
SWT, Widget#checkSubclass, Widget#getStyle
TabItemback to summary
public 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.

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.

Parameters
parent:TabFolder

a composite control which will be the parent of the new instance (cannot be null)

style:int

the style of control to construct

index:int

the zero-relative index to store the receiver in its parent

Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the parent is null
  • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)
SWTException:
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
  • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
See Also
SWT, Widget#checkSubclass, Widget#getStyle

Method Detail

checkSubclassback to summary
protected void checkSubclass()

Overrides org.eclipse.swt.widgets.Item.checkSubclass.

Doc from org.eclipse.swt.widgets.Widget.checkSubclass.

Checks that this class can be subclassed.

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 Note

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.

Annotations
@Override
createWidgetback to summary
pack-priv void createWidget(int index)

Overrides org.eclipse.swt.widgets.Widget.createWidget.

Annotations
@Override
deregisterback to summary
pack-priv void deregister()

Overrides org.eclipse.swt.widgets.Widget.deregister.

Annotations
@Override
destroyWidgetback to summary
pack-priv void destroyWidget()

Overrides org.eclipse.swt.widgets.Widget.destroyWidget.

Annotations
@Override
dpiChangedback to summary
pack-priv long dpiChanged(long object, long arg0)

Overrides org.eclipse.swt.widgets.Widget.dpiChanged.

Annotations
@Override
getBoundsback to summary
public Rectangle getBounds()

Returns a rectangle describing the receiver's size and location relative to its parent.

Returns:Rectangle

the receiver's bounding rectangle

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Since
3.4
getBoundsInPixelsback to summary
pack-priv Rectangle getBoundsInPixels()
getControlback to summary
public Control getControl()

Returns the control that is used to fill the client area of the tab folder when the user selects the tab item. If no control has been set, return null.

Returns:Control

the control

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getParentback to summary
public TabFolder getParent()

Returns the receiver's parent, which must be a TabFolder.

Returns:TabFolder

the receiver's parent

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
getToolTipTextback to summary
public String getToolTipText()

Returns the receiver's tool tip text, or null if it has not been set.

Returns:String

the receiver's tool tip text

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
gtk_css_provider_load_from_cssback to summary
pack-priv void gtk_css_provider_load_from_css(long styleContext, String css)
Parameters
styleContext:long

the GtkStyleContext belonging to the widget which the CSS is to be applied to

css:String

Java string representing the CSS

gtk_enter_notify_eventback to summary
pack-priv long gtk_enter_notify_event(long widget, long event)

Overrides org.eclipse.swt.widgets.Widget.gtk_enter_notify_event.

Annotations
@Override
gtk_mnemonic_activateback to summary
pack-priv long gtk_mnemonic_activate(long widget, long arg1)

Overrides org.eclipse.swt.widgets.Widget.gtk_mnemonic_activate.

Annotations
@Override
hookEventsback to summary
pack-priv void hookEvents()

Overrides org.eclipse.swt.widgets.Widget.hookEvents.

Annotations
@Override
registerback to summary
pack-priv void register()

Overrides org.eclipse.swt.widgets.Widget.register.

Annotations
@Override
releaseback to summary
pack-priv void release(boolean destroy)

Overrides org.eclipse.swt.widgets.Widget.release.

Annotations
@Override
releaseHandleback to summary
pack-priv void releaseHandle()

Overrides org.eclipse.swt.widgets.Widget.releaseHandle.

Annotations
@Override
releaseParentback to summary
pack-priv void releaseParent()

Overrides org.eclipse.swt.widgets.Widget.releaseParent.

Annotations
@Override
setControlback to summary
public 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.

Parameters
control:Control

the new control (or null)

Exceptions
IllegalArgumentException:
  • ERROR_INVALID_ARGUMENT - if the control has been disposed
  • ERROR_INVALID_PARENT - if the control is not in the same widget tree
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setFontDescriptionback to summary
pack-priv void setFontDescription(long font)
setForegroundGdkRGBAback to summary
pack-priv void setForegroundGdkRGBA(long handle, GdkRGBA rgba)
setForegroundRGBAback to summary
pack-priv void setForegroundRGBA(GdkRGBA rgba)
setImageback to summary
public void setImage(Image image)

Overrides org.eclipse.swt.widgets.Item.setImage.

Doc from org.eclipse.swt.widgets.Item.setImage.

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

Parameters
image:Image

the image to display on the receiver (may be null)

Annotations
@Override
setOrientationback to summary
pack-priv void setOrientation(boolean create)

Overrides org.eclipse.swt.widgets.Widget.setOrientation.

Annotations
@Override
setTextback to summary
public void setText(String string)

Overrides org.eclipse.swt.widgets.Item.setText.

Sets the receiver's text. The string may include the mnemonic character.

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.

Parameters
string:String

the new text

Annotations
@Override
Exceptions
IllegalArgumentException:
  • ERROR_NULL_ARGUMENT - if the text is null
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setToolTipTextback to summary
public void setToolTipText(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. For a control that has a default tool tip, such as the Tree control on Windows, setting the tool tip text to an empty string replaces the default, causing no tool tip text to be shown.

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.

Note

This operation is a hint and behavior is platform specific, on Windows for CJK-style mnemonics of the form " (&C)" at the end of the tooltip text are not shown in tooltip.

Parameters
string:String

the new tool tip text (or null)

Exceptions
SWTException:
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver