Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.swt.widgets
Class TreeItem  view TreeItem download TreeItem.java

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Item
          extended byorg.eclipse.swt.widgets.TreeItem

public class TreeItem
extends Item

Instances of this class represent a selectable user interface object that represents a hierarchy of tree items in a tree widget.

Styles:
(none)
Events:
(none)

IMPORTANT: This class is not intended to be subclassed.


Field Summary
(package private) static int EXPANDER_EXTRA_PADDING
           
(package private)  Tree parent
           
 
Fields inherited from class org.eclipse.swt.widgets.Item
image, text
 
Fields inherited from class org.eclipse.swt.widgets.Widget
ACTIVATE, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, CANVAS, CHANGED, CLICKED, COMMIT, CONFIGURE_EVENT, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_RANGE, DELETE_TEXT, DISABLED, display, DISPOSED, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPOSE_EVENT, FOCUS, FOCUS_IN_EVENT, FOCUS_OUT_EVENT, handle, HANDLE, HIDE, INSERT_TEXT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, KEYED_DATA, LEAVE_NOTIFY_EVENT, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MOTION_NOTIFY_EVENT, OBSCURED, POPUP_MENU, PREEDIT_CHANGED, REALIZE, ROW_ACTIVATED, SCROLL_CHILD, SELECT, SHOW, SHOW_HELP, SIZE_ALLOCATE, state, style, STYLE_SET, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TOGGLED, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, VISIBILITY_NOTIFY_EVENT, WINDOW_STATE_EVENT
 
Constructor Summary
TreeItem(Tree parent, int style)
          Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem) and a style value describing its behavior and appearance.
TreeItem(Tree parent, int style, int index)
          Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem), a style value describing its behavior and appearance, and the index at which to place it in the items maintained by its parent.
TreeItem(TreeItem parentItem, int style)
          Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem) and a style value describing its behavior and appearance.
TreeItem(TreeItem parentItem, int style, int index)
          Constructs a new instance of this class given its parent (which must be a Tree or a TreeItem), 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
(package private) static TreeItem checkNull(TreeItem item)
           
 org.eclipse.swt.graphics.Color getBackground()
          Returns the receiver's background color.
 org.eclipse.swt.graphics.Rectangle getBounds()
          Returns a rectangle describing the receiver's size and location relative to its parent.
 boolean getChecked()
          Returns true if the receiver is checked, and false otherwise.
 boolean getExpanded()
          Returns true if the receiver is expanded, and false otherwise.
 org.eclipse.swt.graphics.Font getFont()
          Returns the font that the receiver will use to paint textual information for this item.
 org.eclipse.swt.graphics.Color getForeground()
          Returns the foreground color that the receiver will use to draw.
 boolean getGrayed()
          Returns true if the receiver is grayed, and false otherwise.
 int getItemCount()
          Returns the number of items contained in the receiver that are direct item children of the receiver.
 TreeItem[] getItems()
          Returns an array of TreeItems which are the direct item children of the receiver.
 Tree getParent()
          Returns the receiver's parent, which must be a Tree.
 TreeItem getParentItem()
          Returns the receiver's parent item, which must be a TreeItem or null when the receiver is a root.
(package private)  void releaseChild()
           
(package private)  void releaseWidget()
           
 void setBackground(org.eclipse.swt.graphics.Color color)
          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)
          Sets the checked state of the receiver.
 void setExpanded(boolean expanded)
          Sets the expanded state of the receiver.
 void setFont(org.eclipse.swt.graphics.Font font)
          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 setForeground(org.eclipse.swt.graphics.Color color)
          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)
          Sets the grayed state of the receiver.
 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 setText(java.lang.String string)
          Sets the receiver's text.
 
Methods inherited from class org.eclipse.swt.widgets.Item
checkSubclass, getImage, getNameText, getText
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, createHandle, createWidget, deregister, destroyWidget, dispose, error, filterProc, filters, fixMnemonic, fontHeight, getData, getData, getDisplay, getName, getStyle, gtk_activate, gtk_button_press_event, gtk_button_release_event, gtk_changed, gtk_clicked, gtk_commit, gtk_configure_event, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_enter_notify_event, gtk_event_after, gtk_event, gtk_expose_event, gtk_focus_in_event, gtk_focus_out_event, gtk_focus, gtk_hide, gtk_insert_text, gtk_key_press_event, gtk_key_release_event, gtk_leave_notify_event, gtk_map_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_popup_menu, gtk_preedit_changed, gtk_realize, gtk_row_activated, gtk_scroll_child, gtk_select, gtk_show_help, gtk_show, gtk_size_allocate, gtk_style_set, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_timer, gtk_toggled, gtk_unmap_event, gtk_unrealize, gtk_value_changed, gtk_visibility_notify_event, gtk_window_state_event, hookEvents, hooks, hoverProc, isDisposed, isListening, isValidSubclass, isValidThread, isValidWidget, menuPositionProc, mnemonicHit, mnemonicMatch, notifyListeners, pixbufCellDataProc, postEvent, postEvent, register, releaseHandle, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, setOrientation, shellMapProc, textCellDataProc, timerProc, topHandle, toString, translateTraversal, treeSelectionProc, windowProc, windowProc, windowProc, windowProc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

Tree parent

EXPANDER_EXTRA_PADDING

static final int EXPANDER_EXTRA_PADDING
See Also:
Constant Field Values
Constructor Detail

TreeItem

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


TreeItem

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


TreeItem

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


TreeItem

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

Method Detail

checkNull

static TreeItem checkNull(TreeItem item)

getBackground

public org.eclipse.swt.graphics.Color getBackground()
Returns the receiver's background color.

Since:
2.0

getBounds

public org.eclipse.swt.graphics.Rectangle getBounds()
Returns a rectangle describing the receiver's size and location relative to its parent.


getChecked

public boolean getChecked()
Returns true if the receiver is checked, and false otherwise. When the parent does not have the CHECK style, return false.


getExpanded

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


getFont

public org.eclipse.swt.graphics.Font getFont()
Returns the font that the receiver will use to paint textual information for this item.

Since:
3.0

getForeground

public org.eclipse.swt.graphics.Color getForeground()
Returns the foreground color that the receiver will use to draw.

Since:
2.0

getGrayed

public boolean getGrayed()
Returns true if the receiver is grayed, and false otherwise. When the parent does not have the CHECK style, return false.


getItemCount

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


getItems

public TreeItem[] getItems()
Returns an array of TreeItems 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.


getParent

public Tree getParent()
Returns the receiver's parent, which must be a Tree.


getParentItem

public TreeItem getParentItem()
Returns the receiver's parent item, which must be a TreeItem or null when the receiver is a root.


releaseChild

void releaseChild()
Overrides:
releaseChild in class Widget

releaseWidget

void releaseWidget()
Overrides:
releaseWidget in class Item

setBackground

public void setBackground(org.eclipse.swt.graphics.Color color)
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.

Since:
2.0

setChecked

public void setChecked(boolean checked)
Sets the checked state of the receiver.


setGrayed

public void setGrayed(boolean grayed)
Sets the grayed state of the receiver.


setExpanded

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


setFont

public void setFont(org.eclipse.swt.graphics.Font font)
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.

Since:
3.0

setForeground

public void setForeground(org.eclipse.swt.graphics.Color color)
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.

Since:
2.0, 2.0

setImage

public void setImage(org.eclipse.swt.graphics.Image image)
Description copied from class: Item
Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

Overrides:
setImage in class Item

setText

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

Overrides:
setText in class Item