Class CTreeComboItem


  • public class CTreeComboItem
    extends org.eclipse.swt.widgets.Item
    Instances of this class represent a selectable user interface object that represents a hierarchy of tree items in a ctreecombo widget.
    Styles:
    (none)
    Events:
    (none)

    IMPORTANT: This class is not intended to be subclassed.

    • Constructor Summary

      Constructors 
      Constructor Description
      CTreeComboItem​(CTreeComboItem parentItem, int style)
      Constructs a new instance of this class given its parent (which must be a CTreeComboItem) and a style value describing its behavior and appearance.
      CTreeComboItem​(CTreeComboItem parentItem, int style, int index)
      Constructs a new instance of this class given its parent (which must be a CTreeComboItemItem), a style value describing its behavior and appearance, and the index at which to place it in the items maintained by its parent.
      CTreeComboItem​(CTreeCombo parent, int style)
      Constructs a new instance of this class given its parent (which must be a CTreeCombo) and a style value describing its behavior and appearance.
      CTreeComboItem​(CTreeCombo parent, int style, int index)
      Constructs a new instance of this class given its parent (which must be a CTreeCombo ), 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean checkRealItem()  
      void clear​(int index, boolean all)
      Clears the item at the given zero-relative index in the receiver.
      void clearAll​(boolean all)
      Clears all the items in the receiver.
      void dispose()
      Disposes of the operating system resources associated with the receiver and all its descendants.
      org.eclipse.swt.graphics.Color getBackground​(int index)
      Returns the background color at the given column index in the receiver.
      org.eclipse.swt.graphics.Rectangle getBounds()
      Returns a rectangle describing the size and location of the receiver's text relative to its parent.
      org.eclipse.swt.graphics.Rectangle getBounds​(int index)
      Returns a rectangle describing the receiver's size and location relative to its parent at a column in the tree.
      boolean getExpanded()
      Returns true if the receiver is expanded, and false otherwise.
      org.eclipse.swt.graphics.Font getFont​(int index)
      Returns the font that the receiver will use to paint textual information for the specified cell in this item.
      org.eclipse.swt.graphics.Color getForeground​(int index)
      Returns the foreground color at the given column index in the receiver.
      org.eclipse.swt.graphics.Image getImage​(int index)
      Returns the image stored at the given column index in the receiver, or null if the image has not been set or if the column does not exist.
      org.eclipse.swt.graphics.Rectangle getImageBounds​(int index)
      Returns a rectangle describing the size and location relative to its parent of an image at a column in the tree.
      CTreeComboItem getItem​(int index)
      Returns the item at the given, zero-relative index in the receiver.
      int getItemCount()
      Returns the number of items contained in the receiver that are direct item children of the receiver.
      CTreeComboItem[] getItems()
      Returns a (possibly empty) array of CTreeComboItems which are the direct item children of the receiver.
      CTreeCombo getParent()
      Returns the receiver's parent, which must be a CTreeCombo.
      CTreeComboItem getParentItem()
      Returns the receiver's parent item, which must be a CTreeComboItem or null when the receiver is a root.
      (package private) org.eclipse.swt.widgets.TreeItem getRealTreeItem()  
      java.lang.String getText​(int index)
      Returns the text stored at the given column index in the receiver, or empty string if the text has not been set.
      org.eclipse.swt.graphics.Rectangle getTextBounds​(int index)
      Returns a rectangle describing the size and location relative to its parent of the text at a column in the tree.
      int indexOf​(CTreeComboItem item)
      Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item.
      void setBackground​(int index, org.eclipse.swt.graphics.Color color)
      Sets the background color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
      void setBackground​(org.eclipse.swt.graphics.Color color)
      Sets the background color at in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
      void setExpanded​(boolean expand)
      Sets the expanded state of the receiver.
      void setFont​(int index, org.eclipse.swt.graphics.Font font)
      Sets the font that the receiver will use to paint textual information for the specified cell in 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 setFont​(org.eclipse.swt.graphics.Font font)
      Sets the font that the receiver will use to paint textual information for the item to the font specified by the argument, or to the default font for that kind of control if the argument is null.
      void setForeground​(int index, org.eclipse.swt.graphics.Color color)
      Sets the foreground color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
      void setForeground​(org.eclipse.swt.graphics.Color color)
      Sets the foreground color in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
      void setImage​(int index, org.eclipse.swt.graphics.Image image)
      Sets the receiver's image at a column.
      void setImage​(org.eclipse.swt.graphics.Image image)
      Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.
      void setItemCount​(int count)
      Sets the number of child items contained in the receiver.
      (package private) void setRealTreeItem​(org.eclipse.swt.widgets.TreeItem realTreeItem)  
      void setText​(int index, java.lang.String string)
      Sets the receiver's text at a column
      void setText​(java.lang.String string)
      Sets the receiver's text.
      • Methods inherited from class org.eclipse.swt.widgets.Item

        checkSubclass, getImage, getText
      • Methods inherited from class org.eclipse.swt.widgets.Widget

        addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
      • Methods inherited from class java.lang.Object

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

      • CTreeComboItem

        public CTreeComboItem​(CTreeComboItem parentItem,
                              int style,
                              int index)
        Constructs a new instance of this class given its parent (which must be a CTreeComboItemItem), 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:
        parentItem - a CTreeComboItem which will be the parent of the new instance (cannot be null)
        style - the style of control to construct
        index - the zero-relative index to store the receiver in its parent
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)
        org.eclipse.swt.SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        See Also:
        SWT, Widget.checkSubclass(), Widget.getStyle()
      • CTreeComboItem

        public CTreeComboItem​(CTreeComboItem parentItem,
                              int style)
        Constructs a new instance of this class given its parent (which must be a CTreeComboItem) 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:
        parentItem - a CTreeComboItem control which will be the parent of the new instance (cannot be null)
        style - the style of control to construct
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        org.eclipse.swt.SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        See Also:
        SWT, Widget.checkSubclass(), Widget.getStyle()
      • CTreeComboItem

        public CTreeComboItem​(CTreeCombo parent,
                              int style,
                              int index)
        Constructs a new instance of this class given its parent (which must be a CTreeCombo ), 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 CTreeCombo control which will be the parent of the new instance (cannot be null)
        style - the style of control to construct
        index - the zero-relative index to store the receiver in its parent
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)
        org.eclipse.swt.SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        See Also:
        SWT, Widget.checkSubclass(), Widget.getStyle()
      • CTreeComboItem

        public CTreeComboItem​(CTreeCombo parent,
                              int style)
        Constructs a new instance of this class given its parent (which must be a CTreeCombo) 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 CTreeCombo control which will be the parent of the new instance (cannot be null)
        style - the style of control to construct
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the parent is null
        org.eclipse.swt.SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
        • ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
        See Also:
        SWT, Widget.checkSubclass(), Widget.getStyle()
    • Method Detail

      • dispose

        public void dispose()
        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 org.eclipse.swt.widgets.Widget
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.checkWidget()
      • setRealTreeItem

        void setRealTreeItem​(org.eclipse.swt.widgets.TreeItem realTreeItem)
      • getRealTreeItem

        org.eclipse.swt.widgets.TreeItem getRealTreeItem()
      • getItems

        public CTreeComboItem[] getItems()
        Returns a (possibly empty) array of CTreeComboItems 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
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • checkRealItem

        private boolean checkRealItem()
      • setImage

        public void setImage​(org.eclipse.swt.graphics.Image image)
        Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.
        Overrides:
        setImage in class org.eclipse.swt.widgets.Item
        Parameters:
        image - the image to display on the receiver (may be null)
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the image has been disposed
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setText

        public void setText​(java.lang.String string)
        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 org.eclipse.swt.widgets.Item
        Parameters:
        string - the new text
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the text is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getBounds

        public org.eclipse.swt.graphics.Rectangle getBounds​(int index)
        Returns a rectangle describing the receiver's size and location relative to its parent at a column in the tree.
        Parameters:
        index - the index that specifies the column
        Returns:
        the receiver's bounding column rectangle
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getBounds

        public org.eclipse.swt.graphics.Rectangle getBounds()
        Returns a rectangle describing the size and location of the receiver's text relative to its parent.
        Returns:
        the bounding rectangle of the receiver's text
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getParent

        public CTreeCombo getParent()
        Returns the receiver's parent, which must be a CTreeCombo.
        Returns:
        the receiver's parent
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getBackground

        public org.eclipse.swt.graphics.Color getBackground​(int index)
        Returns the background color at the given column index in the receiver.
        Parameters:
        index - the column index
        Returns:
        the background color
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getFont

        public org.eclipse.swt.graphics.Font getFont​(int index)
        Returns the font that the receiver will use to paint textual information for the specified cell in this item.
        Parameters:
        index - the column index
        Returns:
        the receiver's font
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground​(int index)
        Returns the foreground color at the given column index in the receiver.
        Parameters:
        index - the column index
        Returns:
        the foreground color
        Throws:
        org.eclipse.swt.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 org.eclipse.swt.graphics.Image getImage​(int index)
        Returns the image stored at the given column index in the receiver, or null if the image has not been set or if the column does not exist.
        Parameters:
        index - the column index
        Returns:
        the image stored at the given column index in the receiver
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getText

        public java.lang.String getText​(int index)
        Returns the text stored at the given column index in the receiver, or empty string if the text has not been set.
        Parameters:
        index - the column index
        Returns:
        the text stored at the given column index in the receiver
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setBackground

        public void setBackground​(int index,
                                  org.eclipse.swt.graphics.Color color)
        Sets the background color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
        Parameters:
        index - the column index
        color - the new color (or null)
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.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
      • setBackground

        public void setBackground​(org.eclipse.swt.graphics.Color color)
        Sets the background color at in the receiver 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:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.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
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
        Sets the font that the receiver will use to paint textual information for the 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:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.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
      • setFont

        public void setFont​(int index,
                            org.eclipse.swt.graphics.Font font)
        Sets the font that the receiver will use to paint textual information for the specified cell in 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:
        index - the column index
        font - the new font (or null)
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.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
      • setForeground

        public void setForeground​(int index,
                                  org.eclipse.swt.graphics.Color color)
        Sets the foreground color at the given column index in the receiver to the color specified by the argument, or to the default system color for the item if the argument is null.
        Parameters:
        index - the column index
        color - the new color (or null)
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setForeground

        public void setForeground​(org.eclipse.swt.graphics.Color color)
        Sets the foreground color in the receiver 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:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the argument has been disposed
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setImage

        public void setImage​(int index,
                             org.eclipse.swt.graphics.Image image)
        Sets the receiver's image at a column.
        Parameters:
        index - the column index
        image - the new image
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_ARGUMENT - if the image has been disposed
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setText

        public void setText​(int index,
                            java.lang.String string)
        Sets the receiver's text at a column

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

        Parameters:
        index - the column index
        string - the new text
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the text is null
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getParentItem

        public CTreeComboItem getParentItem()
        Returns the receiver's parent item, which must be a CTreeComboItem or null when the receiver is a root.
        Returns:
        the receiver's parent item
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getExpanded

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

        Returns:
        the expanded state
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getItemCount

        public int getItemCount()
        Returns the number of items contained in the receiver that are direct item children of the receiver.
        Returns:
        the number of items
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getItem

        public CTreeComboItem getItem​(int index)
        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:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • indexOf

        public int indexOf​(CTreeComboItem item)
        Searches the receiver's list starting at the first item (index 0) until an item is found that is equal to the argument, and returns the index of that item. If no item is found, returns -1.
        Parameters:
        item - the search item
        Returns:
        the index of the item
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_NULL_ARGUMENT - if the item is null
        • ERROR_INVALID_ARGUMENT - if the item has been disposed
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getTextBounds

        public org.eclipse.swt.graphics.Rectangle getTextBounds​(int index)
        Returns a rectangle describing the size and location relative to its parent of the text at a column in the tree.
        Parameters:
        index - the index that specifies the column
        Returns:
        the receiver's bounding text rectangle
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • getImageBounds

        public org.eclipse.swt.graphics.Rectangle getImageBounds​(int index)
        Returns a rectangle describing the size and location relative to its parent of an image at a column in the tree.
        Parameters:
        index - the index that specifies the column
        Returns:
        the receiver's bounding image rectangle
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setExpanded

        public void setExpanded​(boolean expand)
        Sets the expanded state of the receiver.

        Parameters:
        expanded - the new expanded state
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • setItemCount

        public void setItemCount​(int count)
        Sets the number of child items contained in the receiver.
        Parameters:
        count - the number of items
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
      • clear

        public void clear​(int index,
                          boolean all)
        Clears the item at the given zero-relative index in the receiver. The text, icon and other attributes of the item are set to the default value. If the tree was created with the SWT.VIRTUAL style, these attributes are requested again as needed.
        Parameters:
        index - the index of the item to clear
        all - true if all child items of the indexed item should be cleared recursively, and false otherwise
        Throws:
        java.lang.IllegalArgumentException -
        • ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        SWT.VIRTUAL, SWT.SetData
      • clearAll

        public void clearAll​(boolean all)
        Clears all the items in the receiver. The text, icon and other attributes of the items are set to their default values. If the tree was created with the SWT.VIRTUAL style, these attributes are requested again as needed.
        Parameters:
        all - true if all child items should be cleared recursively, and false otherwise
        Throws:
        org.eclipse.swt.SWTException -
        • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
        • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
        See Also:
        SWT.VIRTUAL, SWT.SetData