|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Field Summary | |
(package private) int |
background
|
(package private) int |
foreground
|
int |
handle
Suppressed: the handle to the OS resource (Warning: This field is platform dependent) |
(package private) Tree |
parent
|
Fields inherited from class org.eclipse.swt.widgets.Item |
image, text |
Fields inherited from class org.eclipse.swt.widgets.Widget |
CANVAS, COMCTL32_MAJOR, COMCTL32_MINOR, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, DISPOSED, eventTable, HIDDEN, keys, MAJOR, MINOR, Mnemonic, state, style, values |
Constructor Summary | |
TreeItem(Tree parent,
int style)
Enabled: Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem )
and a style value describing its behavior and appearance. |
|
TreeItem(Tree parent,
int style,
int index)
Enabled: Constructs a new instance of this class given its parent (which must be a 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)
Enabled: Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem )
and a style value describing its behavior and appearance. |
|
TreeItem(TreeItem parentItem,
int style,
int index)
Enabled: Constructs a new instance of this class given its parent (which must be a 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. |
Method Summary | |
(package private) static TreeItem |
checkNull(TreeItem item)
|
protected void |
checkSubclass()
Checks that this class can be subclassed. |
Color |
getBackground()
Enabled: Returns the receiver's background color. |
Rectangle |
getBounds()
Enabled: Returns a rectangle describing the receiver's size and location relative to its parent. |
boolean |
getChecked()
Enabled: Returns true if the receiver is checked,
and false otherwise. |
Display |
getDisplay()
Suppressed: |
boolean |
getExpanded()
Suppressed: Returns true if the receiver is expanded,
and false otherwise. |
Color |
getForeground()
Enabled: Returns the foreground color that the receiver will use to draw. |
boolean |
getGrayed()
Enabled: Returns true if the receiver is grayed,
and false otherwise. |
int |
getItemCount()
Enabled: Returns the number of items contained in the receiver that are direct item children of the receiver. |
TreeItem[] |
getItems()
Enabled: Returns an array of TreeItem s which are the
direct item children of the receiver. |
Tree |
getParent()
Suppressed: Returns the receiver's parent, which must be a Tree . |
TreeItem |
getParentItem()
Suppressed: Returns the receiver's parent item, which must be a TreeItem or null when the receiver is a
root. |
(package private) void |
redraw()
|
(package private) void |
releaseChild()
|
(package private) void |
releaseHandle()
|
(package private) void |
releaseWidget()
|
void |
setBackground(Color color)
Enabled: Sets the receiver's background color to the color specified by the argument, or to the default system color for the item if the argument is null. |
void |
setChecked(boolean checked)
Suppressed: Sets the checked state of the receiver. |
void |
setExpanded(boolean expanded)
Enabled: Sets the expanded state of the receiver. |
void |
setForeground(Color color)
Enabled: Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the item if the argument is null. |
void |
setGrayed(boolean grayed)
Enabled: Sets the grayed state of the receiver. |
void |
setImage(Image image)
Enabled: |
void |
setText(String string)
Enabled: |
Methods inherited from class org.eclipse.swt.widgets.Item |
getImage, getNameText, getText |
Methods inherited from class org.eclipse.swt.widgets.Widget |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int handle
Tree parent
int background
int foreground
Constructor Detail |
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()
Method Detail |
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 Item
public 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 Widget
public 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()
TreeItem
s 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 Widget
void releaseHandle()
releaseHandle
in class Widget
void releaseWidget()
releaseWidget
in class Item
public 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)
setImage
in class Item
image
- the image to display on the receiver (may be null)public void setText(String string)
setText
in class Item
string
- the new text
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |