java.lang.Object | +--org.eclipse.swt.widgets.Widget | +--org.eclipse.swt.widgets.Item | +--org.eclipse.swt.widgets.TreeItem
Safe: Instances of this class represent a selectable user interface object that represents a hierarchy of tree items in a tree widget.
IMPORTANT: This class is not intended to be subclassed.
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values
TreeItem(Tree parent,
int style)
Tree or a TreeItem)
and a style value describing its behavior and appearance.
TreeItem(Tree parent,
int style,
int index)
Tree or a TreeItem),
a style value describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent.
TreeItem(TreeItem parentItem,
int style)
Tree or a TreeItem)
and a style value describing its behavior and appearance.
TreeItem(TreeItem parentItem,
int style,
int index)
Tree or a TreeItem),
a style value describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent.
Rectangle
getBounds()
int
getItemCount()
TreeItem[]
getItems()
TreeItems which are the
direct item children of the receiver.
TreeItem
getParentItem()
TreeItem or null when the receiver is a
root.
void
setBackground(Color color)
void
setForeground(Color color)
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, destroyWidget, dispose, error, filters, getData, getData, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mbcsToWcs, mbcsToWcs, notifyListeners, postEvent, postEvent, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, toString, wcsToMbcs, wcsToMbcs
public int handle
Tree parent
int background
int foreground
public TreeItem(Tree parent, int style)
Tree or a TreeItem)
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 constructSWT,
Widget.checkSubclass(),
Widget.getStyle()public TreeItem(Tree parent, int style, int index)
Tree or a TreeItem),
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 index to store the receiver in its parentSWT,
Widget.checkSubclass(),
Widget.getStyle()public TreeItem(TreeItem parentItem, int style)
Tree or a TreeItem)
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.
parentItem - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructSWT,
Widget.checkSubclass(),
Widget.getStyle()public TreeItem(TreeItem parentItem, int style, int index)
Tree or a TreeItem),
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.
parentItem - a composite control which will be the parent of the new instance (cannot be null)style - the style of control to constructindex - the index to store the receiver in its parentSWT,
Widget.checkSubclass(),
Widget.getStyle()static TreeItem checkNull(TreeItem item)
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 Itempublic Color getBackground()
public Rectangle getBounds()
public boolean getChecked()
true if the receiver is checked,
and false otherwise. When the parent does not have
the CHECK style, return false.
- Returns:
- the checked state
public Display getDisplay()
getDisplay in class Widgetpublic boolean getExpanded()
true if the receiver is expanded,
and false otherwise.
public Color getForeground()
public boolean getGrayed()
true if the receiver is grayed,
and false otherwise. When the parent does not have
the CHECK style, return false.
- Returns:
- the grayed state
public int getItemCount()
public TreeItem[] getItems()
TreeItems which are the
direct item children of the receiver.
Note: This is not the actual structure used by the receiver to maintain its list of items, so modifying the array will not affect the receiver.
public Tree getParent()
Tree.
public TreeItem getParentItem()
TreeItem or null when the receiver is a
root.
void redraw()
void releaseChild()
releaseChild in class Widgetvoid releaseHandle()
releaseHandle in class Widgetvoid releaseWidget()
releaseWidget in class Itempublic void setBackground(Color color)
color - the new color (or null)public void setChecked(boolean checked)
checked - the new checked statepublic void setExpanded(boolean expanded)
expanded - the new expanded statepublic void setForeground(Color color)
color - the new color (or null)public void setGrayed(boolean grayed)
public void setImage(Image image)
image - the image to display on the receiver (may be null)public void setText(String string)