Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EAnnotation details
EAnnotation details [message #497720] Fri, 13 November 2009 11:21 Go to next message
Enrico Schnepel is currently offline Enrico Schnepel
Messages: 121
Registered: July 2009
Senior Member
Hello,

I want to create an ecore.EAnnotation object with some entries in the
details ecore.EMap. The problem is, that the put method from ecore.EMap
could not be found...

thanks in advance

Enrico

My EWL file:
>>>
wizard createDataTypeObject {
guard : self.isKindOf(EDataType)
title : 'Create ' + self.name + 'Object'
do {
var o:new EDataType;
self.eContainer.eClassifiers.add(o);
o.instanceTypeName = 'org.eclipse.emf.common.util.Enumerator';
o.name = self.name + 'Object';
var a:new EAnnotation;
o.eAnnotations.add(a);
a.source='http:///org/eclipse/emf/ecore/util/ExtendedMetaData';
a.details.put('name', self.name + ':Object');
a.details.put('baseType', self.name);
}
}
<<<

the exception:
>>>
Method 'map' not found (...\Ecore.ewl@15:18)
at
org.eclipse.epsilon.eol.execute.PointExecutor.executeOperati on(PointExecutor.java:190)
at
org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:67)
at
org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:37)
at
org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
at
org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
at
org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:36)
at
org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
at
org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
at
org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execu te(StatementBlockExecutor.java:33)
at
org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
at org.eclipse.epsilon.ewl.EwlWizard.process(EwlWizard.java:78)
at
org.eclipse.epsilon.ewl.EwlWizardInstance.process(EwlWizardI nstance.java:66)
at
org.eclipse.epsilon.ewl.emf.ExecuteWizardInstanceCommand.exe cute(ExecuteWizardInstanceCommand.java:42)
at
org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:84)
at
org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction. execute(AbstractContributeWizardsAction.java:237)
at
org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction$ 1.widgetSelected(AbstractContributeWizardsAction.java:225)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
<<<
Re: EAnnotation details [message #497755 is a reply to message #497720] Fri, 13 November 2009 11:49 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Enrico,

The following snippet seems to be doing the trick:

var ann : new EAnnotation;
var detail : new EStringToStringMapEntry;
detail.key = "foo";
detail.value = "bar";
ann.details.add(detail);

Cheers,
Dimitris

Enrico Schnepel wrote:
> Hello,
>
> I want to create an ecore.EAnnotation object with some entries in the
> details ecore.EMap. The problem is, that the put method from ecore.EMap
> could not be found...
>
> thanks in advance
>
> Enrico
>
> My EWL file:
> wizard createDataTypeObject {
> guard : self.isKindOf(EDataType)
> title : 'Create ' + self.name + 'Object'
> do {
> var o:new EDataType;
> self.eContainer.eClassifiers.add(o);
> o.instanceTypeName = 'org.eclipse.emf.common.util.Enumerator';
> o.name = self.name + 'Object';
> var a:new EAnnotation;
> o.eAnnotations.add(a);
> a.source='http:///org/eclipse/emf/ecore/util/ExtendedMetaData';
> a.details.put('name', self.name + ':Object');
> a.details.put('baseType', self.name);
> }
> }
> <<<
>
> the exception:
> Method 'map' not found (...\Ecore.ewl@15:18)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.executeOperati on(PointExecutor.java:190)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:67)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:37)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:36)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at
> org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execu te(StatementBlockExecutor.java:33)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at org.eclipse.epsilon.ewl.EwlWizard.process(EwlWizard.java:78)
> at
> org.eclipse.epsilon.ewl.EwlWizardInstance.process(EwlWizardI nstance.java:66)
> at
> org.eclipse.epsilon.ewl.emf.ExecuteWizardInstanceCommand.exe cute(ExecuteWizardInstanceCommand.java:42)
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:84)
> at
> org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction. execute(AbstractContributeWizardsAction.java:237)
> at
> org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction$ 1.widgetSelected(AbstractContributeWizardsAction.java:225)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> <<<
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: EAnnotation details [message #582823 is a reply to message #497720] Fri, 13 November 2009 11:49 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios Kolovos
Messages: 1776
Registered: July 2009
Senior Member
Hi Enrico,

The following snippet seems to be doing the trick:

var ann : new EAnnotation;
var detail : new EStringToStringMapEntry;
detail.key = "foo";
detail.value = "bar";
ann.details.add(detail);

Cheers,
Dimitris

Enrico Schnepel wrote:
> Hello,
>
> I want to create an ecore.EAnnotation object with some entries in the
> details ecore.EMap. The problem is, that the put method from ecore.EMap
> could not be found...
>
> thanks in advance
>
> Enrico
>
> My EWL file:
> wizard createDataTypeObject {
> guard : self.isKindOf(EDataType)
> title : 'Create ' + self.name + 'Object'
> do {
> var o:new EDataType;
> self.eContainer.eClassifiers.add(o);
> o.instanceTypeName = 'org.eclipse.emf.common.util.Enumerator';
> o.name = self.name + 'Object';
> var a:new EAnnotation;
> o.eAnnotations.add(a);
> a.source='http:///org/eclipse/emf/ecore/util/ExtendedMetaData';
> a.details.put('name', self.name + ':Object');
> a.details.put('baseType', self.name);
> }
> }
> <<<
>
> the exception:
> Method 'map' not found (...\Ecore.ewl@15:18)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.executeOperati on(PointExecutor.java:190)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:67)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:37)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:36)
> at
> org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointE xecutor.java:123)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at
> org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execu te(StatementBlockExecutor.java:33)
> at
> org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(E xecutorFactory.java:185)
> at org.eclipse.epsilon.ewl.EwlWizard.process(EwlWizard.java:78)
> at
> org.eclipse.epsilon.ewl.EwlWizardInstance.process(EwlWizardI nstance.java:66)
> at
> org.eclipse.epsilon.ewl.emf.ExecuteWizardInstanceCommand.exe cute(ExecuteWizardInstanceCommand.java:42)
> at
> org.eclipse.emf.common.command.BasicCommandStack.execute(Bas icCommandStack.java:84)
> at
> org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction. execute(AbstractContributeWizardsAction.java:237)
> at
> org.eclipse.epsilon.ewl.emf.AbstractContributeWizardsAction$ 1.widgetSelected(AbstractContributeWizardsAction.java:225)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> <<<
>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Previous Topic:EAnnotation details
Next Topic:EVL validation is working, EMF is not
Goto Forum:
  


Current Time: Thu Oct 23 13:08:07 GMT 2014

Powered by FUDForum. Page generated in 0.01565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software