org.eclipse.swt.custom
Class CTabItem

java.lang.Object
  |
  +--org.eclipse.swt.widgets.Widget
        |
        +--org.eclipse.swt.widgets.Item
              |
              +--org.eclipse.swt.custom.CTabItem

public class CTabItem
extends Item

Safe:


Field Summary
(package private) static int BOTTOM_MARGIN
           
(package private)  Control control
           
private  Image disabledImage
           
private static String ellipsis
           
(package private)  int height
           
private static int INTERNAL_SPACING
           
(package private) static int LEFT_MARGIN
           
(package private)  CTabFolder parent
           
(package private) static int RIGHT_MARGIN
           
(package private)  String shortenedText
           
(package private)  int shortenedTextWidth
           
(package private)  String toolTipText
           
(package private) static int TOP_MARGIN
           
(package private)  int width
           
(package private)  int x
           
(package private)  int y
           
 
Fields inherited from class org.eclipse.swt.widgets.Item
 
Fields inherited from class org.eclipse.swt.widgets.Widget
 
Constructor Summary
CTabItem(CTabFolder parent, int style)
          Enabled: 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)
          Enabled: 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.
 
Method Summary
private static int checkStyle(int style)
           
 void dispose()
          Enabled:
 Rectangle getBounds()
          Enabled: Returns a rectangle describing the receiver's size and location relative to its parent.
 Control getControl()
          Enabled: Gets the control that is displayed in the content are of the tab item.
 Image getDisabledImage()
          Enabled: Get the image displayed in the tab if the tab is disabled.
 Display getDisplay()
          Suppressed:
 CTabFolder getParent()
          Suppressed: Returns the receiver's parent, which must be a CTabFolder.
 String getToolTipText()
          Enabled: Returns the receiver's tool tip text, or null if it has not been set.
(package private)  void onPaint(GC gc, boolean isSelected)
          Paint the receiver.
(package private)  int preferredHeight(GC gc)
          Answer the preferred height of the receiver for the GC.
(package private)  int preferredWidth(GC gc)
          Answer the preferred width of the receiver for the GC.
 void setControl(Control control)
          Enabled: 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)
          Enabled: Sets the image that is displayed if the tab item is disabled.
 void setImage(Image image)
          Enabled:
 void setText(String string)
          Enabled: Set the widget text.
 void setToolTipText(String string)
          Enabled: Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.
private static String shortenText(GC gc, String text, int width)
           
 
Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getText
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

CTabFolder parent

x

int x

y

int y

width

int width

height

int height

toolTipText

String toolTipText

control

Control control

disabledImage

private Image disabledImage

LEFT_MARGIN

static final int LEFT_MARGIN

RIGHT_MARGIN

static final int RIGHT_MARGIN

TOP_MARGIN

static final int TOP_MARGIN

BOTTOM_MARGIN

static final int BOTTOM_MARGIN

INTERNAL_SPACING

private static final int INTERNAL_SPACING

ellipsis

private static final String ellipsis

shortenedText

String shortenedText

shortenedTextWidth

int shortenedTextWidth
Constructor Detail

CTabItem

public CTabItem(CTabFolder parent,
                int style)
Enabled: Constructs a new instance of this class given its parent (which must be a 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.

Parameters:
parent - a CTabFolder which will be the parent of the new instance (cannot be null)
style - the style of control to construct
See Also:
SWT, Widget.getStyle()

CTabItem

public CTabItem(CTabFolder parent,
                int style,
                int index)
Enabled: 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.

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 - a CTabFolder which will be the parent of the new instance (cannot be null)
style - the style of control to construct
index - the index to store the receiver in its parent
See Also:
SWT, Widget.getStyle()
Method Detail

checkStyle

private static int checkStyle(int style)

dispose

public void dispose()
Enabled:

Overrides:
dispose in class Widget
See Also:
Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.checkWidget()

getBounds

public Rectangle getBounds()
Enabled: Returns a rectangle describing the receiver's size and location relative to its parent.

Returns:
the receiver's bounding column rectangle

getControl

public Control getControl()
Enabled: Gets the control that is displayed in the content are of the tab item.

Returns:
the control

getDisplay

public Display getDisplay()
Suppressed:

Specified by:
getDisplay in class Widget
Returns:
the receiver's display

getDisabledImage

public Image getDisabledImage()
Enabled: Get the image displayed in the tab if the tab is disabled.

Returns:
the disabled image or null

getParent

public CTabFolder getParent()
Suppressed: Returns the receiver's parent, which must be a CTabFolder.

Returns:
the receiver's parent

getToolTipText

public String getToolTipText()
Enabled: Returns the receiver's tool tip text, or null if it has not been set.

Returns:
the receiver's tool tip text

onPaint

void onPaint(GC gc,
             boolean isSelected)
Paint the receiver.


shortenText

private static String shortenText(GC gc,
                                  String text,
                                  int width)

preferredHeight

int preferredHeight(GC gc)
Answer the preferred height of the receiver for the GC.


preferredWidth

int preferredWidth(GC gc)
Answer the preferred width of the receiver for the GC.


setControl

public void setControl(Control control)
Enabled: Sets the control that is used to fill the client area of the tab folder when the user selects the tab item.

Parameters:
control - the new control (or null)

setImage

public void setImage(Image image)
Enabled:

Overrides:
setImage in class Item
Parameters:
image - the image to display on the receiver (may be null)

setDisabledImage

public void setDisabledImage(Image image)
Enabled: Sets the image that is displayed if the tab item is disabled. Null will clear the image.

Parameters:
image - the image to be displayed when the item is disabled or null

setText

public void setText(String string)
Enabled: Set the widget text.

This method sets the widget label. The label may include mnemonic characters but must not contain line delimiters.

Overrides:
setText in class Item
Parameters:
string - the new label for the widget

setToolTipText

public void setToolTipText(String string)
Enabled: Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.

Parameters:
string - the new tool tip text (or null)


comments?