|
Eclipse Platform Release 3.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.Control org.eclipse.swt.widgets.Scrollable org.eclipse.swt.widgets.Composite org.eclipse.swt.custom.TableTree
A TableTree is a selectable user interface object that displays a hierarchy of items, and issues notification when an item is selected. A TableTree may be single or multi select.
The item children that may be added to instances of this class must be of type TableTreeItem.
Note that although this class is a subclass of Composite, it does not make sense to add Control children to it, or set a layout on it.
Note: Only one of the styles SINGLE, and MULTI may be specified.
Field Summary |
Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
Constructor Summary | |
TableTree(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
Method Summary | |
void | addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the receiver's selection changes, by sending it one of the messages defined in the SelectionListener interface. |
void | addTreeListener(TreeListener listener)
Adds the listener to the collection of listeners who will be notified when an item in the receiver is expanded or collapsed by sending it one of the messages defined in the TreeListener interface. |
Point | computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver. |
Rectangle | computeTrim(int x,
int y,
int width,
int height)
Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area. |
void | deselectAll()
Deselects all items. |
Color | getBackground()
Returns the receiver's background color. |
Rectangle | getClientArea()
Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings"). |
Font | getFont()
Returns the font that the receiver will use to paint textual information. |
Color | getForeground()
Returns the foreground color that the receiver will use to draw. |
TableTreeItem | getItem(Point point)
Returns the item at the given point in the receiver or null if no such item exists. |
int | getItemCount()
Gets the number of items. |
int | getItemHeight()
Gets the height of one item. |
TableTreeItem[] | getItems()
Gets the items. |
TableTreeItem[] | getSelection()
Gets the selected items. |
int | getSelectionCount()
Gets the number of selected items. |
int | getStyle()
Returns the receiver's style information. |
Table | getTable()
Returns the underlying Table control. |
int | indexOf(TableTreeItem item)
Gets the index of an item. |
void | removeAll()
Removes all items. |
void | removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will be notified when the receiver's selection changes. |
void | removeTreeListener(TreeListener listener)
Removes the listener from the collection of listeners who will be notified when items in the receiver are expanded or collapsed.. |
void | selectAll()
Selects all of the items in the receiver. |
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 control if the argument is null. |
void | setEnabled(boolean enabled)
Enables the receiver if the argument is true, and disables it otherwise. |
void | setFont(Font font)
Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null. |
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 control if the argument is null. |
void | setMenu(Menu menu)
Sets the receiver's pop up menu to the argument. |
void | setSelection(TableTreeItem[] items)
Sets the receiver's selection to be the given array of items. |
void | setToolTipText(String string)
Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown. |
void | showItem(TableTreeItem item)
Shows the item. |
void | showSelection()
Shows the selection. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, 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 TableTree(Composite parent, int style)
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.
Method Detail |
public void addSelectionListener(SelectionListener listener)
When widgetSelected is called, the item field of the event object is valid. If the reciever has SWT.CHECK style set and the check selection changes, the event object detail field contains the value SWT.CHECK. widgetDefaultSelected is typically called when an item is double-clicked. The item field of the event object is valid for default selection, but the detail field is not used.
public void addTreeListener(TreeListener listener)
public Point computeSize(int wHint, int hHint, boolean changed)
The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant SWT.DEFAULT is passed for the hint.
If the changed flag is true, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be false, so layout manager caches can be retained.
public Rectangle computeTrim(int x, int y, int width, int height)
In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).
public void deselectAll()
If an item is selected, it is deselected. If an item is not selected, it remains unselected.
public Color getBackground()
public Rectangle getClientArea()
public Color getForeground()
public Font getFont()
public int getItemCount()
public int getItemHeight()
This operation will fail if the height of one item could not be queried from the OS.
public TableTreeItem[] getItems()
public TableTreeItem[] getSelection()
This operation will fail if the selected items cannot be queried from the OS.
public int getSelectionCount()
This operation will fail if the number of selected items cannot be queried from the OS.
public int getStyle()
Note that the value which is returned by this method may not match the value which was provided to the constructor when the receiver was created. This can occur when the underlying operating system does not support a particular combination of requested styles. For example, if the platform widget used to implement a particular SWT widget always has scroll bars, the result of calling this method would always have the SWT.H_SCROLL and SWT.V_SCROLL bits set.
public Table getTable()
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.
public TableTreeItem getItem(Point point)
public void removeAll()
This operation will fail when an item could not be removed in the OS.
public void removeSelectionListener(SelectionListener listener)
public void removeTreeListener(TreeListener listener)
public void selectAll()
If the receiver is single-select, do nothing.
public void setBackground(Color color)
public void setEnabled(boolean enabled)
public void setFont(Font font)
public void setForeground(Color color)
public void setMenu(Menu menu)
public void setSelection(TableTreeItem[] items)
Items that are not in the receiver are ignored. If the receiver is single-select and multiple items are specified, then all items are ignored.
public void setToolTipText(String string)
public void showItem(TableTreeItem item)
public void showSelection()
If there is no selection or the selection is already visible, this method does nothing. If the selection is scrolled out of view, the top index of the widget is changed such that selection becomes visible.
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.