org.eclipse.swt.custom
Class TableTree

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
All Implemented Interfaces:
Drawable

public class TableTree
extends Composite

Safe:


Field Summary
(package private) static Image[] EMPTY_IMAGES
           
(package private) static TableTreeItem[] EMPTY_ITEMS
           
(package private) static String[] EMPTY_TEXTS
           
(package private)  boolean inDispose
           
(package private) static String ITEMID
           
(package private)  TableTreeItem[] items
           
(package private)  Image minusImage
           
(package private)  Image plusImage
           
(package private)  Image sizeImage
           
(package private)  Table table
           
 
Fields inherited from class org.eclipse.swt.widgets.Composite
 
Fields inherited from class org.eclipse.swt.widgets.Scrollable
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
 
Constructor Summary
TableTree(Composite parent, int style)
          Enabled: Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.
 
Method Summary
(package private)  int addItem(TableTreeItem item, int index)
           
 void addSelectionListener(SelectionListener listener)
          Suppressed: 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)
          Enabled: Adds the listener to receive tree events.
 Point computeSize(int wHint, int hHint, boolean changed)
          Enabled:
 Rectangle computeTrim(int x, int y, int width, int height)
          Enabled:
(package private)  void createImages()
           
 void deselectAll()
          Enabled: Deselects all items.
(package private)  void expandItem(TableTreeItem item)
           
 Color getBackground()
          Enabled:
 Rectangle getClientArea()
          Enabled:
 Font getFont()
          Enabled:
 Color getForeground()
          Enabled:
 TableTreeItem getItem(Point point)
          Enabled: Returns the item at the given point in the receiver or null if no such item exists.
(package private)  TableTreeItem getItem(TableItem tableItem)
           
 int getItemCount()
          Enabled: Gets the number of items.
 int getItemHeight()
          Enabled: Gets the height of one item.
 TableTreeItem[] getItems()
          Enabled: Gets the items.
(package private)  Image getMinusImage()
           
(package private)  Image getPlusImage()
           
 TableTreeItem[] getSelection()
          Enabled: Gets the selected items.
 int getSelectionCount()
          Enabled: Gets the number of selected items.
 int getStyle()
          Enabled:
 Table getTable()
          Enabled: Returns the underlying Table control.
 int indexOf(TableTreeItem item)
          Enabled: Gets the index of an item.
(package private)  void onDispose(Event e)
           
(package private)  void onFocusIn(Event e)
           
(package private)  void onKeyDown(Event e)
           
(package private)  void onMouseDown(Event event)
           
(package private)  void onResize(Event e)
           
(package private)  void onSelection(Event e)
           
 void removeAll()
          Enabled: Removes all items.
(package private)  void removeItem(TableTreeItem item)
           
 void removeSelectionListener(SelectionListener listener)
          Enabled: Removes the listener.
 void removeTreeListener(TreeListener listener)
          Enabled: Removes the listener.
 void selectAll()
          Enabled: Selects all items.
 void setBackground(Color color)
          Enabled:
 void setEnabled(boolean enabled)
          Enabled:
 void setFont(Font font)
          Enabled:
 void setForeground(Color color)
          Enabled:
 void setMenu(Menu menu)
          Enabled:
 void setSelection(TableTreeItem[] items)
          Enabled: Sets the selection.
 void setToolTipText(String string)
          Enabled:
 void showItem(TableTreeItem item)
          Enabled: Shows the item.
 void showSelection()
          Enabled: Shows the selection.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, getChildren, getLayout, getTabList, layout, layout, moveAbove, moveBelow, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBorderWidth, getBounds, getDisplay, getEnabled, getLayoutData, getLocation, getMenu, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isDisposed, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBounds, setBounds, setCapture, setCursor, setLayoutData, setLocation, setLocation, setParent, setRedraw, setSize, setSize, setVisible, toControl, toControl, toDisplay, toDisplay, transferActive, transferFocus, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, 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
 

Field Detail

table

Table table

items

TableTreeItem[] items

plusImage

Image plusImage

minusImage

Image minusImage

sizeImage

Image sizeImage

inDispose

boolean inDispose

EMPTY_ITEMS

static final TableTreeItem[] EMPTY_ITEMS

EMPTY_TEXTS

static final String[] EMPTY_TEXTS

EMPTY_IMAGES

static final Image[] EMPTY_IMAGES

ITEMID

static final String ITEMID
Constructor Detail

TableTree

public TableTree(Composite parent,
                 int style)
Enabled: Constructs a new instance of this class given its parent and a style value describing its behavior and appearance.

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.

Parameters:
parent - a widget which will be the parent of the new instance (cannot be null)
style - the style of widget to construct
See Also:
SWT.SINGLE, SWT.MULTI, SWT.CHECK, SWT.FULL_SELECTION, getStyle()
Method Detail

addItem

int addItem(TableTreeItem item,
            int index)

addSelectionListener

public void addSelectionListener(SelectionListener listener)
Suppressed: 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.

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.

Parameters:
listener - the listener which should be notified
See Also:
SelectionListener, removeSelectionListener(org.eclipse.swt.events.SelectionListener), SelectionEvent

addTreeListener

public void addTreeListener(TreeListener listener)
Enabled: Adds the listener to receive tree events.

Parameters:
listener - the tree listener

computeSize

public Point computeSize(int wHint,
                         int hHint,
                         boolean changed)
Enabled:

Overrides:
computeSize in class Composite
Parameters:
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 otherwise
Returns:
the preferred size of the control.
See Also:
Layout, Control.getBorderWidth(), Control.getBounds(), Control.getSize(), Control.pack(), "computeTrim, getClientArea for controls that implement them"

computeTrim

public Rectangle computeTrim(int x,
                             int y,
                             int width,
                             int height)
Enabled:

Overrides:
computeTrim in class Scrollable
Returns:
the required bounds to produce the given client area
See Also:
Scrollable.getClientArea()

deselectAll

public void deselectAll()
Enabled: Deselects all items.

If an item is selected, it is deselected. If an item is not selected, it remains unselected.


expandItem

void expandItem(TableTreeItem item)

getBackground

public Color getBackground()
Enabled:

Overrides:
getBackground in class Control
Returns:
the background color

getClientArea

public Rectangle getClientArea()
Enabled:

Overrides:
getClientArea in class Scrollable
Returns:
the client area
See Also:
Scrollable.computeTrim(int, int, int, int)

getForeground

public Color getForeground()
Enabled:

Overrides:
getForeground in class Control
Returns:
the receiver's foreground color

getFont

public Font getFont()
Enabled:

Overrides:
getFont in class Control
Returns:
the receiver's font

getItemCount

public int getItemCount()
Enabled: Gets the number of items.

Returns:
the number of items in the widget

getItemHeight

public int getItemHeight()
Enabled: Gets the height of one item.

This operation will fail if the height of one item could not be queried from the OS.

Returns:
the height of one item in the widget

getItems

public TableTreeItem[] getItems()
Enabled: Gets the items.

Returns:
the items in the widget

getSelection

public TableTreeItem[] getSelection()
Enabled: Gets the selected items.

This operation will fail if the selected items cannot be queried from the OS.

Returns:
the selected items in the widget

getSelectionCount

public int getSelectionCount()
Enabled: Gets the number of selected items.

This operation will fail if the number of selected items cannot be queried from the OS.

Returns:
the number of selected items in the widget

getStyle

public int getStyle()
Enabled:

Overrides:
getStyle in class Widget
Returns:
the style bits

getTable

public Table getTable()
Enabled: Returns the underlying Table control.

Returns:
the underlying Table control

createImages

void createImages()

getPlusImage

Image getPlusImage()

getMinusImage

Image getMinusImage()

indexOf

public int indexOf(TableTreeItem item)
Enabled: Gets the index of an 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.

Parameters:
item - the search item
Returns:
the index of the item or -1

onDispose

void onDispose(Event e)

onResize

void onResize(Event e)

onSelection

void onSelection(Event e)

getItem

public TableTreeItem getItem(Point point)
Enabled: Returns the item at the given point in the receiver or null if no such item exists. The point is in the coordinate system of the receiver.

Parameters:
point - the point used to locate the item
Returns:
the item at the given point

getItem

TableTreeItem getItem(TableItem tableItem)

onFocusIn

void onFocusIn(Event e)

onKeyDown

void onKeyDown(Event e)

onMouseDown

void onMouseDown(Event event)

removeAll

public void removeAll()
Enabled: Removes all items.

This operation will fail when an item could not be removed in the OS.


removeItem

void removeItem(TableTreeItem item)

removeSelectionListener

public void removeSelectionListener(SelectionListener listener)
Enabled: Removes the listener.

Parameters:
listener - the listener

removeTreeListener

public void removeTreeListener(TreeListener listener)
Enabled: Removes the listener.

Parameters:
listener - the listener

selectAll

public void selectAll()
Enabled: Selects all items.

If an item is not selected, it is selected. If an item is selected, it remains selected.


setBackground

public void setBackground(Color color)
Enabled:

Overrides:
setBackground in class Control
Parameters:
color - the new color (or null)

setEnabled

public void setEnabled(boolean enabled)
Enabled:

Overrides:
setEnabled in class Control
Parameters:
enabled - the new enabled state

setFont

public void setFont(Font font)
Enabled:

Overrides:
setFont in class Control
Parameters:
font - the new font (or null)

setForeground

public void setForeground(Color color)
Enabled:

Overrides:
setForeground in class Control
Parameters:
color - the new color (or null)

setMenu

public void setMenu(Menu menu)
Enabled:

Overrides:
setMenu in class Control
Parameters:
menu - the new pop up menu

setSelection

public void setSelection(TableTreeItem[] items)
Enabled: Sets the selection.

Parameters:
items - new selection

setToolTipText

public void setToolTipText(String string)
Enabled:

Overrides:
setToolTipText in class Control
Parameters:
string - the new tool tip text (or null)

showItem

public void showItem(TableTreeItem item)
Enabled: Shows the item.

Parameters:
item - the item to be shown

showSelection

public void showSelection()
Enabled: Shows the selection.

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.



comments?