|
|||||||||
| Home >> All >> org >> eclipse >> jface >> [ viewers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.jface.viewers
Class TreeViewer

java.lang.Objectorg.eclipse.jface.viewers.Viewer
org.eclipse.jface.viewers.ContentViewer
org.eclipse.jface.viewers.StructuredViewer
org.eclipse.jface.viewers.AbstractTreeViewer
org.eclipse.jface.viewers.TreeViewer
- All Implemented Interfaces:
- IInputProvider, IInputSelectionProvider, IPostSelectionProvider, ISelectionProvider
- Direct Known Subclasses:
- CheckboxTreeViewer
- public class TreeViewer
- extends AbstractTreeViewer
A concrete viewer based on an SWT Tree control.
This class is not intended to be subclassed outside the viewer framework. It is designed to be instantiated with a pre-existing SWT tree control and configured with a domain-specific content provider, label provider, element filter (optional), and element sorter (optional).
Content providers for tree viewers must implement the ITreeContentProvider
interface.
| Nested Class Summary |
| Nested classes inherited from class org.eclipse.jface.viewers.AbstractTreeViewer |
AbstractTreeViewer.UpdateItemSafeRunnable |
| Field Summary | |
private org.eclipse.swt.widgets.Tree |
tree
This viewer's control. |
| Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer |
ALL_LEVELS |
| Fields inherited from class org.eclipse.jface.viewers.StructuredViewer |
|
| Fields inherited from class org.eclipse.jface.viewers.ContentViewer |
|
| Fields inherited from class org.eclipse.jface.viewers.Viewer |
WIDGET_DATA_KEY |
| Constructor Summary | |
TreeViewer(org.eclipse.swt.widgets.Composite parent)
Creates a tree viewer on a newly-created tree control under the given parent. |
|
TreeViewer(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a tree viewer on a newly-created tree control under the given parent. |
|
TreeViewer(org.eclipse.swt.widgets.Tree tree)
Creates a tree viewer on the given tree control. |
|
| Method Summary | |
protected void |
addTreeListener(org.eclipse.swt.widgets.Control c,
org.eclipse.swt.events.TreeListener listener)
Adds the given SWT tree listener to the given SWT control. |
protected void |
doUpdateItem(org.eclipse.swt.widgets.Item item,
java.lang.Object element)
Copies the attributes of the given element into the given SWT item. |
protected org.eclipse.swt.widgets.Item[] |
getChildren(org.eclipse.swt.widgets.Widget o)
Returns the SWT child items for the given SWT widget. |
org.eclipse.swt.widgets.Control |
getControl()
Returns the primary control associated with this viewer. |
protected boolean |
getExpanded(org.eclipse.swt.widgets.Item item)
Returns whether the given SWT item is expanded or collapsed. |
protected org.eclipse.swt.widgets.Item |
getItem(int x,
int y)
Returns the item at the given display-relative coordinates, or null if there is no item at that location. |
protected int |
getItemCount(org.eclipse.swt.widgets.Control widget)
Returns the number of child items of the given SWT control. |
protected int |
getItemCount(org.eclipse.swt.widgets.Item item)
Returns the number of child items of the given SWT item. |
protected org.eclipse.swt.widgets.Item[] |
getItems(org.eclipse.swt.widgets.Item item)
Returns the child items of the given SWT item. |
IBaseLabelProvider |
getLabelProvider()
The tree viewer implementation of this Viewer framework
method returns the label provider, which in the case of tree
viewers will be an instance of ILabelProvider. |
protected org.eclipse.swt.widgets.Item |
getParentItem(org.eclipse.swt.widgets.Item item)
Returns the parent item of the given item in the tree, or null
if there is parent item. |
protected org.eclipse.swt.widgets.Item[] |
getSelection(org.eclipse.swt.widgets.Control widget)
Returns all selected items for the given SWT control. |
org.eclipse.swt.widgets.Tree |
getTree()
Returns this tree viewer's tree control. |
private boolean |
haveSameData(java.util.List items,
org.eclipse.swt.widgets.Item[] current)
Returns true if the given list and array of items
refer to the same model elements. |
protected org.eclipse.swt.widgets.Item |
newItem(org.eclipse.swt.widgets.Widget parent,
int flags,
int ix)
Creates a new item. |
protected void |
removeAll(org.eclipse.swt.widgets.Control widget)
Removes all items from the given control. |
protected void |
setExpanded(org.eclipse.swt.widgets.Item node,
boolean expand)
Sets the expand state of the given item. |
void |
setLabelProvider(IBaseLabelProvider labelProvider)
The tree viewer implementation of this Viewer framework
method ensures that the given label provider is an instance
of ILabelProvider. |
protected void |
setSelection(java.util.List items)
Sets the selection to the given list of items. |
protected void |
showItem(org.eclipse.swt.widgets.Item item)
Shows the given item. |
| Methods inherited from class org.eclipse.jface.viewers.ContentViewer |
getContentProvider, getInput, handleDispose |
| Methods inherited from class org.eclipse.jface.viewers.Viewer |
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, setData, setSelection |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider |
addSelectionChangedListener, removeSelectionChangedListener, setSelection |
| Field Detail |
tree
private org.eclipse.swt.widgets.Tree tree
- This viewer's control.
| Constructor Detail |
TreeViewer
public TreeViewer(org.eclipse.swt.widgets.Composite parent)
- Creates a tree viewer on a newly-created tree control under the given parent.
The tree control is created using the SWT style bits
MULTI, H_SCROLL, V_SCROLL,andBORDER. The viewer has no input, no content provider, a default label provider, no sorter, and no filters.
TreeViewer
public TreeViewer(org.eclipse.swt.widgets.Composite parent, int style)
- Creates a tree viewer on a newly-created tree control under the given parent.
The tree control is created using the given SWT style bits.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
TreeViewer
public TreeViewer(org.eclipse.swt.widgets.Tree tree)
- Creates a tree viewer on the given tree control.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.
| Method Detail |
addTreeListener
protected void addTreeListener(org.eclipse.swt.widgets.Control c, org.eclipse.swt.events.TreeListener listener)
- Description copied from class:
AbstractTreeViewer - Adds the given SWT tree listener to the given SWT control.
- Specified by:
addTreeListenerin classAbstractTreeViewer
doUpdateItem
protected void doUpdateItem(org.eclipse.swt.widgets.Item item, java.lang.Object element)
- Description copied from class:
AbstractTreeViewer - Copies the attributes of the given element into the given SWT item.
- Specified by:
doUpdateItemin classAbstractTreeViewer
getChildren
protected org.eclipse.swt.widgets.Item[] getChildren(org.eclipse.swt.widgets.Widget o)
- Description copied from class:
AbstractTreeViewer - Returns the SWT child items for the given SWT widget.
- Specified by:
getChildrenin classAbstractTreeViewer
getControl
public org.eclipse.swt.widgets.Control getControl()
- Description copied from class:
Viewer - Returns the primary control associated with this viewer.
- Specified by:
getControlin classViewer
getExpanded
protected boolean getExpanded(org.eclipse.swt.widgets.Item item)
- Description copied from class:
AbstractTreeViewer - Returns whether the given SWT item is expanded or collapsed.
- Specified by:
getExpandedin classAbstractTreeViewer
getItem
protected org.eclipse.swt.widgets.Item getItem(int x, int y)
- Description copied from class:
StructuredViewer - Returns the item at the given display-relative coordinates, or
nullif there is no item at that location.The default implementation of this method returns
null.- Overrides:
getItemin classStructuredViewer
getItemCount
protected int getItemCount(org.eclipse.swt.widgets.Control widget)
- Description copied from class:
AbstractTreeViewer - Returns the number of child items of the given SWT control.
- Specified by:
getItemCountin classAbstractTreeViewer
getItemCount
protected int getItemCount(org.eclipse.swt.widgets.Item item)
- Description copied from class:
AbstractTreeViewer - Returns the number of child items of the given SWT item.
- Specified by:
getItemCountin classAbstractTreeViewer
getItems
protected org.eclipse.swt.widgets.Item[] getItems(org.eclipse.swt.widgets.Item item)
- Description copied from class:
AbstractTreeViewer - Returns the child items of the given SWT item.
- Specified by:
getItemsin classAbstractTreeViewer
getLabelProvider
public IBaseLabelProvider getLabelProvider()
- The tree viewer implementation of this
Viewerframework method returns the label provider, which in the case of tree viewers will be an instance ofILabelProvider.- Overrides:
getLabelProviderin classContentViewer
getParentItem
protected org.eclipse.swt.widgets.Item getParentItem(org.eclipse.swt.widgets.Item item)
- Description copied from class:
AbstractTreeViewer - Returns the parent item of the given item in the tree, or
nullif there is parent item.- Specified by:
getParentItemin classAbstractTreeViewer
getSelection
protected org.eclipse.swt.widgets.Item[] getSelection(org.eclipse.swt.widgets.Control widget)
- Description copied from class:
AbstractTreeViewer - Returns all selected items for the given SWT control.
- Specified by:
getSelectionin classAbstractTreeViewer
getTree
public org.eclipse.swt.widgets.Tree getTree()
- Returns this tree viewer's tree control.
newItem
protected org.eclipse.swt.widgets.Item newItem(org.eclipse.swt.widgets.Widget parent, int flags, int ix)
- Description copied from class:
AbstractTreeViewer - Creates a new item.
- Specified by:
newItemin classAbstractTreeViewer
removeAll
protected void removeAll(org.eclipse.swt.widgets.Control widget)
- Description copied from class:
AbstractTreeViewer - Removes all items from the given control.
- Specified by:
removeAllin classAbstractTreeViewer
setExpanded
protected void setExpanded(org.eclipse.swt.widgets.Item node, boolean expand)
- Description copied from class:
AbstractTreeViewer - Sets the expand state of the given item.
- Specified by:
setExpandedin classAbstractTreeViewer
setLabelProvider
public void setLabelProvider(IBaseLabelProvider labelProvider)
- The tree viewer implementation of this
Viewerframework method ensures that the given label provider is an instance ofILabelProvider.- Overrides:
setLabelProviderin classContentViewer
setSelection
protected void setSelection(java.util.List items)
- Description copied from class:
AbstractTreeViewer - Sets the selection to the given list of items.
- Specified by:
setSelectionin classAbstractTreeViewer
haveSameData
private boolean haveSameData(java.util.List items, org.eclipse.swt.widgets.Item[] current)
- Returns
trueif the given list and array of items refer to the same model elements. Order is unimportant.
showItem
protected void showItem(org.eclipse.swt.widgets.Item item)
- Description copied from class:
AbstractTreeViewer - Shows the given item.
- Specified by:
showItemin classAbstractTreeViewer
|
|||||||||
| Home >> All >> org >> eclipse >> jface >> [ viewers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC