| org.eclipse.ui.internal.ide.misc.CheckboxTreeAndListGroup
CheckboxTreeAndListGroup | public class CheckboxTreeAndListGroup extends EventManager implements ICheckStateListener,ISelectionChangedListener,ITreeViewerListener(Code) | | Workbench-level composite that combines a CheckboxTreeViewer and CheckboxListViewer.
All viewer selection-driven interactions are handled within this object
|
Constructor Summary | |
public | CheckboxTreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height) Create an instance of this class. |
Method Summary | |
public void | aboutToOpen() This method must be called just before this window becomes visible. | public void | addCheckStateListener(ICheckStateListener listener) | protected boolean | areAllChildrenWhiteChecked(Object treeElement) | protected boolean | areAllElementsChecked(Object treeElement) | protected void | checkNewTreeElements(Object[] elements) | public void | checkStateChanged(CheckStateChangedEvent event) An item was checked in one of self's two views. | protected void | createContents(Composite parent, int width, int height, int style) Lay out and initialize self's visual components. | protected void | createListViewer(Composite parent, int width, int height) Create this group's list viewer. | protected void | createTreeViewer(Composite parent, int width, int height) Create this group's tree viewer. | protected boolean | determineShouldBeAtLeastGrayChecked(Object treeElement) Returns a boolean indicating whether the passed tree element should be
at LEAST gray-checked. | protected boolean | determineShouldBeWhiteChecked(Object treeElement) Returns a boolean indicating whether the passed tree item should be
white-checked. | protected void | determineWhiteCheckedDescendents(Object treeElement) Recursively add appropriate tree elements to the collection of
known white-checked tree elements. | public void | expandAll() | public Iterator | getAllCheckedListItems() | public Set | getAllCheckedTreeItems() | public int | getCheckedElementCount() Answer the number of elements that have been checked by the
user. | protected int | getListItemsSize(Object treeElement) Return a count of the number of list items associated with a
given tree item. | public Table | getListTable() Get the table the list viewer uses. | protected void | grayCheckHierarchy(Object treeElement) | public void | initialCheckListItem(Object element) Set the initial checked state of the passed list element to true. | public void | initialCheckTreeItem(Object element) | protected void | initialize() Initialize this group's viewers after they have been laid out. | protected void | listItemChecked(Object listElement, boolean state, boolean updatingFromSelection) Callback that's invoked when the checked status of an item in the list
is changed by the user. | protected void | notifyCheckStateChangeListeners(CheckStateChangedEvent event) | protected void | populateListViewer(Object treeElement) Set the contents of the list viewer based upon the specified selected
tree element. | public void | removeCheckStateListener(ICheckStateListener listener) | public void | selectionChanged(SelectionChangedEvent event) | public void | setAllSelections(boolean selection) Select or deselect all of the elements in the tree depending on the value of the selection
boolean. | public void | setListComparator(ViewerComparator comparator) | public void | setListProviders(IStructuredContentProvider contentProvider, ILabelProvider labelProvider) | public void | setRoot(Object newRoot) Set the root of the widget to be new Root. | protected void | setTreeChecked(Object treeElement, boolean state) | public void | setTreeComparator(ViewerComparator comparator) | public void | setTreeProviders(ITreeContentProvider contentProvider, ILabelProvider labelProvider) | protected void | setWhiteChecked(Object treeElement, boolean isWhiteChecked) Adjust the collection of references to white-checked tree elements appropriately. | public void | treeCollapsed(TreeExpansionEvent event) | public void | treeExpanded(TreeExpansionEvent event) | protected void | treeItemChecked(Object treeElement, boolean state) Callback that's invoked when the checked status of an item in the tree
is changed by the user. | protected void | ungrayCheckHierarchy(Object treeElement) Logically un-gray-check all ancestors of treeItem iff appropriate. | protected void | updateHierarchy(Object treeElement) | public void | updateSelections(Map items) Update the selections of the tree elements in items to reflect the new
selections provided. |
CheckboxTreeAndListGroup | public CheckboxTreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height)(Code) | | Create an instance of this class. Use this constructor if you wish to specify
the width and/or height of the combined widget (to only hardcode one of the
sizing dimensions, specify the other dimension's value as -1)
Parameters: parent - Parameters: rootObject - Parameters: treeContentProvider - Parameters: treeLabelProvider - Parameters: listContentProvider - Parameters: listLabelProvider - Parameters: style - Parameters: width - Parameters: height - |
aboutToOpen | public void aboutToOpen()(Code) | | This method must be called just before this window becomes visible.
|
addCheckStateListener | public void addCheckStateListener(ICheckStateListener listener)(Code) | | Add the passed listener to self's collection of clients
that listen for changes to element checked states
Parameters: listener - ICheckStateListener |
areAllChildrenWhiteChecked | protected boolean areAllChildrenWhiteChecked(Object treeElement)(Code) | | Return a boolean indicating whether all children of the passed tree element
are currently white-checked
boolean Parameters: treeElement - java.lang.Object |
areAllElementsChecked | protected boolean areAllElementsChecked(Object treeElement)(Code) | | Return a boolean indicating whether all list elements associated with
the passed tree element are currently checked
boolean Parameters: treeElement - java.lang.Object |
checkNewTreeElements | protected void checkNewTreeElements(Object[] elements)(Code) | | Iterate through the passed elements which are being realized for the first
time and check each one in the tree viewer as appropriate
|
checkStateChanged | public void checkStateChanged(CheckStateChangedEvent event)(Code) | | An item was checked in one of self's two views. Determine which
view this occurred in and delegate appropriately
Parameters: event - CheckStateChangedEvent |
createContents | protected void createContents(Composite parent, int width, int height, int style)(Code) | | Lay out and initialize self's visual components.
Parameters: parent - org.eclipse.swt.widgets.Composite Parameters: width - int Parameters: height - int |
createListViewer | protected void createListViewer(Composite parent, int width, int height)(Code) | | Create this group's list viewer.
|
createTreeViewer | protected void createTreeViewer(Composite parent, int width, int height)(Code) | | Create this group's tree viewer.
|
determineShouldBeAtLeastGrayChecked | protected boolean determineShouldBeAtLeastGrayChecked(Object treeElement)(Code) | | Returns a boolean indicating whether the passed tree element should be
at LEAST gray-checked. Note that this method does not consider whether
it should be white-checked, so a specified tree item which should be
white-checked will result in a true answer from this method.
To determine whether a tree item should be white-checked use method
#determineShouldBeWhiteChecked(Object).
Parameters: treeElement - java.lang.Object boolean See Also: CheckboxTreeAndListGroup.determineShouldBeWhiteChecked(java.lang.Object) |
determineShouldBeWhiteChecked | protected boolean determineShouldBeWhiteChecked(Object treeElement)(Code) | | Returns a boolean indicating whether the passed tree item should be
white-checked.
boolean Parameters: treeElement - java.lang.Object |
determineWhiteCheckedDescendents | protected void determineWhiteCheckedDescendents(Object treeElement)(Code) | | Recursively add appropriate tree elements to the collection of
known white-checked tree elements.
Parameters: treeElement - java.lang.Object |
expandAll | public void expandAll()(Code) | | Cause the tree viewer to expand all its items
|
getAllCheckedListItems | public Iterator getAllCheckedListItems()(Code) | | Answer a flat collection of all of the checked elements in the
list portion of self
java.util.Vector |
getAllCheckedTreeItems | public Set getAllCheckedTreeItems()(Code) | | Answer a collection of all of the checked elements in the tree portion
of self
java.util.Vector |
getCheckedElementCount | public int getCheckedElementCount()(Code) | | Answer the number of elements that have been checked by the
user.
int |
getListItemsSize | protected int getListItemsSize(Object treeElement)(Code) | | Return a count of the number of list items associated with a
given tree item.
int Parameters: treeElement - java.lang.Object |
getListTable | public Table getListTable()(Code) | | Get the table the list viewer uses.
org.eclipse.swt.widgets.Table |
grayCheckHierarchy | protected void grayCheckHierarchy(Object treeElement)(Code) | | Logically gray-check all ancestors of treeItem by ensuring that they
appear in the checked table
|
initialCheckListItem | public void initialCheckListItem(Object element)(Code) | | Set the initial checked state of the passed list element to true.
Parameters: element - the element in the list to select |
initialCheckTreeItem | public void initialCheckTreeItem(Object element)(Code) | | Set the initial checked state of the passed element to true,
as well as to all of its children and associated list elements
Parameters: element - the element in the tree to select |
initialize | protected void initialize()(Code) | | Initialize this group's viewers after they have been laid out.
|
listItemChecked | protected void listItemChecked(Object listElement, boolean state, boolean updatingFromSelection)(Code) | | Callback that's invoked when the checked status of an item in the list
is changed by the user. Do not try and update the hierarchy if we are building the
initial list.
|
notifyCheckStateChangeListeners | protected void notifyCheckStateChangeListeners(CheckStateChangedEvent event)(Code) | | Notify all checked state listeners that the passed element has had
its checked state changed to the passed state
|
populateListViewer | protected void populateListViewer(Object treeElement)(Code) | | Set the contents of the list viewer based upon the specified selected
tree element. This also includes checking the appropriate list items.
Parameters: treeElement - java.lang.Object |
removeCheckStateListener | public void removeCheckStateListener(ICheckStateListener listener)(Code) | | Remove the passed listener from self's collection of clients
that listen for changes to element checked states
Parameters: listener - ICheckStateListener |
selectionChanged | public void selectionChanged(SelectionChangedEvent event)(Code) | | Handle the selection of an item in the tree viewer
Parameters: event - SelectionChangedEvent |
setAllSelections | public void setAllSelections(boolean selection)(Code) | | Select or deselect all of the elements in the tree depending on the value of the selection
boolean. Be sure to update the displayed files as well.
Parameters: selection - boolean indicating whether or not to select all elements |
setListComparator | public void setListComparator(ViewerComparator comparator)(Code) | | Set the comparator that is to be applied to self's list viewer
Parameters: comparator - the comparator for the list viewer |
setListProviders | public void setListProviders(IStructuredContentProvider contentProvider, ILabelProvider labelProvider)(Code) | | Set the list viewer's providers to those passed
Parameters: contentProvider - ITreeContentProvider Parameters: labelProvider - ILabelProvider |
setRoot | public void setRoot(Object newRoot)(Code) | | Set the root of the widget to be new Root. Regenerate all of the tables and lists from this
value.
Parameters: newRoot - |
setTreeChecked | protected void setTreeChecked(Object treeElement, boolean state)(Code) | | Set the checked state of the passed tree element appropriately, and
do so recursively to all of its child tree elements as well
|
setTreeComparator | public void setTreeComparator(ViewerComparator comparator)(Code) | | Set the comparator that is to be applied to self's tree viewer
Parameters: comparator - the comparator for the tree |
setTreeProviders | public void setTreeProviders(ITreeContentProvider contentProvider, ILabelProvider labelProvider)(Code) | | Set the tree viewer's providers to those passed
Parameters: contentProvider - ITreeContentProvider Parameters: labelProvider - ILabelProvider |
setWhiteChecked | protected void setWhiteChecked(Object treeElement, boolean isWhiteChecked)(Code) | | Adjust the collection of references to white-checked tree elements appropriately.
Parameters: treeElement - java.lang.Object Parameters: isWhiteChecked - boolean |
treeCollapsed | public void treeCollapsed(TreeExpansionEvent event)(Code) | | Handle the collapsing of an element in a tree viewer
|
treeExpanded | public void treeExpanded(TreeExpansionEvent event)(Code) | | Handle the expansionsion of an element in a tree viewer
|
treeItemChecked | protected void treeItemChecked(Object treeElement, boolean state)(Code) | | Callback that's invoked when the checked status of an item in the tree
is changed by the user.
|
ungrayCheckHierarchy | protected void ungrayCheckHierarchy(Object treeElement)(Code) | | Logically un-gray-check all ancestors of treeItem iff appropriate.
|
updateHierarchy | protected void updateHierarchy(Object treeElement)(Code) | | Set the checked state of self and all ancestors appropriately
|
updateSelections | public void updateSelections(Map items)(Code) | | Update the selections of the tree elements in items to reflect the new
selections provided.
Parameters: items - Map with keys of Object (the tree element) and values of List (the selectedlist elements). |
|
|