Search in sources :

Example 1 with ISetup

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());
}
Also used : ISetup(org.eclipse.xtext.ISetup)

Example 2 with ISetup

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();
}
Also used : Injector(com.google.inject.Injector) ISetup(org.eclipse.xtext.ISetup) Model(org.eclipse.xtext.ui.tests.editor.outline.outlineTest.Model) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) OutlineFilterAndSorter(org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter) EObjectNode(org.eclipse.xtext.ui.editor.outline.impl.EObjectNode)

Example 3 with ISetup

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();
}
Also used : IOutlineNodeComparer(org.eclipse.xtext.ui.editor.outline.impl.IOutlineNodeComparer) Injector(com.google.inject.Injector) ISetup(org.eclipse.xtext.ISetup)

Example 4 with ISetup

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);
}
Also used : Injector(com.google.inject.Injector) ISetup(org.eclipse.xtext.ISetup)

Example 5 with ISetup

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());
}
Also used : ISetup(org.eclipse.xtext.ISetup)

Aggregations

ISetup (org.eclipse.xtext.ISetup)7 Injector (com.google.inject.Injector)5 Model (org.eclipse.xtext.ui.tests.editor.outline.outlineTest.Model)2 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)1 DefaultLocationInFileProvider (org.eclipse.xtext.resource.DefaultLocationInFileProvider)1 DefaultOutlineTreeProvider (org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider)1 EObjectNode (org.eclipse.xtext.ui.editor.outline.impl.EObjectNode)1 IOutlineNodeComparer (org.eclipse.xtext.ui.editor.outline.impl.IOutlineNodeComparer)1 OutlineFilterAndSorter (org.eclipse.xtext.ui.editor.outline.impl.OutlineFilterAndSorter)1 DefaultEObjectLabelProvider (org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider)1