Search in sources :

Example 1 with DocumentedElement

use of org.yakindu.base.base.DocumentedElement in project statecharts by Yakindu.

the class STextTaskFinder method findTasks.

public List<Task> findTasks(StextResource resource) {
    TaskTags taskTags = taskTagProvider.getTaskTags(resource);
    List<Task> result = Lists.newArrayList();
    TreeIterator<EObject> allContents = resource.getAllContents();
    while (allContents.hasNext()) {
        EObject eObject = (EObject) allContents.next();
        if (eObject instanceof SpecificationElement) {
            List<Task> parseTasks = parseTasks(eObject, SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION, taskTags);
            result.addAll(parseTasks);
        }
        if (eObject instanceof DocumentedElement) {
            result.addAll(parseTasks(eObject, BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION, taskTags));
        }
    }
    return result;
}
Also used : DocumentedElement(org.yakindu.base.base.DocumentedElement) SCTTask(org.yakindu.sct.model.stext.tasks.SCTTask) Task(org.eclipse.xtext.tasks.Task) SpecificationElement(org.yakindu.sct.model.sgraph.SpecificationElement) EObject(org.eclipse.emf.ecore.EObject) TaskTags(org.eclipse.xtext.tasks.TaskTags)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 Task (org.eclipse.xtext.tasks.Task)1 TaskTags (org.eclipse.xtext.tasks.TaskTags)1 DocumentedElement (org.yakindu.base.base.DocumentedElement)1 SpecificationElement (org.yakindu.sct.model.sgraph.SpecificationElement)1 SCTTask (org.yakindu.sct.model.stext.tasks.SCTTask)1