How to add attributes to an abstract component [message #757582] |
Sat, 19 November 2011 16:18  |
Eclipse User |
|
|
|
hi,
I would like to add an "element property" to my abstract component.
Because every component needs the element properties. How can I accomplish this?
Component:
Textfield | TextArea | Label
;
Label:
'label' name=ID '{' text=STRING properties=ElementProperties?'}'
;
Textfield:
'textfield' name=ID '{' text=STRING properties=ElementProperties?'}'
;
TextArea:
'textarea' name=ID '{' 'sizeX' sizeX = INT & 'sizeY' sizeY = INT properties=ElementProperties?'}'
;
I don't want to do this for each component:
«IF (b.properties.colspan != null)»
«b.name»Constraint.gridwidth = «b.properties.colspan»;
«ENDIF»
«IF (b.properties.rowspan != null)»
«b.name»Constraint.gridheight = «b.properties.rowspan»;
«ENDIF»
«IF (b.properties.alignment != null)»
«b.name»Constraint.fill = «b.name»Constraint«b.properties.alignment»;
«ENDIF»
regards,
jens
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.42945 seconds