DSL showing attributes based on its content value [message #995615] |
Sun, 30 December 2012 12:19  |
Eclipse User |
|
|
|
Hi,
Backgroud:
I have following EMF model:
EClass - View
uielements [list containing of type UIElement]
EClass - UIElement
properties [list containing of type Property]
EClass - Property
name [String]
value [String]
You can think of this View as any html page which contains many UI elements and each UI element has many properties.
There are existing xmi files each containing content of a View.
I am loadoing this xmi file using XMIResource and then moved the content to XTextResource (with different file extension). When i save the XTextResource, i can see the DSL format.
Problem:
The DSL shows all Properties for a UI Element.
I want to show only those properties which have value not equal to its non-default value.
In this way the size of DSL will be small.
Any hint on how i can achieve this will be really helpful.
Thanks and Regards,
Ashwani Kr Sharma
[Updated on: Sun, 30 December 2012 12:44] by Moderator
|
|
|
|
|
|
|
|
Re: DSL showing attributes based on its content value [message #1006989 is a reply to message #999623] |
Sun, 03 February 2013 10:45  |
Eclipse User |
|
|
|
Hi Ed,
Sorry to follow up late. Was stuck up in some parallel work.
I read my post and your replies. I think missed an important part of in problem description.
Actually there are two models:
ViewModel:
EClass - View
uielements [list containing of type UIElement]
EClass - UIElement
properties [list containing of type Property]
EClass - Property
name [String]
value [String]
AND
UI Element Definitions
EClass - UIElementDef
properties [list containing of type PropertyDef]
EClass - PropertyDef
name [String]
defaultvalue [String]
I want to create text modeling for xmi coming from View Model.
While doing so only those property has to be shown which has
(property.name = propertyDef.name and property.value != propertyDef.defaultvalue)
The logic of eIsSet would have worked if the value for EObject was not equal to its default Value in EMF Model.
In my use case, i guess i need to put code somewhere to skip the property.name to display in the DSL.
I should have specified the complete scenario but i missed somehow.
Where can i put the logic to skip property.name when property.value != propertyDef.defaultvalue
Regards,
Ashwani Kr Sharma
[Updated on: Sun, 03 February 2013 10:46] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03594 seconds