[Eugenia] Set default value for a feature of List type [message #1232695] |
Fri, 17 January 2014 14:15 |
PEREZ MEDINA Jorge Luis Messages: 9 Registered: January 2014 |
Junior Member |
|
|
Hello all,
Recently I am working with Eugenia.
I need to create an editor with a class which has an attribute of type list. Par example:
@gmf.node(label="name,text",
figure="figures.OperatorFigure",
label.icon="false",
label.pattern="{0}:{1}",
label.placement="external",
label.readObly="false",
margin="5",
phantom="false",
size="10,10")
class Class1 {
attr int[1] text = 1;
!ordered ref Connector[*]#source outgoing;
!ordered ref Connector[*]#target incoming;
attr TextType[+] type = 0;
enum TextType {
Value1 = 0;
Value2 = 1;
}
The attribute must be set par default with the first enumerate (Value1), but when I run the .diagram generated this value is not setting by defult.
Could someone help me solve this problem ?
Thanks.
|
|
|
|
Re: [Eugenia] Set default value for a feature of List type [message #1233894 is a reply to message #1232857] |
Mon, 20 January 2014 19:27 |
PEREZ MEDINA Jorge Luis Messages: 9 Registered: January 2014 |
Junior Member |
|
|
Thanks,
I'm trying to start the changes in the Ecore2GMF.eol. I writing several initials lines of code but when i generate the editor an error is produced:
Property 'domainMetaElement' not found in object org. eclipse .epsilon .eol .types .EolModelElementType @ 61fe80b6(/home/jperezmedina/git/project/org.eclipse.project/model/...
My changes are:
-- Returns a NodeMapping
operation getNodeMapping(domainMetaElement:String):GmfMap!NodeMapping{
return GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name=domainMetaElement);
}
var canvasMapping = GmfMap!CanvasMapping.all.first();
var mapping = GmfMap!Mapping.all.first();
var nodeMapping = getNodeMapping('Class1').addCompartment('Class1TextType');
and my .emf file is:
gmf(foo="bar")
@namespace(uri=" http: //PROJECT1.ecore", prefix="PROJECT1")
package PROJECT1
class Project {
attr String id;
}
@gmf.diagram(onefile="false")
class Model extends Project {
val Model[*] elements;
}
class Class2 extends Base {
attr String name;
}
@gmf.node(label="name,text",
figure="figures.OperatorFigure",
label.icon="false",
label.pattern="{0}:{1}",
label.placement="external",
label.readObly="false",
margin="5",
phantom="false",
size="10,10")
class Class1 extends Class2 {
attr int[1] text = 1;
!ordered ref Connector[*]#source outgoing;
!ordered ref Connector[*]#target incoming;
attr TextType[+] type;
}
enum TextType {
Value1 = 0;
Value2 = 1;
}
Could anyone help me to resolve this error?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.03533 seconds