Search in sources :

Example 1 with ITaskFinder

use of org.eclipse.xtext.tasks.ITaskFinder in project statecharts by Yakindu.

the class DomainSpecificTaskFinder method findTasks.

@Override
public List<Task> findTasks(Resource resource) {
    if (resource instanceof AbstractSCTResource) {
        IDomain domain = DomainRegistry.getDomain((EObject) EcoreUtil2.getObjectByType(resource.getContents(), SGraphPackage.Literals.STATECHART));
        ITaskFinder taskFinder = domain.getInjector(IDomain.FEATURE_RESOURCE).getInstance(ITaskFinder.class);
        if (taskFinder != null)
            return taskFinder.findTasks(resource);
    }
    return Collections.emptyList();
}
Also used : IDomain(org.yakindu.sct.domain.extension.IDomain) AbstractSCTResource(org.yakindu.sct.model.sgraph.resource.AbstractSCTResource) ITaskFinder(org.eclipse.xtext.tasks.ITaskFinder)

Aggregations

ITaskFinder (org.eclipse.xtext.tasks.ITaskFinder)1 IDomain (org.yakindu.sct.domain.extension.IDomain)1 AbstractSCTResource (org.yakindu.sct.model.sgraph.resource.AbstractSCTResource)1