|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.eclipse.jface.viewers.Viewer
|
+--org.eclipse.jface.viewers.ContentViewer
|
+--org.eclipse.jface.viewers.StructuredViewer
|
+--org.eclipse.jface.viewers.AbstractTreeViewer
|
+--org.eclipse.jface.viewers.TreeViewer
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.
| Fields inherited from class org.eclipse.jface.viewers.AbstractTreeViewer |
ALL_LEVELS |
| Fields inherited from class org.eclipse.jface.viewers.Viewer |
WIDGET_DATA_KEY |
| Constructor Summary | |
TreeViewer(Composite parent)
Creates a tree viewer on a newly-created tree control under the given parent. |
|
TreeViewer(Composite parent,
int style)
Creates a tree viewer on a newly-created tree control under the given parent. |
|
TreeViewer(Tree tree)
Creates a tree viewer on the given tree control. |
|
| Method Summary | |
protected void |
addTreeListener(Control c,
TreeListener listener)
Adds the given SWT tree listener to the given SWT control. |
protected void |
doUpdateItem(Item item,
Object element)
Copies the attributes of the given element into the given SWT item. |
protected Item[] |
getChildren(Widget o)
Returns the SWT child items for the given SWT widget. |
Control |
getControl()
Returns the primary control associated with this viewer. |
protected boolean |
getExpanded(Item item)
Returns whether the given SWT item is expanded or collapsed. |
protected 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(Control widget)
Returns the number of child items of the given SWT control. |
protected int |
getItemCount(Item item)
Returns the number of child items of the given SWT item. |
protected Item[] |
getItems(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 Item |
getParentItem(Item item)
Returns the parent item of the given item in the tree, or null if there is parent item. |
protected Item[] |
getSelection(Control widget)
Returns all selected items for the given SWT control. |
Tree |
getTree()
Returns this tree viewer's tree control. |
protected Item |
newItem(Widget parent,
int flags,
int ix)
Creates a new item. |
protected void |
removeAll(Control widget)
Removes all items from the given control. |
protected void |
setExpanded(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(List items)
Sets the selection to the given list of items. |
protected void |
showItem(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 |
| Constructor Detail |
public TreeViewer(Composite parent)
MULTI, H_SCROLL, V_SCROLL, and BORDER.
The viewer has no input, no content provider, a default label provider,
no sorter, and no filters.parent - the parent control
public TreeViewer(Composite parent,
int style)
parent - the parent controlstyle - the SWT style bits used to create the tree.public TreeViewer(Tree tree)
tree - the tree control| Method Detail |
protected void addTreeListener(Control c,
TreeListener listener)
AbstractTreeVieweraddTreeListener in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewercontrol - the SWT controllistener - the SWT tree listener
protected void doUpdateItem(Item item,
Object element)
AbstractTreeViewerdoUpdateItem in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the SWT itemelement - the elementprotected Item[] getChildren(Widget o)
AbstractTreeViewergetChildren in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewerwidget - the widgetpublic Control getControl()
ViewergetControl in class Viewerorg.eclipse.jface.viewers.Viewerprotected boolean getExpanded(Item item)
AbstractTreeViewergetExpanded in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the itemtrue if the item is considered expanded
and false if collapsed
protected Item getItem(int x,
int y)
StructuredViewernull if there is no item at that location.
The default implementation of this method returns null.
getItem in class StructuredViewerorg.eclipse.jface.viewers.StructuredViewerx - horizontal coordinatey - vertical coordinatenull if there is no item at the
given coordinatesprotected int getItemCount(Control widget)
AbstractTreeViewergetItemCount in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewercontrol - the controlprotected int getItemCount(Item item)
AbstractTreeViewergetItemCount in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the itemprotected Item[] getItems(Item item)
AbstractTreeViewergetItems in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the itempublic IBaseLabelProvider getLabelProvider()
Viewer framework
method returns the label provider, which in the case of tree
viewers will be an instance of ILabelProvider.getLabelProvider in class ContentViewerorg.eclipse.jface.viewers.ContentViewerprotected Item getParentItem(Item item)
AbstractTreeViewernull if there is parent item.getParentItem in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the itemnull if noneprotected Item[] getSelection(Control widget)
AbstractTreeViewergetSelection in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewercontrol - the controlpublic Tree getTree()
protected Item newItem(Widget parent,
int flags,
int ix)
AbstractTreeViewernewItem in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewerparent - the parent widgetstyle - SWT style bitsindex - if non-negative, indicates the position to insert the item
into its parentprotected void removeAll(Control widget)
AbstractTreeViewerremoveAll in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeViewercontrol - the control
protected void setExpanded(Item node,
boolean expand)
AbstractTreeViewersetExpanded in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the itemexpand - the expand state of the itempublic void setLabelProvider(IBaseLabelProvider labelProvider)
Viewer framework
method ensures that the given label provider is an instance
of ILabelProvider.setLabelProvider in class ContentViewerorg.eclipse.jface.viewers.ContentViewerlabelProvider - the label provider, or null if noneprotected void setSelection(List items)
AbstractTreeViewersetSelection in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritems - list of items (element type: org.eclipse.swt.widgets.Item)protected void showItem(Item item)
AbstractTreeViewershowItem in class AbstractTreeViewerorg.eclipse.jface.viewers.AbstractTreeVieweritem - the item
|
Eclipse Platform 2.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||