Java Code Examples for org.eclipse.xtext.ui.util.PluginProjectFactory#addRequiredBundles()
The following examples show how to use
org.eclipse.xtext.ui.util.PluginProjectFactory#addRequiredBundles() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XtextContentAssistTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Before public void doSetupProject() throws Exception{ if(project == null){ with(doGetSetup()); PluginProjectFactory projectFactory = getInjector().getInstance(PluginProjectFactory.class); projectFactory.setProjectName(TEST_PROJECT); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds(XtextProjectHelper.BUILDER_ID, JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder"); projectFactory.addProjectNatures( XtextProjectHelper.NATURE_ID, JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature"); projectFactory.addRequiredBundles(Lists.newArrayList("org.eclipse.xtext")); project = projectFactory.createProject(new NullProgressMonitor(), null); get(SyncUtil.class).waitForBuild(new NullProgressMonitor()); } }
Example 2
Source File: DisabledBuilderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
private IProject createPluginProject(String name, boolean addBuilder, String dependency) throws CoreException { PluginProjectFactory projectFactory = projectFactoryProvider.get(); projectFactory.setProjectName(name); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds(JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder"); if (addBuilder) { projectFactory.addBuilderIds(XtextProjectHelper.BUILDER_ID); } projectFactory.addProjectNatures(JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID); projectFactory.addRequiredBundles(Collections.singletonList("org.eclipse.emf.ecore")); if(dependency != null) projectFactory.addRequiredBundles(Collections.singletonList(dependency)); IProject result = projectFactory.createProject(new NullProgressMonitor(), null); return result; }
Example 3
Source File: AbstractXbaseUITestCase.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
public static IProject createPluginProject(String name) throws CoreException { Injector injector = XbaseActivator.getInstance().getInjector("org.eclipse.xtext.xbase.Xbase"); PluginProjectFactory projectFactory = injector.getInstance(PluginProjectFactory.class); projectFactory.setProjectName(name); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds( JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder", XtextProjectHelper.BUILDER_ID); projectFactory.addProjectNatures(JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID); projectFactory.addRequiredBundles(Collections.singletonList("org.eclipse.xtext.xbase.lib")); IProject result = projectFactory.createProject(new NullProgressMonitor(), null); JavaProjectSetupUtil.makeJava8Compliant(JavaCore.create(result)); JavaProjectSetupUtil.setUnixLineEndings(result); return result; }
Example 4
Source File: WorkbenchTestHelper.java From xtext-xtend with Eclipse Public License 2.0 | 6 votes |
public static IProject createPluginProject(String name, JavaVersion javaVersion, String... requiredBundles) throws CoreException { Injector injector = XtendActivator.getInstance().getInjector(XtendActivator.ORG_ECLIPSE_XTEND_CORE_XTEND); PluginProjectFactory projectFactory = injector.getInstance(PluginProjectFactory.class); projectFactory.setProjectName(name); projectFactory.setProjectDefaultCharset(StandardCharsets.ISO_8859_1.name()); projectFactory.setBreeToUse(getBree(javaVersion)); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds(XtextProjectHelper.BUILDER_ID, JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder"); projectFactory.addProjectNatures( XtextProjectHelper.NATURE_ID, JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature"); projectFactory.addRequiredBundles(newArrayList(requiredBundles)); IProject result = projectFactory.createProject(new NullProgressMonitor(), null); IJavaProject javaProject = JavaCore.create(result); if (javaVersion == null) JavaProjectSetupUtil.makeJava8Compliant(javaProject); else makeCompliantFor(javaProject, javaVersion); JavaProjectSetupUtil.addJreClasspathEntry(javaProject); return result; }
Example 5
Source File: ContentAssistTest.java From xtext-xtend with Eclipse Public License 2.0 | 6 votes |
public static IProject createPluginProject(String name) throws CoreException { Injector injector = XtendActivator.getInstance().getInjector("org.eclipse.xtend.core.Xtend"); PluginProjectFactory projectFactory = injector.getInstance(PluginProjectFactory.class); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.setProjectName(name); projectFactory.setProjectDefaultCharset(StandardCharsets.ISO_8859_1.name()); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds( JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder", XtextProjectHelper.BUILDER_ID); projectFactory.addProjectNatures(JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID); projectFactory.addRequiredBundles(Lists.newArrayList( "org.eclipse.xtext.xbase.lib", "org.eclipse.xtend.lib")); IProject result = projectFactory.createProject(new NullProgressMonitor(), null); JavaProjectSetupUtil.makeJava8Compliant(JavaCore.create(result)); return result; }
Example 6
Source File: SameClassNamesTest.java From xtext-xtend with Eclipse Public License 2.0 | 6 votes |
public IProject createPluginProject(final String name, final String... requiredBundles) throws CoreException { final PluginProjectFactory projectFactory = this.projectFactoryProvider.get(); projectFactory.setProjectName(name); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.addFolders(Collections.<String>singletonList("src")); projectFactory.addBuilderIds( XtextProjectHelper.BUILDER_ID, JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder"); projectFactory.addProjectNatures( XtextProjectHelper.NATURE_ID, JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature"); projectFactory.addRequiredBundles(((List<String>)Conversions.doWrapArray(requiredBundles))); projectFactory.addExportedPackages(Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("com.acme"))); NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor(); final IProject result = projectFactory.createProject(_nullProgressMonitor, null); final IJavaProject javaProject = JavaCore.create(result); WorkbenchTestHelper.makeCompliantFor(javaProject, JavaVersion.JAVA8); JavaProjectSetupUtil.addJreClasspathEntry(javaProject); return result; }
Example 7
Source File: XtextProjectCreator.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
private IProject createPluginProject(ProjectDescriptor descriptor, SubMonitor monitor) { PluginProjectFactory factory = pluginProjectProvider.get(); configureJavaProject(descriptor, factory); factory.addProjectNatures("org.eclipse.pde.PluginNature"); factory.addBuilderIds("org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder"); factory.addDevelopmentTimeBundles(Lists.newArrayList(descriptor.getDevelopmentBundles())); factory.addImportedPackages(Lists.newArrayList(descriptor.getImportedPackages())); factory.addRequiredBundles(Lists.newArrayList(descriptor.getRequiredBundles())); factory.setBreeToUse(descriptor.getBree()); return factory.createProject(monitor, null); }
Example 8
Source File: Bug334456Test.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
private IProject createPluginProject(String name) throws CoreException { PluginProjectFactory projectFactory = projectFactoryProvider.get(); projectFactory.setProjectName(name); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds( JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder", XtextProjectHelper.BUILDER_ID); projectFactory.addProjectNatures(JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID); projectFactory.addRequiredBundles(Collections.singletonList("org.eclipse.xtext")); IProject result = projectFactory.createProject(new NullProgressMonitor(), null); return result; }
Example 9
Source File: AbstractPluginProjectCreator.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
@Override protected ProjectFactory configureProjectFactory(ProjectFactory factory) { PluginProjectFactory result = (PluginProjectFactory) super.configureProjectFactory(factory); result.addRequiredBundles(getRequiredBundles()); result.addExportedPackages(getExportedPackages()); result.addImportedPackages(getImportedPackages()); result.setActivatorClassName(getActivatorClassName()); return result; }
Example 10
Source File: AutoEditTest.java From xtext-xtend with Eclipse Public License 2.0 | 5 votes |
protected IProject createPluginProject(String name) throws CoreException { final IProject[] result = new IProject[1]; IWorkspaceRunnable creatorTask = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { Injector injector = XtendActivator.getInstance().getInjector("org.eclipse.xtend.core.Xtend"); PluginProjectFactory projectFactory = injector.getInstance(PluginProjectFactory.class); projectFactory.setBreeToUse(JREContainerProvider.PREFERRED_BREE); projectFactory.setProjectName(name); projectFactory.setProjectDefaultCharset(StandardCharsets.ISO_8859_1.name()); projectFactory.addFolders(Collections.singletonList("src")); projectFactory.addBuilderIds( JavaCore.BUILDER_ID, "org.eclipse.pde.ManifestBuilder", "org.eclipse.pde.SchemaBuilder", XtextProjectHelper.BUILDER_ID); projectFactory.addProjectNatures(JavaCore.NATURE_ID, "org.eclipse.pde.PluginNature", XtextProjectHelper.NATURE_ID); projectFactory.addRequiredBundles(newArrayList("org.eclipse.xtext.xbase.lib")); IProject project = projectFactory.createProject(new NullProgressMonitor(), null); JavaProjectSetupUtil.setUnixLineEndings(project); result[0] = project; } }; ResourcesPlugin.getWorkspace().run(creatorTask, new NullProgressMonitor()); return result[0]; }