use of org.yakindu.sct.domain.extension.IDomain in project statecharts by Yakindu.
the class SimulationView method updateTypeSystem.
private void updateTypeSystem(final IDebugTarget debugTarget) {
IDomain domain = DomainRegistry.getDomain((EObject) debugTarget.getAdapter(EObject.class));
typeSystem = domain.getInjector(IDomain.FEATURE_SIMULATION).getInstance(ITypeSystem.class);
}
use of org.yakindu.sct.domain.extension.IDomain in project statecharts by Yakindu.
the class PlugableExternalXtextLabelEditPart method init.
private void init(String target) {
IDomain domain = DomainRegistry.getDomain(resolveSemanticElement());
injector = domain.getInjector(IDomain.FEATURE_EDITOR, target);
}
use of org.yakindu.sct.domain.extension.IDomain 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();
}
use of org.yakindu.sct.domain.extension.IDomain in project statecharts by Yakindu.
the class StextResourceFactory method createResource.
@Override
public Resource createResource(URI uri) {
String domainID = DomainRegistry.determineDomainID(uri);
if (domainID == null || DomainRegistry.getDomain(domainID) == null) {
return new XMIResourceImpl(uri);
}
IDomain domain = DomainRegistry.getDomain(domainID);
Injector injector = getInjector(domain);
Resource resource = injector.getInstance(Resource.class);
ResourceSet set = new ResourceSetImpl();
set.getResources().add(resource);
resource.setURI(uri);
return resource;
}
use of org.yakindu.sct.domain.extension.IDomain in project statecharts by Yakindu.
the class StatechartPropertySection method bindDomainCombo.
protected void bindDomainCombo(EMFDataBindingContext context) {
IEMFValueProperty property = EMFEditProperties.value(TransactionUtil.getEditingDomain(eObject), BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID);
IViewerObservableValue observeSingleSelection = ViewersObservables.observeSingleSelection(domainCombo);
UpdateValueStrategy modelToTarget = new UpdateValueStrategy() {
@Override
public Object convert(Object value) {
return ((IDomain) value).getDomainID();
}
};
UpdateValueStrategy targetToModel = new UpdateValueStrategy() {
@Override
public Object convert(Object value) {
return DomainRegistry.getDomain((String) value);
}
};
context.bindValue(observeSingleSelection, property.observe(eObject), modelToTarget, targetToModel);
}
Aggregations