Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » how to access classes that extends other classes
how to access classes that extends other classes [message #638310] Wed, 10 November 2010 19:13 Go to next message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
Hi everybody. I describe my emf model with some classes then extends others classes. For example:

@gmf.diagram(foo="bar")
class Schema {
val SchemaElement[*] contents;
}

abstract class SchemaElement {
attr String name;
}

class Table extends SchemaElement {
attr Boolean isGeographic;
}

@gmf.node(label="name", border.width="2")
class Dimension extends Table {
@gmf.compartment(layout="list", collapsible="false")
val Attribute[*] dim_attributes;
}

Im doing m2t with egl, and i need to access all dimensions from schema for iterate..but how do this? Schema contains SchemaElement[*] contents;

[%for (i in Sequence{0..(schema.dimensions.size-1)}){%]

thanks for the aswers Smile
Re: how to access classes that extends other classes [message #638341 is a reply to message #638310] Wed, 10 November 2010 21:50 Go to previous messageGo to next message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
How about using a select call and an isKindOf check?

[%for (d in schema.contents.select(se | se.isKindOf (Dimension))) {%]

Best regards,

Steffen

On 10/11/2010 19:14, Paulo Del Aguila wrote:
> Hi everybody. I describe my emf model with some classes then extends
> others classes. For example:
>
> @gmf.diagram(foo="bar")
> class Schema {
> val SchemaElement[*] contents;
> }
>
> abstract class SchemaElement {
> attr String name;
> }
>
> class Table extends SchemaElement {
> attr Boolean isGeographic;
> }
>
> @gmf.node(label="name", border.width="2")
> class Dimension extends Table {
> @gmf.compartment(layout="list", collapsible="false")
> val Attribute[*] dim_attributes;
> }
>
> Im doing m2t with egl, and i need to access all dimensions from schema
> for iterate..but how do this? Schema contains SchemaElement[*] contents;
>
> [%for (i in Sequence{0..(schema.dimensions.size-1)}){%]
>
> thanks for the aswers :)
>
Re: how to access classes that extends other classes [message #638355 is a reply to message #638341] Thu, 11 November 2010 00:05 Go to previous message
Paulo Del Aguila is currently offline Paulo Del AguilaFriend
Messages: 14
Registered: October 2010
Junior Member
thank you very much Steffen, it resolves my problem, works fine Smile
Previous Topic:Multiple views on the same model
Next Topic:Using My own Java Code in ETL
Goto Forum:
  


Current Time: Thu Apr 25 21:27:49 GMT 2024

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

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

Back to the top