|
|
|
|
|
|
|
Re: [EEF] Custom Toolkit Widgets [message #662097 is a reply to message #622996] |
Tue, 29 March 2011 09:44 |
Aur Messages: 29 Registered: August 2010 |
Junior Member |
|
|
Hi all,
I know that this topic is a bit old but I'm facing the same problem, so I hope someone could give a solution
I'm trying to add a custom SWT Widget in the EEF generation process. So thanks to the previous message, I managed to create a .toolkits model in which I added my widget. Then I loaded this resource in the .components model and I am now able to select my widget in the representation field.
I also coded the 4 templates (xxControl, xxGettersSetters, xxSWTImpl, xxFormImpl), taking example on org.eclipse.emf.eef.codegen.widgets.impl.text templates.
But when I try to generate the project code thanks to my .eefgen model, some errors raise and I am not able to produce what I want.
Error: Problem while Organize Imports : project_path.edit/src-gen/class_using_my_widget.java
In the generated code there are many messages like:
xxPropertiesEditionPart.java :
public //FIXME ERROR INVALID CASE INTO template public toJavaType(view : ViewElement) in common.mtl module for representation EMigPropertyEditor getValue();
public void setValue(//FIXME ERROR INVALID CASE INTO template public toJavaType(view : ViewElement) in common.mtl module for representation EMigPropertyEditor newValue);
xxPropertiesEditionPartForm.java :
//FIXME INVALID CASE INTO template public widgetDeclaration(editor : ElementEditor) in viewFormUtils.mtl module
//FIXME INVALID CASE INTO template public implementation(editor : ViewElement, pec : PropertiesEditionComponent) in viewUtils.mtl module
So if someone has any idea ...
Thanks in advance
[Updated on: Thu, 31 March 2011 14:17] Report message to a moderator
|
|
|
|
Re: [EEF] Custom Toolkit Widgets [message #664087 is a reply to message #622996] |
Thu, 07 April 2011 12:56 |
|
Hi Aurelien,
The support for Ant in Acceleo has been improved for Acceleo 3.1.0 M7 that will be released soon. If you want to build your project with Ant you should take example on the new version of the generation task.
<?xml version="1.0" encoding="UTF-8"?>
<project default="generateJava" name="org.eclipse.acceleo.module.example.uml2java.helios">
<property name="ECLIPSE_HOME" value="../../"/>
<property name="ECLIPSE_WORKSPACE" value="../"/>
<path id="org.eclipse.acceleo.module.example.uml2java.helios.libraryclasspath">
<pathelement location="../org.eclipse.acceleo.module.example.uml2java.helios/bin"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime_3.6.0.v20100505.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.osgi_3.6.0.v20100517.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.jobs_3.5.0.v20100515.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime.compatibility.registry_3.3.0.v20100520/runtime_registry_compatibility.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.registry_3.5.0.v20100503.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.preferences_3.3.0.v20100503.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.contenttype_3.4.100.v20100505-1235.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.equinox.app_1.3.0.v20100512.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.uml2.uml_3.1.0.v201006071150.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.ecore_2.6.1.v20100914-1218.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.common_2.6.0.v20100914-1218.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.ecore.xmi_2.5.0.v20100521-1846.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.uml2.common_1.5.0.v201005031530.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ocl_3.0.0.v201005061704.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/lpg.runtime.java_2.0.17.v201004271640.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ocl.ecore_3.0.0.v201005061704.jar"/>
<pathelement location="${ECLIPSE_HOME}/workspace_Traceability/org.eclipse.acceleo.model/bin"/>
<pathelement location="${ECLIPSE_HOME}/workspace_Traceability/org.eclipse.acceleo.engine/bin"/>
<pathelement location="${ECLIPSE_HOME}/workspace_Traceability/org.eclipse.acceleo.common/bin"/>
<pathelement location="${ECLIPSE_HOME}/workspace_Traceability/org.eclipse.acceleo.profiler/bin"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.codegen.ecore_2.6.1.v20100914-1218.jar"/>
<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.codegen_2.6.0.v20100914-1218.jar"/>
</path>
<path id="org.eclipse.acceleo.module.example.uml2java.helios.classpath">
<path refid="org.eclipse.acceleo.module.example.uml2java.helios.libraryclasspath"/>
</path>
<target name="generateJava">
<java classname="org.eclipse.acceleo.module.example.uml2java.helios.GenerateJava" classpathref="org.eclipse.acceleo.module.example.uml2java.helios.classpath">
<arg value="model"/>
<arg value="target"/>
</java>
</target>
</project>
You should just have to replace the call to the "Generate.java" class to a call to the Acceleo compiler with your parameters.
If you want to build with the existing Ant task to deploy an Acceleo generator, you can just let Eclipse do the job, it will call the Ant task to compile with the AcceleoCompiler. In order to do that: blog
In any way, make sure that you are using the latest release of Acceleo from the Acceleo update site since we have improved the Ant compilation in the 3.0.2 release:
3.0.x -> http://download.eclipse.org/modeling/m2t/acceleo/updates/rel eases/3.0
Or you could try the latest nightly build of Acceleo 3.1 here:
3.1 -> http://download.eclipse.org/modeling/m2t/acceleo/updates/nig htly/3.1
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Acceleo wiki: http://wiki.eclipse.org/Acceleo
Blogs: http://stephanebegaudeau.tumblr.com & http://sbegaudeau.tumblr.com
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03949 seconds