def view
if (@properties.has_action?) then
href = driver.page_path + "?action=#{escapeURL(action_id)}"
elsif (@properties.has_page?) then
page_name = @properties.page
href = driver.page_path(page_name)
elsif (@properties.has_href?) then
href = @properties.href
else
raise 'internal error'
end
if (@properties.has_query?) then
if (@properties.has_action?) then
sep = '&'
elsif (@properties.has_page?) then
sep = '?'
end
if (@properties.has_action? || @properties.has_page?) then
@properties.each_query_pair do |name, value|
href += sep; sep = '&'
href += escapeURL(name)
href += '='
href += escapeURL(value)
end
end
end
make_attr_desc{|attr_desc|
attr_desc += ' href="' + escapeHTML(href) + '"'
attr_desc += ' target="' + escapeHTML(@properties.target) + '"' if @properties.has_target?
yield('<a' + attr_desc + '>')
if (has_children?) then
for component in @child_components
component.make_page do |page_text|
yield(page_text)
end
end
elsif (@properties.has_string?) then
yield(escapeHTML(@properties.string || ''))
end
yield('</a>')
}
nil
end