Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Derived attribute without adding extra attr in metamodel
Derived attribute without adding extra attr in metamodel [message #237494] Sun, 26 July 2009 12:39 Go to next message
Mihir is currently offline MihirFriend
Messages: 83
Registered: July 2009
Member
Hello,

Assume that I've two classes as below. Focus on ObjectTemplateExp. I
want is to fetch the value of name attr from VariableExp class and
display it as a label for the instance of ObjectTemplateExp on the
editor. Can this be done without using/adding derived attribute to the
ObjectTemplateExp class?? Because, I don't want to change/add anything
in the metamodel.

class ObjectTemplateExp {
val VariableExp variable;
val PropertyTemplateExp[*] propertyTemplates;
ref EClass referredClass;
}

class PropertyTemplateExp {
val ExtendedExp value;
ref ecore.EStructuralFeature referredProperty;
}

class VariableExp {
!unique !ordered attr String name;
}


Thanks a million for your help,

Cheers,
Mihir
Re: Derived attribute without adding extra attr in metamodel [message #237628 is a reply to message #237494] Mon, 27 July 2009 14:36 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Mihir,

You can create LabelMapping (instead of FeaturelabelMapping) below the NodeMapping
for ObjectTemplateExp and implement/plug in custom parser for this label
using runtime extension point.

-----------------
Alex Shatalin
Re: Derived attribute without adding extra attr in metamodel [message #237651 is a reply to message #237628] Mon, 27 July 2009 18:17 Go to previous message
Mihir is currently offline MihirFriend
Messages: 83
Registered: July 2009
Member
Hello Alex,

Thanks for the hint. :) I'll try and experiment with what you have
mentioned. Just to let you know that I'm a newbie to EMF GMF so might
sometime ask stupid questions.

I'll get back to you soon.

Cheers,
Mihir


Alex Shatalin wrote:
> Hello Mihir,
>
> You can create LabelMapping (instead of FeaturelabelMapping) below the
> NodeMapping for ObjectTemplateExp and implement/plug in custom parser
> for this label using runtime extension point.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:save as. How can I make a copy from the model and diagram file?
Next Topic:Kick start for multi page editor
Goto Forum:
  


Current Time: Mon Apr 06 19:00:29 GMT 2020

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

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

Back to the top