* Find the most recent ancestor of this task that is completed
* @param task
* @return A completed task or null if no ancestors are completed
*/
public static ICompositeCheatSheetTask findCompletedAncestor(ICompositeCheatSheetTask task) {
ITaskGroup parent = ((AbstractTask)task).getParent();
if (parent == null) {
return null;
}
if (parent.getState() == ICompositeCheatSheetTask.COMPLETED) {
return parent;
}
return findCompletedAncestor(parent);
}