Browse Source

Rearranged statement whitespace in Velocity macros

pull/602/merge
Juergen Hoeller 12 years ago
parent
commit
7bc966032b
  1. 23
      spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm

23
spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/spring.vm

@ -82,7 +82,7 @@
* by user config. * by user config.
*# *#
#macro( springBind $path ) #macro( springBind $path )
#if ("$!springHtmlEscape" != "") #if("$!springHtmlEscape"!="")
#set( $status = $springMacroRequestContext.getBindStatus($path, $springHtmlEscape) ) #set( $status = $springMacroRequestContext.getBindStatus($path, $springHtmlEscape) )
#else #else
#set( $status = $springMacroRequestContext.getBindStatus($path) ) #set( $status = $springMacroRequestContext.getBindStatus($path) )
@ -171,7 +171,7 @@
* from a list of options. * from a list of options.
* *
* The null check for $status.value leverages Velocity's 'quiet' notation rather * The null check for $status.value leverages Velocity's 'quiet' notation rather
* than the more common #if ($status.value) since this method evaluates to the * than the more common #if($status.value) since this method evaluates to the
* boolean 'false' if the content of $status.value is the String "false" - not * boolean 'false' if the content of $status.value is the String "false" - not
* what we want. * what we want.
* *
@ -185,7 +185,7 @@
<select id="#springXmlId(${status.expression})" name="${status.expression}" ${attributes}> <select id="#springXmlId(${status.expression})" name="${status.expression}" ${attributes}>
#foreach($option in $options.keySet()) #foreach($option in $options.keySet())
<option value="${option}" <option value="${option}"
#if ("$!status.value" == "$option") selected="selected" #end> #if("$!status.value"=="$option") selected="selected" #end>
${options.get($option)}</option> ${options.get($option)}</option>
#end #end
</select> </select>
@ -208,7 +208,7 @@
#foreach($option in $options.keySet()) #foreach($option in $options.keySet())
<option value="${option}" <option value="${option}"
#foreach($item in $status.actualValue) #foreach($item in $status.actualValue)
#if ($item == $option) selected="selected" #end #if($item==$option) selected="selected" #end
#end #end
>${options.get($option)}</option> >${options.get($option)}</option>
#end #end
@ -231,7 +231,7 @@
#springBind($path) #springBind($path)
#foreach($option in $options.keySet()) #foreach($option in $options.keySet())
<input type="radio" name="${status.expression}" value="${option}" <input type="radio" name="${status.expression}" value="${option}"
#if ("$!status.value" == "$option") checked="checked" #end #if("$!status.value"=="$option") checked="checked" #end
${attributes} ${attributes}
#springCloseTag() #springCloseTag()
${options.get($option)} ${separator} ${options.get($option)} ${separator}
@ -255,7 +255,7 @@
#foreach($option in $options.keySet()) #foreach($option in $options.keySet())
<input type="checkbox" name="${status.expression}" value="${option}" <input type="checkbox" name="${status.expression}" value="${option}"
#foreach($item in $status.actualValue) #foreach($item in $status.actualValue)
#if ($item == $option) checked="checked" #end #if($item==$option) checked="checked" #end
#end #end
${attributes} #springCloseTag() ${attributes} #springCloseTag()
${options.get($option)} ${separator} ${options.get($option)} ${separator}
@ -275,7 +275,7 @@
#macro( springFormCheckbox $path $attributes ) #macro( springFormCheckbox $path $attributes )
#springBind($path) #springBind($path)
<input type="hidden" name="_#springXmlId(${status.expression})" value="on"/> <input type="hidden" name="_#springXmlId(${status.expression})" value="on"/>
<input type="checkbox" id="#springXmlId(${status.expression})" name="${status.expression}"#if ("$!{status.value}"=="true") checked="checked"#end ${attributes}/> <input type="checkbox" id="#springXmlId(${status.expression})" name="${status.expression}"#if("$!{status.value}"=="true") checked="checked"#end ${attributes}/>
#end #end
#** #**
@ -293,10 +293,10 @@
*# *#
#macro( springShowErrors $separator $classOrStyle ) #macro( springShowErrors $separator $classOrStyle )
#foreach($error in $status.errorMessages) #foreach($error in $status.errorMessages)
#if ($classOrStyle == "") #if($classOrStyle=="")
<b>${error}</b> <b>${error}</b>
#else #else
#if ($classOrStyle.indexOf(":") == -1) #if($classOrStyle.indexOf(":")==-1)
#set($attr="class") #set($attr="class")
#else #else
#set($attr="style") #set($attr="style")
@ -314,9 +314,6 @@
* depending on the value of a 'springXhtmlCompliant' variable in the * depending on the value of a 'springXhtmlCompliant' variable in the
* template context. * template context.
*# *#
#macro( springCloseTag )#if ($springXhtmlCompliant)/>#else>#end #end #macro( springCloseTag )#if($springXhtmlCompliant)/>#else>#end#end
#macro( springXmlId $id)#if($id)$id.replaceAll("\[","").replaceAll("\]","")#else$id#end#end #macro( springXmlId $id)#if($id)$id.replaceAll("\[","").replaceAll("\]","")#else$id#end#end

Loading…
Cancel
Save