Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-113

new DisplayTool features

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.0
    • GenericTools
    • None

    Description

      More ideas from the dev list:
      ----------------------------------------------------------------------------------------------
      On Sat, Feb 7, 2009 at 3:41 PM, <serg472@gmail.com> wrote:
      Hello,
      I wanted to share with you a few ideas I have about new simple
      improvements for DisplayTools. I should be able to make patches for
      them if you are interested.

      #snip

      2. Add new "property" parameter to

      list(Object list, String delim, String finaldelim, String property)

      method that will format an array or collection of objects on selected
      property (similar to SortTools).

      3. Add new method:

      stripTags(Object obj, String... allowedTags)

      that will strip all (html) tags from the text except those listed in
      allowedTags (allowed tags are passed like this: "br","img","p").

      4. Add new method:

      br(Object obj)

      that will replace \n with "<br />\n"

      5. Add new "preserveWords" parameter to:

      truncate(Object truncateMe, int maxLength, String suffix, boolean preserveWords)

      that will truncate a string to a last complete word within maxLength
      instead of exact character.

      Attachments

        1. DisplayTool.patch
          10 kB
          Sergiy Kovalchuk
        2. DisplayToolTests.patch
          6 kB
          Sergiy Kovalchuk

        Activity

          People

            Unassigned Unassigned
            nbubna Nathan Bubna
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: