Author: nbubna
Date: Tue Feb 3 19:34:39 2009
New Revision: 740388
URL: http://svn.apache.org/viewvc?rev=740388&view=rev
Log:
tighten up showcase display and functions
Modified:
velocity/tools/trunk/examples/showcase/VM_global_library.vm
velocity/tools/trunk/examples/showcase/demo.vm
velocity/tools/trunk/examples/showcase/layout/layout.css
Modified: velocity/tools/trunk/examples/showcase/VM_global_library.vm
URL:
http://svn.apache.org/viewvc/velocity/tools/trunk/examples/showcase/VM_global_library.vm?rev=740388&r1=740387&r2=740388&view=diff
==============================================================================
--- velocity/tools/trunk/examples/showcase/VM_global_library.vm (original)
+++ velocity/tools/trunk/examples/showcase/VM_global_library.vm Tue Feb 3
19:34:39 2009
@@ -88,9 +88,9 @@
*#
#macro( demo $toolname $method $description )
<tr>
- <td valign="top">${esc.d}${toolname}.${method}</td>
- <td valign="top"
id="${method}">$render.eval("${esc.d}${toolname}.${method}")</td>
- <td valign="top">$description</td>
+ <td class="method" valign="top">${esc.d}${toolname}.${method}</td>
+ <td class="demo" valign="top"
id="${method}">$render.eval("${esc.d}${toolname}.${method}")</td>
+ <td class="desc" valign="top">$description</td>
</tr>
#end
@@ -99,9 +99,9 @@
*#
#macro( demoAlt $toolname $method $result $description )
<tr>
- <td valign="top">${esc.d}${toolname}.${method}</td>
- <td valign="top" id="alt${method}">$!result</td>
- <td valign="top">$description</td>
+ <td class="method" valign="top">${esc.d}${toolname}.${method}</td>
+ <td class="demo" valign="top" id="alt${method}">$!result</td>
+ <td class="desc" valign="top">$description</td>
</tr>
#end
@@ -114,12 +114,12 @@
#end
<tr>
<form name="${method}" method="get" action="$link.self.anchor($method)"> ##
HttpUnit doesn't like anchor-only links
- <td valign="top">
+ <td class="method" valign="top">
<a name="$method"><nobr>
${esc.d}${toolname}.$method(${quote}<input type="text" size="$size"
name="$method" value="$!params.get($method)">${quote})
</nobr></a>
</td>
- <td valign="top">
+ <td class="demo" valign="top">
#if( $params.get($method) )
${esc.d}${toolname}.${method}(${quote}$params.get($method)${quote})
=
@@ -136,7 +136,7 @@
#end
#end
</td>
- <td valign="top">$description</td>
+ <td class="desc" valign="top">$description</td>
</form>
</tr>
#end
@@ -152,11 +152,11 @@
#set( $method2 = "${method}2" )
<tr>
<form name="$method2" method="get" action="$link.self.anchor($method2)"> ##
HttpUnit doesn't like anchor-only links
- <td valign="top">
+ <td class="method" valign="top">
<a name="$method2"><nobr>${esc.d}${toolname}.$method(${quote}<input
type="text" size="$size" name="${method1}"
value="$!params.get("${method1}")">${quote},
${quote}<input
type="text" size="$size" name="${method2}"
value="$!params.get("${method2}")">${quote})</nobr></a>
</td>
- <td valign="top">
+ <td class="demo" valign="top">
#if( $params.get(${method1}) )
${esc.d}${toolname}.${method}(${quote}$!params.get(${method1})${quote},
${quote}$!params.get(${method2})${quote})
=
@@ -173,7 +173,7 @@
#end
#end
</td>
- <td valign="top">$description</td>
+ <td class="desc" valign="top">$description</td>
</form>
</tr>
#end
@@ -190,12 +190,12 @@
#set( $method3 = "${method}C" )
<tr>
<form name="$method3" method="get" action="$link.self.anchor($method3)"> ##
HttpUnit doesn't like anchor-only links
- <td valign="top">
+ <td class="method" valign="top">
<a name="$method3"><nobr>${esc.d}${toolname}.$method(${quote}<input
type="text" size="$size" name="${method1}"
value="$!params.get("${method1}")">${quote},
${quote}<input
type="text" size="$size" name="${method2}"
value="$!params.get("${method2}")">${quote},
${quote}<input
type="text" size="$size" name="${method3}"
value="$!params.get("${method3}")">${quote})</nobr></a>
</td>
- <td valign="top">
+ <td class="demo" valign="top">
#if( $params.get(${method1}) )
${esc.d}${toolname}.${method}(${quote}$!params.get(${method1})${quote},
${quote}$!params.get(${method2})${quote},
${quote}$!params.get(${method3})${quote})
=
@@ -212,7 +212,7 @@
#end
#end
</td>
- <td valign="top">$description</td>
+ <td class="desc" valign="top">$description</td>
</form>
</tr>
#end
@@ -223,12 +223,12 @@
#macro( demoCustom $toolname )
<tr>
<form method="get" action="$link.anchor('custom')">
- <td valign="top">
+ <td class="method" valign="top">
<a name="custom">
<input type="text" size="30" name="custom" value="#if( $params.custom
)$params.custom#else$esc.d$toolname#end">
</a>
</td>
- <td valign="top">
+ <td class="demo" valign="top">
#if( $params.custom )
$params.custom
=
@@ -245,7 +245,7 @@
#end
#end
</td>
- <td>$text.demo.tryAnything</td>
+ <td class="desc" >$text.demo.tryAnything</td>
</form>
</tr>
#end
Modified: velocity/tools/trunk/examples/showcase/demo.vm
URL:
http://svn.apache.org/viewvc/velocity/tools/trunk/examples/showcase/demo.vm?rev=740388&r1=740387&r2=740388&view=diff
==============================================================================
--- velocity/tools/trunk/examples/showcase/demo.vm (original)
+++ velocity/tools/trunk/examples/showcase/demo.vm Tue Feb 3 19:34:39 2009
@@ -49,19 +49,20 @@
</tr>
## generate a demo for each method (except the configure(Map) method)
#foreach( $method in $loop.watch($tool.methods).exclude('method
configure(java.util.Map)') )
+#if( (!$skip or !$skip.contains($method.uniqueName)) and (!$skipAll or
!$skipAll.contains($method.name)) )
<tr>
## create a fake call of the method to use as the name/signature
#set( $call = "${esc.d}${toolname}.#if( !$method.takesParameters() &&
$method.propertyName )$method.propertyName#else$method.signature#end" )
- <td valign="top"><a href="$toollink#$method.javadocRef">$call</a></td>
+ <td class="method" valign="top"><a
href="$toollink#$method.javadocRef">$call</a></td>
#if( !$method.takesParameters() )
## simply call the method
#set( $result = $call )
#set( $result = $render.eval($call) )
- <td valign="top" id="${method.javadocRef}">#if( $result == $call
)$text.demo.nullResult#else$esc.xml($result)#end</td>
+ <td class="demo" valign="top" id="${method.javadocRef}">#if( $result ==
$call )$text.demo.nullResult#else$esc.xml($result)#end</td>
#else
## create a form to allow the user to input values and call the method
- <form method="get" name="$method.uniqueName"
action="$link.self.anchor($method.javadocRef)"> ## HttpUnit doesn't like
anchor-only links
- <td valign="top">
+ <form method="get" name="$method.uniqueName"
action="$link.self.anchor($link.decode($method.javadocRef))"> ## HttpUnit
doesn't like anchor-only links
+ <td class="demo" valign="top">
<nobr>
## create a text field for each parameter
## whose size is inversely proportional to the number of fields
@@ -71,8 +72,16 @@
## look for a default value
#set( $fielddefault =
$text.get("${toolname}.${method.uniqueName}.param$velocityCount") )
#if( !$fielddefault.exists )
- ## generate a reasonable default for the param type
- #set( $fielddefault = "#demoDefault( $param )" )
+ ## look for a default for this type for this method
+ #set( $fielddefault =
$text.get("${toolname}.${method.name}.$param.simpleName") )
+ #if( !$fielddefault.exists )
+ ## look for a default for this type for this tool
+ #set( $fielddefault = $text.get("${toolname}.$param.simpleName") )
+ #if( !$fielddefault.exists )
+ ## generate a reasonable default for the param type
+ #set( $fielddefault = "#demoDefault( $param )" )
+ #end
+ #end
#end
## look for a value in the params, use the default if none is found
#set( $fieldvalue = $display.alt($params.get($fieldname),
$fielddefault) )
@@ -113,7 +122,7 @@
## look for a tool-specific generic property description
#set( $desc =
$text.get("${toolname}.propertyDescription").insert($method.propertyName) )
#else
- ## look for a generic method descirption for the tool
+ ## look for a generic method description for the tool
#set( $desc = $text.get("${toolname}.methodDescription") )
#end
#if( !$desc.exists )
@@ -122,18 +131,19 @@
#set( $desc = $demo.toString )
#else
## use the generic description missing message
- #set( $desc = $demo.descriptionMissing )
+ #set( $desc =
$demo.descriptionMissing.insert("${toolname}.${method.uniqueName}") )
#end
#end
#end
#end
- <td valign="top">$desc</td>
+ <td class="desc" valign="top">$desc</td>
</tr>
#end
+#end
<tr>
## create a space for an extended, custom, one line demo
<form method="get" action="$link.self.anchor('custom')">
- <td valign="top" colspan="2" id="custom">
+ <td class="demo" valign="top" colspan="2" id="custom">
## first check the params for a custom demo
#set( $custom = $params.getValue('custom', false) )
## then look for a default in the resources
Modified: velocity/tools/trunk/examples/showcase/layout/layout.css
URL:
http://svn.apache.org/viewvc/velocity/tools/trunk/examples/showcase/layout/layout.css?rev=740388&r1=740387&r2=740388&view=diff
==============================================================================
--- velocity/tools/trunk/examples/showcase/layout/layout.css (original)
+++ velocity/tools/trunk/examples/showcase/layout/layout.css Tue Feb 3
19:34:39 2009
@@ -56,6 +56,16 @@
a:visited {color:#07a;}
a:hover {background-color:#eee;}
+td.method a {
+ font-weight: 400;
+}
+td.demo, td.demo input {
+ font-size: 10px;
+}
+td.desc {
+ font-size: 10px;
+}
+
/* All the content boxes belong to the content class. */
.content {