|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 org.eclipse.jface.viewers.CheckboxTreeViewer
A concrete tree-structured viewer based on an SWT Tree control with checkboxes on each node.
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).
Field Summary |
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 | |
CheckboxTreeViewer(Composite parent)
Creates a tree viewer on a newly-created tree control under the given parent. | |
CheckboxTreeViewer(Composite parent,
int style)
Creates a tree viewer on a newly-created tree control under the given parent. | |
CheckboxTreeViewer(Tree tree)
Creates a tree viewer on the given tree control. |
Method Summary | |
void | addCheckStateListener(ICheckStateListener listener)
Adds a listener for changes to the checked state of elements in this viewer. |
protected void | fireCheckStateChanged(CheckStateChangedEvent event)
Notifies any check state listeners that the check state of an element has changed. |
boolean | getChecked(Object element)
Returns the checked state of the given element. |
Object[] | getCheckedElements()
Returns a list of checked elements in this viewer's tree, including currently hidden ones that are marked as checked but are under a collapsed ancestor. |
boolean | getGrayed(Object element)
Returns the grayed state of the given element. |
Object[] | getGrayedElements()
Returns a list of grayed elements in this viewer's tree, including currently hidden ones that are marked as grayed but are under a collapsed ancestor. |
protected void | handleDoubleSelect(SelectionEvent event)
Handles a double-click select event from the widget. |
protected void | handleSelect(SelectionEvent event)
Handles a select event from the widget. |
protected void | preservingSelection(Runnable updateCode)
Attempts to preserves the current selection across a run of the given code. |
void | removeCheckStateListener(ICheckStateListener listener)
Removes the given check state listener from this viewer. |
boolean | setChecked(Object element,
boolean state)
Sets the checked state for the given element in this viewer. |
void | setCheckedElements(Object[] elements)
Sets which elements are checked in this viewer's tree. |
boolean | setGrayChecked(Object element,
boolean state)
Check and gray the selection rather than calling both setGrayed and setChecked as an optimization. |
boolean | setGrayed(Object element,
boolean state)
Sets the grayed state for the given element in this viewer. |
void | setGrayedElements(Object[] elements)
Sets which elements are grayed in this viewer's tree. |
boolean | setParentsGrayed(Object element,
boolean state)
Sets the grayed state for the given element and its parents in this viewer. |
boolean | setSubtreeChecked(Object element,
boolean state)
Sets the checked state for the given element and its visible children in this viewer. |
Methods inherited from class org.eclipse.jface.viewers.TreeViewer |
addTreeListener, doUpdateItem, getChildren, getControl, getExpanded, getItem, getItemCount, getItemCount, getItems, getLabelProvider, getParentItem, getSelection, getTree, newItem, removeAll, setExpanded, setLabelProvider, setSelection, showItem |
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 |
Constructor Detail |
public CheckboxTreeViewer(Composite parent)
public CheckboxTreeViewer(Composite parent, int style)
public CheckboxTreeViewer(Tree tree)
Method Detail |
public void addCheckStateListener(ICheckStateListener listener)
protected void fireCheckStateChanged(CheckStateChangedEvent event)
public boolean getChecked(Object element)
public Object[] getCheckedElements()
This method is typically used when preserving the interesting state of a viewer; setCheckedElements is used during the restore.
public boolean getGrayed(Object element)
public Object[] getGrayedElements()
This method is typically used when preserving the interesting state of a viewer; setGrayedElements is used during the restore.
protected void handleDoubleSelect(SelectionEvent event)
This method is internal to the framework; subclassers should not call this method.
protected void handleSelect(SelectionEvent event)
This method is internal to the framework; subclassers should not call this method.
protected void preservingSelection(Runnable updateCode)
The default implementation of this method:
public void removeCheckStateListener(ICheckStateListener listener)
public boolean setChecked(Object element, boolean state)
public void setCheckedElements(Object[] elements)
This method is typically used when restoring the interesting state of a viewer captured by an earlier call to getCheckedElements.
public boolean setGrayed(Object element, boolean state)
public boolean setGrayChecked(Object element, boolean state)
public void setGrayedElements(Object[] elements)
This method is typically used when restoring the interesting state of a viewer captured by an earlier call to getGrayedElements.
public boolean setParentsGrayed(Object element, boolean state)
public boolean setSubtreeChecked(Object element, boolean state)
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.