use of org.eclipse.xtext.ISetup in project xtext-eclipse by eclipse.
the class AbstractXtextTests method with.
protected void with(Class<? extends ISetup> setupClazz) throws Exception {
assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector);
ISetup instance = setupClazz.newInstance();
setInjector(instance.createInjectorAndDoEMFRegistration());
}
use of org.eclipse.xtext.ISetup in project xtext-eclipse by eclipse.
the class OutlineFilterAndSorterTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Injector injector = TestsActivator.getInstance().getInjector("org.eclipse.xtext.ui.tests.editor.outline.OutlineTestLanguage");
with(new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return injector;
}
});
Model model = OutlineTestFactory.eINSTANCE.createModel();
nodes = Lists.newArrayList();
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "one", true));
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "two", true));
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "three", true));
filterAndSorter = new OutlineFilterAndSorter();
}
use of org.eclipse.xtext.ISetup in project xtext-eclipse by eclipse.
the class OutlineNodeComparerTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Injector injector = TestsActivator.getInstance().getInjector("org.eclipse.xtext.ui.tests.editor.outline.OutlineTestLanguage");
with(new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return injector;
}
});
comparer = new IOutlineNodeComparer.Default();
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
image2 = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
eObject = OutlineTestFactory.eINSTANCE.createModel();
}
use of org.eclipse.xtext.ISetup in project xtext-eclipse by eclipse.
the class XtextOutlineTreeProviderTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Injector injector = Activator.getDefault().getInjector("org.eclipse.xtext.Xtext");
with(new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return injector;
}
});
treeProvider = get(XtextOutlineTreeProvider.class);
setShowInherited(false);
}
use of org.eclipse.xtext.ISetup in project xtext-core by eclipse.
the class AbstractXtextTests method with.
protected void with(Class<? extends ISetup> setupClazz) throws Exception {
assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector);
ISetup instance = setupClazz.newInstance();
setInjector(instance.createInjectorAndDoEMFRegistration());
}
Aggregations