|
Eclipse Platform 2.0 |
||||||||||
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.custom.TableTreeItem
A TableTreeItem is a selectable user interface object that represents an item in a heirarchy of items in a TableTree.
Constructor Summary | |
TableTreeItem(TableTree parent,
int style)
Constructs a new instance of this class given its parent (which must be a TableTree )
and a style value describing its behavior and appearance. |
|
TableTreeItem(TableTree parent,
int style,
int index)
Constructs a new instance of this class given its parent (which must be a TableTree ,
a style value describing its behavior and appearance, and the index
at which to place it in the items maintained by its parent. |
|
TableTreeItem(TableTreeItem parent,
int style)
Constructs a new instance of this class given its parent (which must be a TableTreeItem )
and a style value describing its behavior and appearance. |
|
TableTreeItem(TableTreeItem parent,
int style,
int index)
Constructs a new instance of this class given its parent (which must be a TableTreeItem ),
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 | |
void |
dispose()
Disposes of the operating system resources associated with the receiver and all its descendents. |
Color |
getBackground()
Returns the receiver's background color. |
Rectangle |
getBounds(int index)
Returns a rectangle describing the receiver's size and location relative to its parent. |
boolean |
getChecked()
Returns true if the receiver is checked,
and false otherwise. |
Display |
getDisplay()
Returns the Display that is associated with
the receiver. |
boolean |
getExpanded()
Returns true if the receiver is expanded,
and false otherwise. |
Color |
getForeground()
Returns the foreground color that the receiver will use to draw. |
Image |
getImage()
Gets the first image. |
Image |
getImage(int index)
Gets the image at the specified index. |
int |
getItemCount()
Returns the number of items contained in the receiver that are direct item children of the receiver. |
TableTreeItem[] |
getItems()
Returns an array of TableTreeItem s which are the
direct item children of the receiver. |
TableTree |
getParent()
Returns the receiver's parent, which must be a TableTree . |
TableTreeItem |
getParentItem()
Returns the receiver's parent item, which must be a TableTreeItem or null when the receiver is a
root. |
String |
getText()
Returns the receiver's text, which will be an empty string if it has never been set. |
String |
getText(int index)
Gets the item text at the specified index. |
int |
indexOf(TableTreeItem item)
Gets the index of the specified item. |
void |
setBackground(Color color)
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)
Sets the checked state. |
void |
setExpanded(boolean expanded)
Sets the expanded state. |
void |
setForeground(Color color)
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 |
setImage(Image image)
Sets the first image. |
void |
setImage(int index,
Image image)
Sets the image at an index. |
void |
setText(int index,
String text)
Sets the widget text. |
void |
setText(String string)
Sets the receiver's text. |
Methods inherited from class org.eclipse.swt.widgets.Item |
checkSubclass |
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 |
Constructor Detail |
public TableTreeItem(TableTree parent, int style)
TableTree
)
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 construct
IllegalArgumentException
- SWTException
- SWT
,
Widget.getStyle()
public TableTreeItem(TableTree parent, int style, int index)
TableTree
,
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 parent
IllegalArgumentException
- SWTException
- SWT
,
Widget.getStyle()
public TableTreeItem(TableTreeItem parent, int style)
TableTreeItem
)
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.
style
- the style of control to construct
IllegalArgumentException
- SWTException
- SWT
,
Widget.getStyle()
public TableTreeItem(TableTreeItem parent, int style, int index)
TableTreeItem
),
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.
style
- the style of control to constructindex
- the index to store the receiver in its parent
IllegalArgumentException
- SWTException
- SWT
,
Widget.getStyle()
Method Detail |
public Color getBackground()
SWTException
- public Rectangle getBounds(int index)
SWTException
- 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
- Throws:
SWTException
-
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
public Display getDisplay()
Widget
Display
that is associated with
the receiver.
A widget's display is either provided when it is created
(for example, top level Shell
s) or is the
same as its parent's display.
getDisplay
in class Widget
public boolean getExpanded()
true
if the receiver is expanded,
and false otherwise.
public Color getForeground()
SWTException
- public Image getImage()
The image in column 0 is reserved for the [+] and [-] images of the tree, therefore getImage(0) will return null.
getImage
in class Item
SWTException
- public Image getImage(int index)
Indexing is zero based. The image can be null. The image in column 0 is reserved for the [+] and [-] images of the tree, therefore getImage(0) will return null. Return null if the index is out of range.
index
- the index of the image
public int getItemCount()
public TableTreeItem[] getItems()
TableTreeItem
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 TableTree getParent()
TableTree
.
public TableTreeItem getParentItem()
TableTreeItem
or null when the receiver is a
root.
public String getText()
Item
getText
in class Item
public String getText(int index)
Indexing is zero based. This operation will fail when the index is out of range or an item could not be queried from the OS.
index
- the index of the item
public int indexOf(TableTreeItem item)
The widget is searched starting at 0 until an item is found that is equal to the search item. If no item is found, -1 is returned. Indexing is zero based. This index is relative to the parent only.
item
- the search item
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.
NOTE: This method is not called recursively on the descendents
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.
dispose
in class Widget
Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener)
,
Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener)
,
Widget.checkWidget()
public void setBackground(Color color)
color
- the new color (or null)
IllegalArgumentException
- SWTException
- public void setChecked(boolean checked)
checked
- the new checked state.
SWTError
- public void setExpanded(boolean expanded)
expanded
- the new expanded state.
SWTError
- public void setForeground(Color color)
color
- the new color (or null)
IllegalArgumentException
- SWTException
- public void setImage(int index, Image image)
The image can be null. The image in column 0 is reserved for the [+] and [-] images of the tree, therefore do nothing if index is 0.
image
- the new image or null
SWTError
- public void setImage(Image image)
The image can be null. The image in column 0 is reserved for the [+] and [-] images of the tree, therefore do nothing.
setImage
in class Item
image
- the new image or null
SWTError
- public void setText(int index, String text)
The widget text for an item is the label of the item or the label of the text specified by a column number.
index
- the column numbertext
- the new text
SWTError
- public void setText(String string)
Item
setText
in class Item
string
- the new text
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |