public class TableTree extends Composite
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.
Modifier and Type | Field and Description |
---|---|
(package private) static Image[] |
EMPTY_IMAGES
Deprecated.
|
(package private) static TableTreeItem[] |
EMPTY_ITEMS
Deprecated.
|
(package private) static java.lang.String[] |
EMPTY_TEXTS
Deprecated.
|
(package private) boolean |
inDispose
Deprecated.
|
(package private) static java.lang.String |
ITEMID
Deprecated.
|
(package private) TableTreeItem[] |
items
Deprecated.
|
(package private) Listener |
listener
Deprecated.
|
(package private) Image |
minusImage
Deprecated.
|
(package private) Image |
plusImage
Deprecated.
|
(package private) Image |
sizeImage
Deprecated.
|
(package private) Table |
table
Deprecated.
|
Constructor and Description |
---|
TableTree(Composite parent,
int style)
Deprecated.
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
addItem(TableTreeItem item,
int index)
Deprecated.
|
void |
addSelectionListener(SelectionListener listener)
Deprecated.
Adds the listener to the collection of listeners who will
be notified when the user changes the receiver's selection, by sending
it one of the messages defined in the
SelectionListener
interface. |
void |
addTreeListener(TreeListener listener)
Deprecated.
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. |
private static int |
checkStyle(int style)
Deprecated.
|
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Deprecated.
Returns the preferred size of the receiver.
|
Rectangle |
computeTrim(int x,
int y,
int width,
int height)
Deprecated.
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.
|
(package private) void |
createImages()
Deprecated.
|
void |
deselectAll()
Deprecated.
Deselects all items.
|
(package private) void |
expandItem(TableTreeItem item)
Deprecated.
|
Color |
getBackground()
Deprecated.
Returns the receiver's background color.
|
Rectangle |
getClientArea()
Deprecated.
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()
Deprecated.
Returns the font that the receiver will use to paint textual information.
|
Color |
getForeground()
Deprecated.
Returns the foreground color that the receiver will use to draw.
|
TableTreeItem |
getItem(int index)
Deprecated.
Returns the item at the given, zero-relative index in the
receiver.
|
TableTreeItem |
getItem(Point point)
Deprecated.
Returns the item at the given point in the receiver
or null if no such item exists.
|
(package private) TableTreeItem |
getItem(TableItem tableItem)
Deprecated.
|
int |
getItemCount()
Deprecated.
Gets the number of items.
|
int |
getItemHeight()
Deprecated.
Gets the height of one item.
|
TableTreeItem[] |
getItems()
Deprecated.
Gets the items.
|
(package private) Image |
getMinusImage()
Deprecated.
|
(package private) Image |
getPlusImage()
Deprecated.
|
TableTreeItem[] |
getSelection()
Deprecated.
Gets the selected items.
|
int |
getSelectionCount()
Deprecated.
Gets the number of selected items.
|
int |
getStyle()
Deprecated.
Returns the receiver's style information.
|
Table |
getTable()
Deprecated.
Returns the underlying Table control.
|
int |
indexOf(TableTreeItem item)
Deprecated.
Gets the index of an item.
|
(package private) void |
onDispose(Event e)
Deprecated.
|
(package private) void |
onFocusIn(Event e)
Deprecated.
|
(package private) void |
onKeyDown(Event e)
Deprecated.
|
(package private) void |
onMouseDown(Event event)
Deprecated.
|
(package private) void |
onResize(Event e)
Deprecated.
|
(package private) void |
onSelection(Event e)
Deprecated.
|
void |
removeAll()
Deprecated.
Removes all items.
|
(package private) void |
removeItem(TableTreeItem item)
Deprecated.
|
void |
removeSelectionListener(SelectionListener listener)
Deprecated.
Removes the listener from the collection of listeners who will
be notified when the user changes the receiver's selection.
|
void |
removeTreeListener(TreeListener listener)
Deprecated.
Removes the listener from the collection of listeners who will
be notified when items in the receiver are expanded or collapsed.
|
void |
selectAll()
Deprecated.
Selects all of the items in the receiver.
|
void |
setBackground(Color color)
Deprecated.
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)
Deprecated.
Enables the receiver if the argument is
true ,
and disables it otherwise. |
void |
setFont(Font font)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Sets the receiver's pop up menu to the argument.
|
void |
setSelection(TableTreeItem[] items)
Deprecated.
Sets the receiver's selection to be the given array of items.
|
void |
setToolTipText(java.lang.String string)
Deprecated.
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
void |
showItem(TableTreeItem item)
Deprecated.
Shows the item.
|
void |
showSelection()
Deprecated.
Shows the selection.
|
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setLayoutData, setLocation, setLocation, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
Table table
TableTreeItem[] items
Image plusImage
Image minusImage
Image sizeImage
Listener listener
boolean inDispose
static final TableTreeItem[] EMPTY_ITEMS
static final java.lang.String[] EMPTY_TEXTS
static final Image[] EMPTY_IMAGES
static final java.lang.String ITEMID
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.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to constructjava.lang.IllegalArgumentException
- SWTException
- SWT.SINGLE
,
SWT.MULTI
,
SWT.CHECK
,
SWT.FULL_SELECTION
,
getStyle()
int addItem(TableTreeItem item, int index)
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
When widgetSelected
is called, the item field of the event object is valid.
If the receiver 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.
listener
- the listener which should be notified when the user changes the receiver's selectionjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
public void addTreeListener(TreeListener listener)
TreeListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- TreeListener
,
removeTreeListener(org.eclipse.swt.events.TreeListener)
private static int checkStyle(int style)
public Point computeSize(int wHint, int hHint, boolean changed)
Control
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.
computeSize
in class Composite
wHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)changed
- true
if the control's contents have changed, and false
otherwiseLayout
,
Control.getBorderWidth()
,
Control.getBounds()
,
Control.getSize()
,
Control.pack(boolean)
,
"computeTrim, getClientArea for controls that implement them"public Rectangle computeTrim(int x, int y, int width, int height)
Scrollable
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).
computeTrim
in class Scrollable
x
- the desired x coordinate of the client areay
- the desired y coordinate of the client areawidth
- the desired width of the client areaheight
- the desired height of the client areaScrollable.getClientArea()
public void deselectAll()
If an item is selected, it is deselected. If an item is not selected, it remains unselected.
SWTException
- void expandItem(TableTreeItem item)
public Color getBackground()
Control
Note: This operation is a hint and may be overridden by the platform. For example, on some versions of Windows the background of a TabFolder, is a gradient rather than a solid color.
getBackground
in class Control
public Rectangle getClientArea()
Scrollable
getClientArea
in class Scrollable
Scrollable.computeTrim(int, int, int, int)
public Color getForeground()
Control
getForeground
in class Control
public Font getFont()
Control
public int getItemCount()
public int getItemHeight()
This operation will fail if the height of one item could not be queried from the OS.
SWTException
- public TableTreeItem[] getItems()
public TableTreeItem[] getSelection()
This operation will fail if the selected items cannot be queried from the OS.
SWTException
- public int getSelectionCount()
This operation will fail if the number of selected items cannot be queried from the OS.
SWTException
- public int getStyle()
Widget
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()
void createImages()
Image getPlusImage()
Image getMinusImage()
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 itemvoid onDispose(Event e)
void onResize(Event e)
void onSelection(Event e)
public TableTreeItem getItem(int index)
index
- the index of the item to returnjava.lang.IllegalArgumentException
- SWTException
- public TableTreeItem getItem(Point point)
point
- the point used to locate the itemjava.lang.IllegalArgumentException
- SWTException
- TableTreeItem getItem(TableItem tableItem)
void onFocusIn(Event e)
void onKeyDown(Event e)
void onMouseDown(Event event)
public void removeAll()
This operation will fail when an item could not be removed in the OS.
SWTException
- void removeItem(TableTreeItem item)
public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void removeTreeListener(TreeListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- TreeListener
,
addTreeListener(org.eclipse.swt.events.TreeListener)
public void selectAll()
If the receiver is single-select, do nothing.
SWTException
- public void setBackground(Color color)
Control
Note: This operation is a hint and may be overridden by the platform. For example, on Windows the background of a Button cannot be changed.
setBackground
in class Control
color
- the new color (or null)public void setEnabled(boolean enabled)
Control
true
,
and disables it otherwise. A disabled control is typically
not selectable from the user interface and draws with an
inactive or "grayed" look.setEnabled
in class Control
enabled
- the new enabled statepublic void setFont(Font font)
Control
public void setForeground(Color color)
Control
Note: This operation is a hint and may be overridden by the platform.
setForeground
in class Control
color
- the new color (or null)public void setMenu(Menu menu)
Control
Note: Disposing of a control that has a pop up menu will dispose of the menu. To avoid this behavior, set the menu to null before the control is disposed.
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.
items
- the array of itemsjava.lang.IllegalArgumentException
- SWTException
- deselectAll()
public void setToolTipText(java.lang.String string)
Control
The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
setToolTipText
in class Control
string
- the new tool tip text (or null)public void showItem(TableTreeItem item)
item
- the item to be shownjava.lang.IllegalArgumentException
- SWTException
- showSelection()
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.
SWTException
-