|
SAM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.topcased.modeler.sam.dialogs.CheckboxTreeAndListGroup
public class CheckboxTreeAndListGroup
Workbench-level composite that combines a CheckboxTreeViewer and CheckboxListViewer. All viewer selection-driven interactions are handled within this object
Constructor Summary | |
---|---|
CheckboxTreeAndListGroup(org.eclipse.swt.widgets.Composite parent,
java.lang.Object rootObject,
org.eclipse.jface.viewers.ITreeContentProvider treeContentProvider,
org.eclipse.jface.viewers.ILabelProvider treeLabelProvider,
org.eclipse.jface.viewers.IStructuredContentProvider listContentProvider,
org.eclipse.jface.viewers.ILabelProvider listLabelProvider,
int style,
int width,
int height)
Create an instance of this class. |
Method Summary | |
---|---|
void |
aboutToOpen()
This method must be called just before this window becomes visible. |
void |
addCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
Add the passed listener to self's collection of clients that listen for changes to element checked states |
protected boolean |
areAllChildrenWhiteChecked(java.lang.Object treeElement)
Return a boolean indicating whether all children of the passed tree element are currently white-checked |
protected boolean |
areAllElementsChecked(java.lang.Object treeElement)
Return a boolean indicating whether all list elements associated with the passed tree element are currently checked |
protected void |
checkNewTreeElements(java.lang.Object[] elements)
Iterate through the passed elements which are being realized for the first time and check each one in the tree viewer as appropriate |
void |
checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent event)
An item was checked in one of self's two views. |
protected void |
createContents(org.eclipse.swt.widgets.Composite parent,
int width,
int height,
int style)
Lay out and initialize self's visual components. |
protected void |
createListViewer(org.eclipse.swt.widgets.Composite parent,
int width,
int height)
Create this group's list viewer. |
protected void |
createTreeViewer(org.eclipse.swt.widgets.Composite parent,
int width,
int height)
Create this group's tree viewer. |
protected boolean |
determineShouldBeAtLeastGrayChecked(java.lang.Object treeElement)
Returns a boolean indicating whether the passed tree element should be at LEAST gray-checked. |
protected boolean |
determineShouldBeWhiteChecked(java.lang.Object treeElement)
Returns a boolean indicating whether the passed tree item should be white-checked. |
protected void |
determineWhiteCheckedDescendents(java.lang.Object treeElement)
Recursively add appropriate tree elements to the collection of known white-checked tree elements. |
void |
expandAll()
Cause the tree viewer to expand all its items |
java.util.Iterator |
getAllCheckedListItems()
Answer a flat collection of all of the checked elements in the list portion of self |
java.util.Set |
getAllCheckedTreeItems()
Answer a collection of all of the checked elements in the tree portion of self |
int |
getCheckedElementCount()
Answer the number of elements that have been checked by the user. |
protected int |
getListItemsSize(java.lang.Object treeElement)
Return a count of the number of list items associated with a given tree item. |
org.eclipse.swt.widgets.Table |
getListTable()
Get the table the list viewer uses. |
protected void |
grayCheckHierarchy(java.lang.Object treeElement)
Logically gray-check all ancestors of treeItem by ensuring that they appear in the checked table |
void |
initialCheckListItem(java.lang.Object element)
Set the initial checked state of the passed list element to true. |
void |
initialCheckTreeItem(java.lang.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 |
protected void |
initialize()
Initialize this group's viewers after they have been laid out. |
protected void |
listItemChecked(java.lang.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(org.eclipse.jface.viewers.CheckStateChangedEvent event)
Notify all checked state listeners that the passed element has had its checked state changed to the passed state |
protected void |
populateListViewer(java.lang.Object treeElement)
Set the contents of the list viewer based upon the specified selected tree element. |
void |
removeCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
Remove the passed listener from self's collection of clients that listen for changes to element checked states |
void |
selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Handle the selection of an item in the tree viewer |
void |
setAllSelections(boolean selection)
Select or deselect all of the elements in the tree depending on the value of the selection boolean. |
void |
setListComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Set the comparator that is to be applied to self's list viewer |
void |
setListProviders(org.eclipse.jface.viewers.IStructuredContentProvider contentProvider,
org.eclipse.jface.viewers.ILabelProvider labelProvider)
Set the list viewer's providers to those passed |
void |
setRoot(java.lang.Object newRoot)
Set the root of the widget to be new Root. |
protected void |
setTreeChecked(java.lang.Object treeElement,
boolean state)
Set the checked state of the passed tree element appropriately, and do so recursively to all of its child tree elements as well |
void |
setTreeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Set the comparator that is to be applied to self's tree viewer |
void |
setTreeProviders(org.eclipse.jface.viewers.ITreeContentProvider contentProvider,
org.eclipse.jface.viewers.ILabelProvider labelProvider)
Set the tree viewer's providers to those passed |
protected void |
setWhiteChecked(java.lang.Object treeElement,
boolean isWhiteChecked)
Adjust the collection of references to white-checked tree elements appropriately. |
void |
treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent event)
Handle the collapsing of an element in a tree viewer |
void |
treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent event)
Handle the expansionsion of an element in a tree viewer |
protected void |
treeItemChecked(java.lang.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(java.lang.Object treeElement)
Logically un-gray-check all ancestors of treeItem iff appropriate. |
protected void |
updateHierarchy(java.lang.Object treeElement)
Set the checked state of self and all ancestors appropriately |
void |
updateSelections(java.util.Map items)
Update the selections of the tree elements in items to reflect the new selections provided. |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckboxTreeAndListGroup(org.eclipse.swt.widgets.Composite parent, java.lang.Object rootObject, org.eclipse.jface.viewers.ITreeContentProvider treeContentProvider, org.eclipse.jface.viewers.ILabelProvider treeLabelProvider, org.eclipse.jface.viewers.IStructuredContentProvider listContentProvider, org.eclipse.jface.viewers.ILabelProvider listLabelProvider, int style, int width, int height)
parent
- rootObject
- treeContentProvider
- treeLabelProvider
- listContentProvider
- listLabelProvider
- style
- width
- height
- Method Detail |
---|
public void aboutToOpen()
public void addCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
listener
- ICheckStateListenerprotected boolean areAllChildrenWhiteChecked(java.lang.Object treeElement)
treeElement
- java.lang.Object
protected boolean areAllElementsChecked(java.lang.Object treeElement)
treeElement
- java.lang.Object
protected void checkNewTreeElements(java.lang.Object[] elements)
public void checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent event)
checkStateChanged
in interface org.eclipse.jface.viewers.ICheckStateListener
event
- CheckStateChangedEventprotected void createContents(org.eclipse.swt.widgets.Composite parent, int width, int height, int style)
parent
- org.eclipse.swt.widgets.Compositewidth
- intheight
- intprotected void createListViewer(org.eclipse.swt.widgets.Composite parent, int width, int height)
protected void createTreeViewer(org.eclipse.swt.widgets.Composite parent, int width, int height)
protected boolean determineShouldBeAtLeastGrayChecked(java.lang.Object treeElement)
true
answer from this
method. To determine whether a tree item should be white-checked use
method #determineShouldBeWhiteChecked(Object).
treeElement
- java.lang.Object
determineShouldBeWhiteChecked(java.lang.Object)
protected boolean determineShouldBeWhiteChecked(java.lang.Object treeElement)
treeElement
- java.lang.Object
protected void determineWhiteCheckedDescendents(java.lang.Object treeElement)
treeElement
- java.lang.Objectpublic void expandAll()
public java.util.Iterator getAllCheckedListItems()
public java.util.Set getAllCheckedTreeItems()
public int getCheckedElementCount()
protected int getListItemsSize(java.lang.Object treeElement)
treeElement
- java.lang.Object
public org.eclipse.swt.widgets.Table getListTable()
protected void grayCheckHierarchy(java.lang.Object treeElement)
public void initialCheckListItem(java.lang.Object element)
element
- the element in the list to selectpublic void initialCheckTreeItem(java.lang.Object element)
element
- the element in the tree to selectprotected void initialize()
protected void listItemChecked(java.lang.Object listElement, boolean state, boolean updatingFromSelection)
protected void notifyCheckStateChangeListeners(org.eclipse.jface.viewers.CheckStateChangedEvent event)
protected void populateListViewer(java.lang.Object treeElement)
treeElement
- java.lang.Objectpublic void removeCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
listener
- ICheckStateListenerpublic void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
selectionChanged
in interface org.eclipse.jface.viewers.ISelectionChangedListener
event
- SelectionChangedEventpublic void setAllSelections(boolean selection)
selection
- boolean indicating whether or not to select all elementspublic void setListProviders(org.eclipse.jface.viewers.IStructuredContentProvider contentProvider, org.eclipse.jface.viewers.ILabelProvider labelProvider)
contentProvider
- ITreeContentProviderlabelProvider
- ILabelProviderpublic void setListComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
comparator
- the comparator for the list viewerpublic void setRoot(java.lang.Object newRoot)
newRoot
- protected void setTreeChecked(java.lang.Object treeElement, boolean state)
public void setTreeProviders(org.eclipse.jface.viewers.ITreeContentProvider contentProvider, org.eclipse.jface.viewers.ILabelProvider labelProvider)
contentProvider
- ITreeContentProviderlabelProvider
- ILabelProviderpublic void setTreeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
comparator
- the comparator for the treeprotected void setWhiteChecked(java.lang.Object treeElement, boolean isWhiteChecked)
treeElement
- java.lang.ObjectisWhiteChecked
- booleanpublic void treeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent event)
treeCollapsed
in interface org.eclipse.jface.viewers.ITreeViewerListener
public void treeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent event)
treeExpanded
in interface org.eclipse.jface.viewers.ITreeViewerListener
protected void treeItemChecked(java.lang.Object treeElement, boolean state)
protected void ungrayCheckHierarchy(java.lang.Object treeElement)
protected void updateHierarchy(java.lang.Object treeElement)
public void updateSelections(java.util.Map items)
items
- Map with keys of Object (the tree element) and values of
List (the selected list elements).
|
SAM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.