Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion com.avaloq.tools.ddk.xtext.scope.generator/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
Expand Down
6 changes: 0 additions & 6 deletions com.avaloq.tools.ddk.xtext.scope.generator/.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
Expand All @@ -44,7 +39,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
Expand Down
3 changes: 1 addition & 2 deletions com.avaloq.tools.ddk.xtext.scope.generator/build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
source.. = src/,\
xtend-gen/
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************************************************************
* Copyright (c) 2016 Avaloq Group AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Avaloq Group AG - initial API and implementation
*******************************************************************************/

package com.avaloq.tools.ddk.xtext.scope.generator;

import org.eclipse.xtext.GrammarUtil;
import org.eclipse.xtext.linking.ILinkingService;
import org.eclipse.xtext.scoping.IScopeProvider;
import org.eclipse.xtext.xtext.generator.AbstractXtextGeneratorFragment;
import org.eclipse.xtext.xtext.generator.model.GuiceModuleAccess;
import org.eclipse.xtext.xtext.generator.model.TypeReference;

import com.avaloq.tools.ddk.xtext.linking.LinkingService;
import com.avaloq.tools.ddk.xtext.scoping.IScopeNameProvider;


@SuppressWarnings("nls")
public class ScopingFragment2 extends AbstractXtextGeneratorFragment {

private static final String RUNTIME_PLUGIN = "com.avaloq.tools.ddk.xtext";

@Override
public void generate() {
final String prefix = GrammarUtil.getNamespace(getGrammar()) + ".scoping." + GrammarUtil.getSimpleName(getGrammar());
new GuiceModuleAccess.BindingFactory()
.addTypeToType(TypeReference.typeRef(IScopeProvider.class), new TypeReference(prefix + "ScopeProvider"))
.addTypeToType(TypeReference.typeRef(IScopeNameProvider.class), new TypeReference(prefix + "ScopeNameProvider"))
.addTypeToType(TypeReference.typeRef(ILinkingService.class), TypeReference.typeRef(LinkingService.class))
.contributeTo(getLanguage().getRuntimeGenModule());

if (getProjectConfig().getRuntime().getManifest() != null) {
getProjectConfig().getRuntime().getManifest().getRequiredBundles().add("org.eclipse.emf.ecore");
getProjectConfig().getRuntime().getManifest().getRequiredBundles().add(RUNTIME_PLUGIN);
getProjectConfig().getRuntime().getManifest().getExportedPackages().add(GrammarUtil.getNamespace(getGrammar()) + ".scoping");
getProjectConfig().getRuntime().getManifest().getImportedPackages().add("org.apache.logging.log4j");
}

if (getProjectConfig().getEclipsePlugin().getManifest() != null) {
getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles().add(RUNTIME_PLUGIN);
}
}
}

This file was deleted.

Empty file.