Package com._1c.g5.v8.dt.ui.dialog
Class CheckableTreeViewer
-
- All Implemented Interfaces:
ICheckable
,IInputProvider
,IInputSelectionProvider
,IPostSelectionProvider
,ISelectionProvider
public class CheckableTreeViewer extends CheckboxTreeViewer
Checkable tree viewer implementation, based on CheckboxTreeViewer. Since CheckboxTreeViewer does not allow to hide some checkboxes, there is a need in such tree viewer. All data that is stored in tree viewer is represented by custom tree structureCheckableTreeItem
. This editor uses lazy loading, so elements are loaded only when user expands node from tree. Checked elements are set only when some tree node is expanding.- See Also:
CheckableTreeItem
-
-
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
Constructors Constructor Description CheckableTreeViewer(org.eclipse.swt.widgets.Tree tree)
CheckableTreeViewer(org.eclipse.swt.widgets.Tree tree, boolean multiSelect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
expandOneLevel(org.eclipse.swt.widgets.Widget item)
Expands the tree node by one level and sets the checkboxes for elementsvoid
expandToLevel(Object elementOrTreePath, int level)
Object[]
getCheckedElements()
void
setCheckedElements(Object[] elements)
Saves checked elements in treeviwer, but does not set checkboxes, until some tree node is expanded.void
setMultiSelect(boolean multiSelect)
Set new multiSelect valuevoid
setOppositeCheckedState(Object element)
Changes the check state of an element to opposite.-
Methods inherited from class org.eclipse.jface.viewers.CheckboxTreeViewer
addCheckStateListener, doUpdateItem, fireCheckStateChanged, getChecked, getGrayed, getGrayedElements, handleDoubleSelect, handleSelect, preservingSelection, removeCheckStateListener, setAllChecked, setChecked, setCheckedChildren, setCheckStateProvider, setGrayChecked, setGrayed, setGrayedElements, setParentsGrayed, setSubtreeChecked
-
Methods inherited from class org.eclipse.jface.viewers.TreeViewer
addTreeListener, assertContentProviderType, 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, setExpanded, setHasChildren, setSelection, setSelection, showItem, updatePlus
-
Methods inherited from class org.eclipse.jface.viewers.AbstractTreeViewer
add, add, addSelectionListener, addTreeListener, associate, buildLabel, collapseAll, collapseToLevel, createChildren, createTreeItem, doFindInputItem, doFindItem, doUpdateItem, expandAll, expandAll, expandToLevel, expandToLevel, expandToLevel, fireTreeCollapsed, fireTreeExpanded, getAutoExpandLevel, getChildren, getExpandedElements, getExpandedState, getExpandedTreePaths, getNextItem, getPreviousItem, getSelection, getSelectionFromWidget, getSortedChildren, getStructuredSelection, 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, setExpandPreCheckFilters, setSelectionToWidget, setSelectionToWidget, updateChildren
-
Methods inherited from class org.eclipse.jface.viewers.ColumnViewer
applyEditorValue, cancelEditing, checkBusy, getCell, getCellEditors, getCellModifier, getColumnProperties, getColumnViewerEditor, getItem, getLabelProvider, getViewerRow, handleDispose, 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, getFilteredChildren, getFilters, getRoot, getSorter, 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
-
-
-
-
Method Detail
-
setCheckedElements
public void setCheckedElements(Object[] elements)
Saves checked elements in treeviwer, but does not set checkboxes, until some tree node is expanded.- Overrides:
setCheckedElements
in classCheckboxTreeViewer
-
getCheckedElements
public Object[] getCheckedElements()
- Overrides:
getCheckedElements
in classCheckboxTreeViewer
-
expandOneLevel
public void expandOneLevel(org.eclipse.swt.widgets.Widget item)
Expands the tree node by one level and sets the checkboxes for elements- Parameters:
item
- - a tree item which is expanding
-
expandToLevel
public void expandToLevel(Object elementOrTreePath, int level)
- Overrides:
expandToLevel
in classAbstractTreeViewer
-
setMultiSelect
public void setMultiSelect(boolean multiSelect)
Set new multiSelect value- Parameters:
multiSelect
- - new value of multi select
-
setOppositeCheckedState
public void setOppositeCheckedState(Object element)
Changes the check state of an element to opposite. After state has been changed, viewer is refreshed starting with the given element.- Parameters:
element
- - tree item element
-
-