Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.dialogs
Class ContainerCheckedTreeViewer

java.lang.Object
  extended by 

org.eclipse.jface.viewers.Viewer
      extended by 

org.eclipse.jface.viewers.ContentViewer
          extended by 

org.eclipse.jface.viewers.StructuredViewer
              extended by 

org.eclipse.jface.viewers.ColumnViewer
                  extended by 

org.eclipse.jface.viewers.AbstractTreeViewer
                      extended by 

org.eclipse.jface.viewers.TreeViewer
                          extended by 

org.eclipse.jface.viewers.CheckboxTreeViewer
                              extended by 
org.eclipse.ui.dialogs.ContainerCheckedTreeViewer
All Implemented Interfaces:
ICheckable, IInputProvider, IInputSelectionProvider, IPostSelectionProvider, ISelectionProvider

public class ContainerCheckedTreeViewer
extends CheckboxTreeViewer

CheckboxTreeViewer with special behaviour of the checked / gray state on container (non-leaf) nodes: The grayed state is used to visualize the checked state of its children. Containers are checked and non-gray if all contained leafs are checked. The container is grayed if some but not all leafs are checked.

Since:
3.1

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.viewers. StructuredViewer
StructuredViewer.ColorAndFontCollector, StructuredViewer.ColorAndFontCollectorWithProviders
 
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
ContainerCheckedTreeViewer ( Composite parent)
          Constructor for ContainerCheckedTreeViewer.
ContainerCheckedTreeViewer ( Composite parent, int style)
          Constructor for ContainerCheckedTreeViewer.
ContainerCheckedTreeViewer ( Tree tree)
          Constructor for ContainerCheckedTreeViewer.
 
Method Summary
protected  void doCheckStateChanged ( Object element)
          Update element after a checkstate change.
  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 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.
protected  void setExpanded ( Item item, boolean expand)
          Sets the expand state of the given item.
 
Methods inherited from class org.eclipse.jface.viewers. CheckboxTreeViewer
addCheckStateListener, doUpdateItem, fireCheckStateChanged, getChecked, getGrayed, getGrayedElements, handleDoubleSelect, handleSelect, preservingSelection, removeCheckStateListener, setAllChecked, setCheckStateProvider, setGrayChecked, setGrayed, setGrayedElements, setParentsGrayed, setSubtreeChecked
 
Methods inherited from class org.eclipse.jface.viewers. TreeViewer
addTreeListener, assertContentProviderType, createChildren, createViewerEditor, disassociate, doGetColumnCount, editElement, getChild, getChildren, getColumnViewerOwner, getControl, getExpanded, getItemAt, getItemCount, getItemCount, getItems, getLabelProvider, getParentElement, getParentItem, getRawChildren, getSelection, getTree, getViewerRowFromItem, handleTreeCollapse, handleTreeExpand, hookControl, internalAdd, internalInitializeTree, internalRefreshStruct, isExpandable, mapElement, newItem, remove, removeAll, replace, setChildCount, setContentProvider, setHasChildren, setSelection, setSelection, showItem, updatePlus
 
Methods inherited from class org.eclipse.jface.viewers. AbstractTreeViewer
add, add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, expandAll, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getFilteredChildren, getNextItem, getPreviousItem, getSelection, getSelectionFromWidget, getSortedChildren, getTreePathFromItem, getVisibleExpandedElements, indexForElement, inputChanged, insert, internalCollapseToLevel, internalExpand, internalExpandToLevel, internalFindItems, internalGetWidgetToSelect, internalIsInputOrEmptyPath, internalRefresh, internalRefresh, internalRefresh, internalRemove, internalRemove, isSameSelection, labelProviderChanged, remove, remove, remove, removeTreeListener, reveal, scrollDown, scrollUp, setAutoExpandLevel, setExpandedElements, setExpandedState, setExpandedTreePaths, setSelectionToWidget, setSelectionToWidget, updateChildren
 
Methods inherited from class org.eclipse.jface.viewers. ColumnViewer
applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, hookEditingSupport, isBusy, isCellEditorActive, refresh, refresh, setBusy, setCellEditors, setCellModifier, setColumnProperties, setColumnViewerEditor, setLabelProvider, triggerEditorActivationEvent, update
 
Methods inherited from class org.eclipse.jface.viewers. StructuredViewer
addDoubleClickListener, addDragSupport, addDropSupport, addFilter, addOpenListener, addPostSelectionChangedListener, assertElementsNotNull, equals, filter, findItem, findItems, fireDoubleClick, fireOpen, firePostSelectionChanged, getColorAndFontCollector, getComparator, getComparer, getFilters, getRoot, getSorter, handleDispose, handleInvalidSelection, handleLabelProviderChanged, handleOpen, handlePostSelect, hasFilters, internalUpdate, needsRefilter, refresh, refresh, refreshItem, removeDoubleClickListener, removeFilter, removeOpenListener, removePostSelectionChangedListener, resetFilters, setComparator, setComparer, setFilters, setInput, setSorter, setUseHashlookup, testFindItem, testFindItems, unmapAllElements, unmapElement, unmapElement, update, updateItem, updateSelection, usingElementMap
 
Methods inherited from class org.eclipse.jface.viewers. ContentViewer
getContentProvider, getInput
 
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

ContainerCheckedTreeViewer

public ContainerCheckedTreeViewer(
Composite parent)
Constructor for ContainerCheckedTreeViewer.

See Also:
CheckboxTreeViewer.CheckboxTreeViewer(Composite)

ContainerCheckedTreeViewer

public ContainerCheckedTreeViewer(
Composite parent,
                                  int style)
Constructor for ContainerCheckedTreeViewer.

See Also:
CheckboxTreeViewer.CheckboxTreeViewer(Composite,int)

ContainerCheckedTreeViewer

public ContainerCheckedTreeViewer(
Tree tree)
Constructor for ContainerCheckedTreeViewer.

See Also:
CheckboxTreeViewer.CheckboxTreeViewer(Tree)
Method Detail

doCheckStateChanged

protected void doCheckStateChanged(
Object element)
Update element after a checkstate change.

Parameters:
element -

setChecked

public boolean setChecked(
Object element,
                          boolean state)
Description copied from interface: ICheckable
Sets the checked state for the given element in this viewer. Does not fire events to check state listeners.

Specified by:
setChecked in interface ICheckable
Overrides:
setChecked in class CheckboxTreeViewer
Parameters:
element - the element
state - true if the item should be checked, and false if it should be unchecked
Returns:
true if the checked state could be set, and false otherwise

setCheckedElements

public void setCheckedElements(
Object[] elements)
Description copied from class: CheckboxTreeViewer
Sets which elements are checked in this viewer's tree. The given list contains the elements that are to be checked; all other elements are to be unchecked. Does not fire events to check state listeners.

This method is typically used when restoring the interesting state of a viewer captured by an earlier call to getCheckedElements.

Overrides:
setCheckedElements in class CheckboxTreeViewer
Parameters:
elements - the array of checked elements
See Also:
CheckboxTreeViewer.getCheckedElements()

setExpanded

protected void setExpanded(
Item item,
                           boolean expand)
Description copied from class: AbstractTreeViewer
Sets the expand state of the given item.

Overrides:
setExpanded in class TreeViewer
Parameters:
item - the item
expand - the expand state of the item

getCheckedElements

public 
Object[] getCheckedElements()
Description copied from class: CheckboxTreeViewer
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.

This method is typically used when preserving the interesting state of a viewer; setCheckedElements is used during the restore.

Overrides:
getCheckedElements in class CheckboxTreeViewer
Returns:
the array of checked elements
See Also:
CheckboxTreeViewer.setCheckedElements(java.lang.Object[])

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire