Class TableTreeItem


@Deprecated public class TableTreeItem extends Item
Deprecated.
As of 3.1 use Tree, TreeItem and TreeColumn
A TableTreeItem is a selectable user interface object that represents an item in a hierarchy of items in a TableTree.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableTreeItem(TableTreeItem parent, int style)
    Deprecated.
    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)
    Deprecated.
    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.
    TableTreeItem(TableTree parent, int style)
    Deprecated.
    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)
    Deprecated.
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
    Disposes of the operating system resources associated with the receiver and all its descendants.
    Deprecated.
    Returns the receiver's background color.
    getBounds(int index)
    Deprecated.
    Returns a rectangle describing the receiver's size and location relative to its parent.
    boolean
    Deprecated.
    Returns true if the receiver is checked, and false otherwise.
    boolean
    Deprecated.
    Returns true if the receiver is expanded, and false otherwise.
    Deprecated.
    Returns the font that the receiver will use to paint textual information for this item.
    Deprecated.
    Returns the foreground color that the receiver will use to draw.
    boolean
    Deprecated.
    Returns true if the receiver is grayed, and false otherwise.
    Deprecated.
    Gets the first image.
    getImage(int index)
    Deprecated.
    Gets the image at the specified index.
    getItem(int index)
    Deprecated.
    Returns the item at the given, zero-relative index in the receiver.
    int
    Deprecated.
    Returns the number of items contained in the receiver that are direct item children of the receiver.
    Deprecated.
    Returns an array of TableTreeItems which are the direct item children of the receiver.
    Deprecated.
    Returns the receiver's parent, which must be a TableTree.
    Deprecated.
    Returns the receiver's parent item, which must be a TableTreeItem or null when the receiver is a root.
    Deprecated.
    Returns the receiver's text, which will be an empty string if it has never been set.
    getText(int index)
    Deprecated.
    Gets the item text at the specified index.
    int
    Deprecated.
    Gets the index of the specified item.
    void
    Deprecated.
    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)
    Deprecated.
    Sets the checked state of the checkbox for this item.
    void
    setExpanded(boolean expanded)
    Deprecated.
    Sets the expanded state.
    void
    setFont(Font font)
    Deprecated.
    Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.
    void
    Deprecated.
    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)
    Deprecated.
    Sets the grayed state of the checkbox for this item.
    void
    setImage(int index, Image image)
    Deprecated.
    Sets the image at an index.
    void
    setImage(Image image)
    Deprecated.
    Sets the first image.
    void
    setText(int index, String text)
    Deprecated.
    Sets the widget text.
    void
    setText(String string)
    Deprecated.
    Sets the receiver's text.

    Methods inherited from class org.eclipse.swt.widgets.Item

    checkSubclass

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TableTreeItem

      public TableTreeItem(TableTree parent, int style)
      Deprecated.
      Constructs a new instance of this class given its parent (which must be a 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.

      Parameters:
      parent - a composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      See Also:
    • TableTreeItem

      public TableTreeItem(TableTree parent, int style, int index)
      Deprecated.
      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.

      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 composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      index - the index to store the receiver in its parent
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      See Also:
    • TableTreeItem

      public TableTreeItem(TableTreeItem parent, int style)
      Deprecated.
      Constructs a new instance of this class given its parent (which must be a 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.

      Parameters:
      parent - a composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      See Also:
    • TableTreeItem

      public TableTreeItem(TableTreeItem parent, int style, int index)
      Deprecated.
      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.

      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 composite control which will be the parent of the new instance (cannot be null)
      style - the style of control to construct
      index - the index to store the receiver in its parent
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the parent is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
      See Also:
  • Method Details

    • getBackground

      public Color getBackground()
      Deprecated.
      Returns the receiver's background color.
      Returns:
      the background color
      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
      Since:
      2.0
    • getBounds

      public Rectangle getBounds(int index)
      Deprecated.
      Returns a rectangle describing the receiver's size and location relative to its parent.
      Returns:
      the receiver's bounding rectangle
      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
    • getChecked

      public boolean getChecked()
      Deprecated.
      Returns true if the receiver is checked, and false otherwise. When the parent does not have the CHECK style, return false.
      Returns:
      the checked state of the checkbox
      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
    • getGrayed

      public boolean getGrayed()
      Deprecated.
      Returns true if the receiver is grayed, and false otherwise. When the parent does not have the CHECK style, return false.
      Returns:
      the grayed state of the checkbox
      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
      Since:
      2.1
    • getExpanded

      public boolean getExpanded()
      Deprecated.
      Returns true if the receiver is expanded, and false otherwise.

      Returns:
      the expanded state
    • getFont

      public Font getFont()
      Deprecated.
      Returns the font that the receiver will use to paint textual information for this item.
      Returns:
      the receiver's font
      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
      Since:
      3.0
    • getForeground

      public Color getForeground()
      Deprecated.
      Returns the foreground color that the receiver will use to draw.
      Returns:
      the receiver's foreground color
      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
      Since:
      2.0
    • getImage

      public Image getImage()
      Deprecated.
      Gets the first image.

      The image in column 0 is reserved for the [+] and [-] images of the tree, therefore getImage(0) will return null.

      Overrides:
      getImage in class Item
      Returns:
      the image at index 0
      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
    • getImage

      public Image getImage(int index)
      Deprecated.
      Gets the image at the specified 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.

      Parameters:
      index - the index of the image
      Returns:
      the image at the specified index or null
    • getItem

      public TableTreeItem getItem(int index)
      Deprecated.
      Returns the item at the given, zero-relative index in the receiver. Throws an exception if the index is out of range.
      Parameters:
      index - the index of the item to return
      Returns:
      the item at the given index
      Throws:
      IllegalArgumentException -
      • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      Since:
      3.1
    • getItemCount

      public int getItemCount()
      Deprecated.
      Returns the number of items contained in the receiver that are direct item children of the receiver.
      Returns:
      the number of items
    • getItems

      public TableTreeItem[] getItems()
      Deprecated.
      Returns an array of TableTreeItems 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.

      Returns:
      the receiver's items
    • getParent

      public TableTree getParent()
      Deprecated.
      Returns the receiver's parent, which must be a TableTree.
      Returns:
      the receiver's parent
    • getParentItem

      public TableTreeItem getParentItem()
      Deprecated.
      Returns the receiver's parent item, which must be a TableTreeItem or null when the receiver is a root.
      Returns:
      the receiver's parent item
    • getText

      public String getText()
      Deprecated.
      Description copied from class: Item
      Returns the receiver's text, which will be an empty string if it has never been set.
      Overrides:
      getText in class Item
      Returns:
      the receiver's text
    • getText

      public String getText(int index)
      Deprecated.
      Gets the item text at the specified 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.

      Parameters:
      index - the index of the item
      Returns:
      the item text at the specified index, which can be null
    • indexOf

      public int indexOf(TableTreeItem item)
      Deprecated.
      Gets the index of the specified 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 if the item is not found
    • dispose

      public void dispose()
      Deprecated.
      Description copied from class: Widget
      Disposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answer true when sent the message isDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.

      NOTE: This method is not called recursively on the descendants 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.

      Overrides:
      dispose in class Widget
      See Also:
    • setBackground

      public 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 item if the argument is null.
      Parameters:
      color - the new color (or null)
      Throws:
      IllegalArgumentException -
      • ERROR_INVALID_ARGUMENT - if the argument has been disposed
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      Since:
      2.0
    • setChecked

      public void setChecked(boolean checked)
      Deprecated.
      Sets the checked state of the checkbox for this item. This state change only applies if the Table was created with the SWT.CHECK style.
      Parameters:
      checked - the new checked state of the checkbox
      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
    • setGrayed

      public void setGrayed(boolean grayed)
      Deprecated.
      Sets the grayed state of the checkbox for this item. This state change only applies if the Table was created with the SWT.CHECK style.
      Parameters:
      grayed - the new grayed state of the checkbox;
      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
      Since:
      2.1
    • setExpanded

      public void setExpanded(boolean expanded)
      Deprecated.
      Sets the expanded state.

      Parameters:
      expanded - the new expanded state.
      Throws:
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
      • ERROR_WIDGET_DISPOSED when the widget has been disposed
    • setFont

      public void setFont(Font font)
      Deprecated.
      Sets the font that the receiver will use to paint textual information for this item to the font specified by the argument, or to the default font for that kind of control if the argument is null.
      Parameters:
      font - the new font (or null)
      Throws:
      IllegalArgumentException -
      • ERROR_INVALID_ARGUMENT - if the argument has been disposed
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      Since:
      3.0
    • setForeground

      public 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 item if the argument is null.
      Parameters:
      color - the new color (or null)
      Throws:
      IllegalArgumentException -
      • ERROR_INVALID_ARGUMENT - if the argument has been disposed
      SWTException -
      • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
      • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      Since:
      2.0, 2.0
    • setImage

      public void setImage(int index, Image image)
      Deprecated.
      Sets the image at an index.

      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.

      Parameters:
      image - the new image or null
      Throws:
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
      • ERROR_WIDGET_DISPOSED when the widget has been disposed
    • setImage

      public void setImage(Image image)
      Deprecated.
      Sets the first image.

      The image can be null. The image in column 0 is reserved for the [+] and [-] images of the tree, therefore do nothing.

      Overrides:
      setImage in class Item
      Parameters:
      image - the new image or null
      Throws:
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
      • ERROR_WIDGET_DISPOSED when the widget has been disposed
    • setText

      public void setText(int index, String text)
      Deprecated.
      Sets the widget text.

      The widget text for an item is the label of the item or the label of the text specified by a column number.

      Parameters:
      index - the column number
      text - the new text
      Throws:
      IllegalArgumentException -
      • ERROR_NULL_ARGUMENT - if the text is null
      SWTException -
      • ERROR_THREAD_INVALID_ACCESS when called from the wrong thread
      • ERROR_WIDGET_DISPOSED when the widget has been disposed
    • setText

      public void setText(String string)
      Deprecated.
      Description copied from class: Item
      Sets the receiver's text.

      Note: If control characters like '\n', '\t' etc. are used in the string, then the behavior is platform dependent.

      Overrides:
      setText in class Item
      Parameters:
      string - the new text