Search in sources :

Example 1 with IContextElementProvider

use of org.yakindu.sct.model.sgraph.util.ContextElementAdapter.IContextElementProvider in project statecharts by Yakindu.

the class SCTResourceTest method setUp.

@Before
public void setUp() throws Exception {
    Injector injector = STextActivator.getInstance().getInjector(STextActivator.ORG_YAKINDU_SCT_MODEL_STEXT_STEXT);
    ResourceSet resourceSet = new ResourceSetImpl();
    res = new StextResource(URI.createURI("test.test"));
    res.eAdapters().add(new ContextElementAdapter(new IContextElementProvider() {

        public EObject getContextObject() {
            return res.getContents().get(0);
        }
    }));
    resourceSet.getResources().add(res);
    injector.injectMembers(res);
}
Also used : ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) StextResource(org.yakindu.sct.model.stext.resource.StextResource) Injector(com.google.inject.Injector) IContextElementProvider(org.yakindu.sct.model.sgraph.util.ContextElementAdapter.IContextElementProvider) ContextElementAdapter(org.yakindu.sct.model.sgraph.util.ContextElementAdapter) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) Before(org.junit.Before)

Aggregations

Injector (com.google.inject.Injector)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)1 Before (org.junit.Before)1 ContextElementAdapter (org.yakindu.sct.model.sgraph.util.ContextElementAdapter)1 IContextElementProvider (org.yakindu.sct.model.sgraph.util.ContextElementAdapter.IContextElementProvider)1 StextResource (org.yakindu.sct.model.stext.resource.StextResource)1