(no subject) [message #693972] |
Thu, 07 July 2011 10:50  |
Eclipse User |
|
|
|
Hi,
is it possible to have RCP generation support as an annotation?
The following code supports @gmf.diagram(rcp="true"):
It would be great if this would be improved as needed and included in
EuGENia.
Class : org.eclipse.epsilon.eugenia.GmfMap2GmfGenDelegate
> public class GmfMap2GmfGenDelegate extends EugeniaActionDelegate {
>
> @SuppressWarnings("restriction")
> @Override
> public void run(IAction action) {
> // Transform GmfMap to GmfGen model
>
> boolean rcp = false;
> try {
> EmfModel model = loadModel("Ecore", gmfFileSet.getEcorePath(), EcorePackage.eINSTANCE.getNsURI(), true, false, true);
> for (Object elem : model.getAllOfType("EAnnotation")) {
> EAnnotation elm = (EAnnotation)elem;
> if (elm.getSource().equalsIgnoreCase("gmf.diagram")) {
> if (elm.getDetails().containsKey("rcp") && elm.getDetails().get("rcp").equalsIgnoreCase("true")) {
> rcp = true;
> break;
> }
> }
> }
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> ResourceSet resourceSet = new ResourceSetImpl();
> TransformToGenModelOperation transformToGenModelOperation = new TransformToGenModelOperation(resourceSet);
>
> TransformOptions options = transformToGenModelOperation.getOptions();
> options.setGenerateRCP(rcp);
Thanks and all the best,
Ivar
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10100 seconds