use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.
the class FragmentFakingEcoreResource method getURIFragment.
public String getURIFragment(final EClassifier classifier) {
EPackage _eSuperPackage = classifier.getEPackage().getESuperPackage();
boolean _tripleNotEquals = (_eSuperPackage != null);
if (_tripleNotEquals) {
final StringBuilder result = new StringBuilder(60);
this.calculateURIFragment(classifier.getEPackage(), result, CollectionLiterals.<EPackage>newHashSet());
result.append(classifier.getName());
return result.toString();
}
return null;
}
use of org.eclipse.emf.ecore.EPackage in project xtext-core by eclipse.
the class Ecore2XtextExtensions method subClasses.
public static Iterable<EClass> subClasses(final EClass it) {
Iterable<EClass> _xifexpression = null;
EPackage _ePackage = it.getEPackage();
boolean _tripleEquals = (_ePackage == null);
if (_tripleEquals) {
_xifexpression = CollectionLiterals.<EClass>emptyList();
} else {
final Function1<EClass, Boolean> _function = (EClass c) -> {
return Boolean.valueOf(c.getEAllSuperTypes().contains(it));
};
_xifexpression = IterableExtensions.<EClass>filter(Iterables.<EClass>filter(it.getEPackage().getEClassifiers(), EClass.class), _function);
}
return _xifexpression;
}
use of org.eclipse.emf.ecore.EPackage in project ifml2php by Dipiert.
the class Controller method registerPackages.
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
URI uri = URI.createFileURI("../edu.ifml2php.pim.ifml.gen.lycmm/models/metamodels/Metamodel.ecore");
Resource resource = resourceSet.getResource(uri, true);
EPackage PHPMVC = (EPackage) resource.getContents().get(0);
List<EPackage> subPackages = PHPMVC.getESubpackages();
for (EPackage subPack : subPackages) {
EPackage.Registry.INSTANCE.put(subPack.getNsURI(), subPack);
}
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
use of org.eclipse.emf.ecore.EPackage in project ifml2php by Dipiert.
the class Model method registerPackages.
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
URI uri = URI.createFileURI("../edu.ifml2php.pim.ifml.gen.lycmm/models/metamodels/Metamodel.ecore");
Resource resource = resourceSet.getResource(uri, true);
EPackage PHPMVC = (EPackage) resource.getContents().get(0);
List<EPackage> subPackages = PHPMVC.getESubpackages();
for (EPackage subPack : subPackages) {
EPackage.Registry.INSTANCE.put(subPack.getNsURI(), subPack);
}
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
use of org.eclipse.emf.ecore.EPackage in project ifml2php by Dipiert.
the class Application method registerPackages.
/**
* This can be used to update the resource set's package registry with all needed EPackages.
*
* @param resourceSet
* The resource set which registry has to be updated.
* @generated NOT
*/
@Override
public void registerPackages(ResourceSet resourceSet) {
super.registerPackages(resourceSet);
/*if (!isInWorkspace(IFML.Core.CorePackage.class)) {
resourceSet.getPackageRegistry().put(IFML.Core.CorePackage.eINSTANCE.getNsURI(), IFML.Core.CorePackage.eINSTANCE);
}/*
File file = new File("/home/dam/Escritorio/ws/preprod.acceleo.ifml2OurMM/src/acceleo/generacionClaseApplication/main/acceleo/ifml2OurMM/Metamodel.ecore");
EObject obj;
try {
obj = ModelUtils.load(file, resourceSet);
resourceSet.getPackageRegistry().put("http://www.application.org", obj);
} catch (IOException e) {
e.printStackTrace();
}*/
/*Por cambios en la plataforma de Eclipse en la versión Luna, la estrategia de usar Acceleo plug-in como launcher
no funciona. La alternativa es usar Java como launcher, como aplicación stand alone. Para estos casos EMF no descubrirá
ni registrará los paquetes disponibles y por ello debe hacer esto manualmente*/
// URI uri = URI.createFileURI("/home/dam/Escritorio/ws/edu.ifml2php.psm.lycmm.gen.laravel/src/Metamodel.ecore");
URI uri = URI.createFileURI("../edu.ifml2php.pim.ifml.gen.lycmm/models/metamodels/Metamodel.ecore");
Resource resource = resourceSet.getResource(uri, true);
EPackage PHPMVC = (EPackage) resource.getContents().get(0);
List<EPackage> subPackages = PHPMVC.getESubpackages();
for (EPackage subPack : subPackages) {
EPackage.Registry.INSTANCE.put(subPack.getNsURI(), subPack);
}
/*if (!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNsURI(), org.eclipse.uml2.uml.UMLPackage.eINSTANCE);
}*/
/*
* If you want to change the content of this method, do NOT forget to change the "@generated"
* tag in the Javadoc of this method to "@generated NOT". Without this new tag, any compilation
* of the Acceleo module with the main template that has caused the creation of this class will
* revert your modifications.
*/
/*
* If you need additional package registrations, you can register them here. The following line
* (in comment) is an example of the package registration for UML.
*
* You can use the method "isInWorkspace(Class c)" to check if the package that you are about to
* register is in the workspace.
*
* To register a package properly, please follow the following conventions:
*
* If the package is located in another plug-in, already installed in Eclipse. The following content should
* have been generated at the beginning of this method. Do not register the package using this mechanism if
* the metamodel is located in the workspace.
*
* if (!isInWorkspace(UMLPackage.class)) {
* // The normal package registration if your metamodel is in a plugin.
* resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
* }
*
* If the package is located in another project in your workspace, the plugin containing the package has not
* been register by EMF and Acceleo should register it automatically. If you want to use the generator in
* stand alone, the regular registration (seen a couple lines before) is needed.
*
* To learn more about Package Registration, have a look at the Acceleo documentation (Help -> Help Contents).
*/
}
Aggregations