Beispiel #1
0
  /**
   * 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
   */
  @Override
  public void registerPackages(ResourceSet resourceSet) {
    super.registerPackages(resourceSet);
    if (!isInWorkspace(org.eclipse.uml2.uml.UMLPackage.class)) {
      resourceSet
          .getPackageRegistry()
          .put(
              org.eclipse.uml2.uml.UMLPackage.eINSTANCE.getNsURI(),
              org.eclipse.uml2.uml.UMLPackage.eINSTANCE);
    }

    /*
     * TODO 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. 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. 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 (!isInWorkspace(UMLPackage.class)) {
     *     // The normal package registration if your metamodel is in a plugin.
     *     resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
     * } else {
     *     // The package registration that will be used if the metamodel is not deployed in a plugin.
     *     // This should be used if your metamodel is in your workspace and if you are using binary resource serialization.
     *     resourceSet.getPackageRegistry().put("/myproject/myfolder/mysubfolder/MyUMLMetamodel.ecore", UMLPackage.eINSTANCE);
     * }
     *
     * To learn more about Package Registration, have a look at the Acceleo Launcher documentation (Help -> Help Contents).
     */
  }
Beispiel #2
0
  /**
   * Launches the generation described by this instance.
   *
   * @param monitor This will be used to display progress information to the user.
   * @throws IOException This will be thrown if any of the output files cannot be saved to disk.
   * @generated
   */
  @Override
  public void doGenerate(Monitor monitor) throws IOException {
    /*
     * TODO if you wish to change the generation as a whole, override this. The default behavior should
     * be sufficient in most cases. 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 encounter a problem with an unresolved proxy during the
     * generation, you can remove the comments in the following instructions to check for problems. Please
     * note that those instructions may have a significant impact on the performances.
     */

    // org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model);

    /*
     * If you want to check for potential errors in your models before the launch of the generation, you
     * use the code below.
     */

    // if (model != null && model.eResource() != null) {
    //    List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> errors =
    // model.eResource().getErrors();
    //    for (org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic : errors) {
    //        System.err.println(diagnostic.toString());
    //    }
    // }

    super.doGenerate(monitor);
  }
Beispiel #3
0
 /**
  * This can be used to update the resource set's resource factory registry with all needed
  * factories.
  *
  * @param resourceSet The resource set which registry has to be updated.
  * @generated
  */
 @Override
 public void registerResourceFactories(ResourceSet resourceSet) {
   super.registerResourceFactories(resourceSet);
   // TODO If you need additional resource factories registrations, do them here. The following
   // line is an example for UML.
   // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
 }
Beispiel #4
0
 /**
  * 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
  */
 @Override
 public void registerPackages(ResourceSet resourceSet) {
   super.registerPackages(resourceSet);
   // TODO If you need additional package registrations, do them here. The following line is an
   // example for UML.
   // resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
 }
Beispiel #5
0
 /**
  * Launches the generation described by this instance.
  *
  * @param monitor This will be used to display progress information to the user.
  * @throws IOException This will be thrown if any of the output files cannot be saved to disk.
  * @generated
  */
 @Override
 public void doGenerate(Monitor monitor) throws IOException {
   /*
    * TODO if you wish to change the generation as a whole, override this.
    * The default behavior should be sufficient in most cases.
    */
   super.doGenerate(monitor);
 }
  /**
   * This can be used to update the resource set's resource factory registry with all needed
   * factories.
   *
   * @param resourceSet The resource set which registry has to be updated.
   */
  @Override
  public void registerResourceFactories(ResourceSet resourceSet) {
    super.registerResourceFactories(resourceSet);

    resourceSet
        .getResourceFactoryRegistry()
        .getExtensionToFactoryMap()
        .put("apd", new EcoreResourceFactoryImpl());
  }
 /**
  * Launches the generation described by this instance.
  *
  * @param repositoryAdapter
  * @param monitor This will be used to display progress information to the user.
  * @param projectName the expected intent project name
  * @param showTableOfContents indicate whether TOC should be shown by default or not
  * @throws IOException This will be thrown if any of the output files cannot be saved to disk.
  */
 public void doGenerate(
     Monitor monitor,
     String projectName,
     boolean showTableOfContents,
     RepositoryAdapter repositoryAdapter)
     throws IOException {
   this.projectName = projectName;
   IntentAcceleoServices.initialize(
       projectName, getTargetFolder(), showTableOfContents, repositoryAdapter);
   super.doGenerate(monitor);
   IntentAcceleoServices.dispose();
 }
  /**
   * 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
   */
  @Override
  public void registerPackages(ResourceSet resourceSet) {
    super.registerPackages(resourceSet);
    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 (!isInWorkspace(org.eclipse.emf.ecore.EcorePackage.class)) {
      resourceSet
          .getPackageRegistry()
          .put(
              org.eclipse.emf.ecore.EcorePackage.eINSTANCE.getNsURI(),
              org.eclipse.emf.ecore.EcorePackage.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).
     */
  }
Beispiel #9
0
  /**
   * This can be used to update the resource set's resource factory registry with all needed
   * factories.
   *
   * @param resourceSet The resource set which registry has to be updated.
   * @generated
   */
  @Override
  public void registerResourceFactories(ResourceSet resourceSet) {
    super.registerResourceFactories(resourceSet);
    /*
     * TODO If you need additional resource factories registrations, you can register them here. the following line
     * (in comment) is an example of the resource factory registration for UML. 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.
     *
     * To learn more about the registration of Resource Factories, have a look at the Acceleo Launcher documentation (Help -> Help Contents).
     */

    // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
  }
Beispiel #10
0
 /**
  * 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
  */
 @Override
 public void registerPackages(ResourceSet resourceSet) {
   super.registerPackages(resourceSet);
   resourceSet
       .getPackageRegistry()
       .put(
           org.obeonetwork.dsl.entity.EntityPackage.eINSTANCE.getNsURI(),
           org.obeonetwork.dsl.entity.EntityPackage.eINSTANCE);
   resourceSet
       .getPackageRegistry()
       .put(
           org.obeonetwork.dsl.entity.extensionUtilities.ExtensionUtilitiesPackage.eINSTANCE
               .getNsURI(),
           org.obeonetwork.dsl.entity.extensionUtilities.ExtensionUtilitiesPackage.eINSTANCE);
   // TODO If you need additional package registrations, do them here. The following line is an
   // example for UML.
   // resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
 }
Beispiel #11
0
  /**
   * 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.
   */
  @Override
  public void registerPackages(ResourceSet resourceSet) {
    super.registerPackages(resourceSet);

    resourceSet.getPackageRegistry().put(ModelPackage.eNS_URI, ModelPackage.eINSTANCE);
  }
Beispiel #12
0
 @Override
 public void doGenerate(Monitor monitor) throws IOException {
   super.doGenerate(monitor);
 }