You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by nb...@apache.org on 2006/11/30 09:05:16 UTC

svn commit: r480868 - /jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java

Author: nbubna
Date: Thu Nov 30 00:05:13 2006
New Revision: 480868

URL: http://svn.apache.org/viewvc?view=rev&rev=480868
Log:
add getThis() for easy access to the ViewContext being used

Modified:
    jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java

Modified: jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java
URL: http://svn.apache.org/viewvc/jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java?view=diff&rev=480868&r1=480867&r2=480868
==============================================================================
--- jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java (original)
+++ jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/tools/ContextTool.java Thu Nov 30 00:05:13 2006
@@ -101,6 +101,14 @@
 
 
     /**
+     * Returns the context being analyzed by this tool.
+     */
+    public ViewContext getThis()
+    {
+        return this.context;
+    }
+
+    /**
      * <p>Returns a read-only view of the toolbox {@link Map}
      * for this context.</p>
      * @return an unmodifiable version of the toolbox for this request



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: svn commit: r480868 -

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Nathan Bubna" <nb...@gmail.com> writes:

Ok. Looks fine to me.

	Best regards
		Henning



>In 1.3, i've been on something of a push to simplify the syntax and
>readability of how tools are used in templates.  The idea is to make
>an elegant, simple VTL interface for these tools, even if it looks odd
>from a java perspective.  Given the choice between:

>$context.context  and   $context.this

>i consider the latter to be the most elegant and self-explanatory.

>On 11/30/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
>> nbubna@apache.org writes:
>>
>> >+    public ViewContext getThis()
>>
>> getThis? Do we already have a "getContext()"?
>>
>>         Best regards
>>                 Henning
>>
>> --
>> Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,
>> 91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
>> Open Source Consulting, Development, Design | Velocity - Turbine guy
>>
>>           "Save the cheerleader. Save the world."
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: dev-help@velocity.apache.org
>>
>>

>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
>For additional commands, e-mail: dev-help@velocity.apache.org

-- 
Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy

          "Save the cheerleader. Save the world."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: svn commit: r480868 -

Posted by Nathan Bubna <nb...@gmail.com>.
In 1.3, i've been on something of a push to simplify the syntax and
readability of how tools are used in templates.  The idea is to make
an elegant, simple VTL interface for these tools, even if it looks odd
from a java perspective.  Given the choice between:

$context.context  and   $context.this

i consider the latter to be the most elegant and self-explanatory.

On 11/30/06, Henning P. Schmiedehausen <hp...@intermeta.de> wrote:
> nbubna@apache.org writes:
>
> >+    public ViewContext getThis()
>
> getThis? Do we already have a "getContext()"?
>
>         Best regards
>                 Henning
>
> --
> Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,
> 91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
> Open Source Consulting, Development, Design | Velocity - Turbine guy
>
>           "Save the cheerleader. Save the world."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Re: svn commit: r480868 -

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
nbubna@apache.org writes:

>+    public ViewContext getThis()

getThis? Do we already have a "getContext()"?

	Best regards
		Henning

-- 
Henning P. Schmiedehausen  -- hps@intermeta.de | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy

          "Save the cheerleader. Save the world."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org