public class ActivitiesCheckboxTreeWrapper
extends java.lang.Object
CheckboxTreeViewer
to provide an activities specific checkbox
tree control.Constructor and Description |
---|
ActivitiesCheckboxTreeWrapper(org.eclipse.jface.viewers.CheckboxTreeViewer checkboxTreeViewer)
Initializes the check box tree viewer with activities data
|
Modifier and Type | Method and Description |
---|---|
void |
addCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
Add the given listener to the list of listeners
|
protected void |
fireCheckStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent event)
Notifies any check state listeners that the check state of an element has
changed.
|
org.eclipse.jface.viewers.CheckboxTreeViewer |
getCheckboxTreeViewer()
Return the wrapped
CheckboxTreeViewer . |
java.util.Set<java.lang.String> |
getCheckedActivityIds()
Returns the set of activity ids that are checked in the activity tree
control
|
java.util.Set<java.lang.String> |
getRequiredActivityIds()
Returns the set of required activity ids.
|
java.lang.Object |
getSelectedElement()
Returns the first element selected in the tree control.
|
java.util.Set<java.lang.String> |
getUncheckedActivityIds()
Returns the list of activity ids that are unchecked in the activity tree
control
|
void |
linkDescriptionText(org.eclipse.swt.widgets.Text descriptionText)
Adds a
ISelectionChangedListener to checkbox tree viewer
in order to update the given description text with the name of the selected
IActivity or ICategory . |
void |
refresh()
Refresh the tree viewer.
|
void |
refresh(boolean showActivitiesArg)
Refresh the tree viewer.
|
void |
removeCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
Remove the given listener to the list of listeners
|
void |
restoreDefaults()
Restore the activities back to their default state.
|
void |
setAllChecked(boolean state)
Set all elements to the given state.
|
void |
setEditable(boolean editable)
Set the tree viewer to be editable or not.
|
void |
setEnabled(boolean enabled)
Set the enablement of the tree viewer to the given state.
|
void |
setPrecheckedActivityIds(java.util.Set<java.lang.String> activityIds)
Sets the Set of prechecked activity ids to the provided activityIds
|
void |
setRequiredActivityIds(java.util.Set<java.lang.String> activityIds)
Sets the Set of required activity ids to the provided activityIds.
|
public ActivitiesCheckboxTreeWrapper(org.eclipse.jface.viewers.CheckboxTreeViewer checkboxTreeViewer)
checkboxTreeViewer
- the underlying checkbox tree viewerpublic org.eclipse.jface.viewers.CheckboxTreeViewer getCheckboxTreeViewer()
CheckboxTreeViewer
.CheckboxTreeViewer
public java.lang.Object getSelectedElement()
public java.util.Set<java.lang.String> getCheckedActivityIds()
public java.util.Set<java.lang.String> getRequiredActivityIds()
public java.util.Set<java.lang.String> getUncheckedActivityIds()
public void refresh()
public void refresh(boolean showActivitiesArg)
showActivitiesArg
- true
if the tree viewer should
display the activities, false
if the tree viewer
should be emptypublic void setRequiredActivityIds(java.util.Set<java.lang.String> activityIds)
activityIds
- public void setPrecheckedActivityIds(java.util.Set<java.lang.String> activityIds)
activityIds
- public void restoreDefaults()
public void addCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
listener
- listener to addpublic void removeCheckStateListener(org.eclipse.jface.viewers.ICheckStateListener listener)
listener
- listener to removeprotected void fireCheckStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent event)
event
- a check state changed eventICheckStateListener.checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
public void setEnabled(boolean enabled)
enabled
- public void setEditable(boolean editable)
editable
- public void setAllChecked(boolean state)
state
- public void linkDescriptionText(org.eclipse.swt.widgets.Text descriptionText)
ISelectionChangedListener
to checkbox tree viewer
in order to update the given description text with the name of the selected
IActivity
or ICategory
.