public class ResourceTreeAndListGroup extends EventManager
Constructor and Description |
---|
ResourceTreeAndListGroup(Composite parent,
Object rootObject,
ITreeContentProvider treeContentProvider,
ILabelProvider treeLabelProvider,
IStructuredContentProvider listContentProvider,
ILabelProvider listLabelProvider,
int style,
boolean useHeightHint)
Create an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
aboutToOpen()
This method must be called just before this window becomes visible.
|
void |
addCheckStateListener(ICheckStateListener listener)
Add the passed listener to self's collection of clients
that listen for changes to element checked states
|
void |
collapseAll()
Causes the tree viewer to collapse all of its items
|
void |
expandAll()
Causes the tree viewer to expand all its items
|
List |
getAllCheckedListItems()
Returns a flat list of all of the leaf elements which are checked.
|
void |
getAllCheckedListItems(IElementFilter filter,
IProgressMonitor monitor)
Returns a flat list of all of the leaf elements which are checked.
|
List |
getAllListItems()
Returns a flat list of all of the leaf elements.
|
List |
getAllWhiteCheckedItems()
Returns a list of all of the items that are white checked.
|
int |
getCheckedElementCount()
Returns the number of items that are checked in the tree viewer.
|
void |
initialCheckListItem(Object element)
Set the initial checked state of the passed list element to true.
|
void |
initialCheckTreeItem(Object element)
Set the initial checked state of the passed element to true,
as well as to all of its children and associated list elements
|
boolean |
isEveryItemChecked()
Returns whether all items in the list are checked.
|
void |
removeCheckStateListener(ICheckStateListener listener)
Remove the passed listener from self's collection of clients
that listen for changes to element checked states
|
void |
setAllSelections(boolean selection)
Select or de-select all of the elements in the tree depending on the value of the selection
boolean.
|
void |
setFocus()
Set the focus on to the list widget.
|
void |
setListComparator(ViewerComparator comparator)
Set the comparator that is to be applied to self's list viewer
|
void |
setListProviders(IStructuredContentProvider contentProvider,
ILabelProvider labelProvider)
Set the list viewer's providers to those passed
|
void |
setRoot(Object newRoot)
Set the root of the widget to be new Root.
|
void |
setTreeComparator(ViewerComparator comparator)
Set the comparator that is to be applied to self's tree viewer
|
void |
setTreeProviders(ITreeContentProvider contentProvider,
ILabelProvider labelProvider)
Set the tree viewer's providers to those passed
|
void |
updateSelections(Map items)
Update the selections of the tree elements in items to reflect the new
selections provided.
|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public ResourceTreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, boolean useHeightHint)
parent
- rootObject
- treeContentProvider
- treeLabelProvider
- listContentProvider
- listLabelProvider
- style
- useHeightHint
- If true then use the height hint
to make this group big enoughprotected void aboutToOpen()
public void addCheckStateListener(ICheckStateListener listener)
listener
- ICheckStateListenerpublic void expandAll()
public void collapseAll()
public void getAllCheckedListItems(IElementFilter filter, IProgressMonitor monitor) throws InterruptedException
filter
- -
the filter for the datamonitor
- IProgressMonitor or nullInterruptedException
- If the find is interrupted.public boolean isEveryItemChecked()
public List getAllCheckedListItems()
public List getAllListItems()
public List getAllWhiteCheckedItems()
public int getCheckedElementCount()
public void initialCheckListItem(Object element)
element
- public void initialCheckTreeItem(Object element)
element
- public void removeCheckStateListener(ICheckStateListener listener)
listener
- ICheckStateListenerpublic void setAllSelections(boolean selection)
selection
- public void setListProviders(IStructuredContentProvider contentProvider, ILabelProvider labelProvider)
contentProvider
- ITreeContentProviderlabelProvider
- ILabelProviderpublic void setListComparator(ViewerComparator comparator)
comparator
- the sorter for the listpublic void setRoot(Object newRoot)
newRoot
- public void setTreeProviders(ITreeContentProvider contentProvider, ILabelProvider labelProvider)
contentProvider
- ITreeContentProviderlabelProvider
- ILabelProviderpublic void setTreeComparator(ViewerComparator comparator)
comparator
- the comparator for the treepublic void updateSelections(Map items)
items
- Map with keys of Object (the tree element) and values of List (the selected
list elements).
NOTE: This method does not special case keys with no values (i.e.,
a tree element with an empty list). If a tree element does not have any selected
items, do not include the element in the Map.public void setFocus()
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.