Class: JavaMappingText

Inherits:
JavaMapping show all
Defined in:
lib/ontomde-uml2-flex/Editor.mxml.rb,
lib/ontomde-uml2-flex/ValueObjectAS.rb,
lib/ontomde-uml2-flex/Editor.mxml.as.rb

Direct Known Subclasses

JavaMappingOrdinal

Instance Method Summary collapse

Methods inherited from JavaMapping

#flex_writeMXML_validate

Instance Method Details

#flex_prefixObject

<mx:TextInput id=“txtNom” text=“JavaMappingText.modelmodel.nom”/>



425
426
427
# File 'lib/ontomde-uml2-flex/Editor.mxml.rb', line 425

def flex_prefix
	return "txt"
end

#flex_writeMXML_Form_item_property(prop) ⇒ Object



428
429
430
# File 'lib/ontomde-uml2-flex/Editor.mxml.rb', line 428

def flex_writeMXML_Form_item_property(prop)
	prop.write(%{<mx:TextInput id="#{flex_prefix}#{prop.java_NameBean}" text="{model.#{prop.java_Name}}" #{maxStringLength.nil? ? "" : " maxChars=\"#{maxStringLength}\"" }/>\n})
end

#flex_writeMXML_Form_item_property_column(pcol) ⇒ Object



435
436
437
# File 'lib/ontomde-uml2-flex/Editor.mxml.rb', line 435

def flex_writeMXML_Form_item_property_column(pcol)
	pcol.write(%{<mx:DataGridColumn headerText="{getString('#{pcol.umlx_owner_one.java_qualifiedName}.#{pcol.java_Name}')}" dataField="#{pcol.java_Name}"/>\n})
end

#flex_writeMXML_MXvalidator(prop) ⇒ Object

<mx:StringValidator source=“txtNom” property=“text” required=“false”/>



141
142
143
144
145
146
147
148
149
150
# File 'lib/ontomde-uml2-flex/Editor.mxml.as.rb', line 141

def flex_writeMXML_MXvalidator(prop)
		re=getValidationRegexp
		validator= re.nil? ? "StringValidator" : "RegExpValidator"
		prop.encloseWrite("	<mx:#{validator}","/>\n") {
			prop.write(%{ source="{#{flex_prefix}#{prop.java_NameBean}}"})
			prop.write(%{ property="text"})
			prop.write(%{ required="#{prop.umlx_lowerValueIsZero? ? "false":"true"}"})
			prop.write(%{ expression="#{re.source}"}) unless re.nil?
		}
end

#flex_writeMXML_vo_mapping(prop) ⇒ Object



432
433
434
# File 'lib/ontomde-uml2-flex/Editor.mxml.rb', line 432

def flex_writeMXML_vo_mapping(prop)
	prop.write(%{ #{prop.java_Name}="{#{flex_prefix}#{prop.java_NameBean}.text}"})
end

#flex_writeVO_getParameter(prop) ⇒ Object

EXAMPLE:

param.nom = nom;


186
187
188
# File 'lib/ontomde-uml2-flex/ValueObjectAS.rb', line 186

def flex_writeVO_getParameter(prop)
	prop.write("param.#{prop.java_Name} = #{prop.java_Name};\n")
end

#flex_writeVO_initFromXML_mapping(prop) ⇒ Object

nom = DeserializeXMLUtil.getFormAttributValue(source, ‘nom’); id = DeserializeXMLUtil.getFormAttributValue(source, ‘id’);



192
193
194
# File 'lib/ontomde-uml2-flex/ValueObjectAS.rb', line 192

def flex_writeVO_initFromXML_mapping(prop)
	prop.write("#{prop.java_Name} = DeserializeXMLUtil.getFormAttributValue(source, '#{prop.java_Name}');\n")
end

#flex_writeVO_initItemFromXML_mapping(prop) ⇒ Object



195
196
197
# File 'lib/ontomde-uml2-flex/ValueObjectAS.rb', line 195

def flex_writeVO_initItemFromXML_mapping(prop)
	prop.write("#{prop.java_Name}=DeserializeXMLUtil.getOptionAttributValue(source,'#{prop.java_Name}');\n")
end

#flex_writeVO_vars_datatype(prop) ⇒ Object

EXAMPLES: public var nom:String; public var id:String;



180
181
182
# File 'lib/ontomde-uml2-flex/ValueObjectAS.rb', line 180

def flex_writeVO_vars_datatype(prop)
	prop.write("public var #{prop.java_Name}:String;\n")
end