Class LinkedFileFormatter

java.lang.Object
net.sf.basedb.clients.web.formatter.LinkedFileFormatter
All Implemented Interfaces:
Formatter<File>

public class LinkedFileFormatter
extends Object
implements Formatter<File>
Formatter implementation that generates a HTML output linking a file item. EDIT, VIEW and DOWNLOAD links are created by default.
Since:
3.17
Author:
nicklas
See Also:
Base.getLinkedFile(String, File, boolean, boolean, boolean, String)
  • Field Details

    • enableViewDownload

      private final boolean enableViewDownload
    • fileViewer

      private final FileViewerUtil fileViewer
  • Constructor Details

    • LinkedFileFormatter

      public LinkedFileFormatter()
    • LinkedFileFormatter

      public LinkedFileFormatter​(FileViewerUtil fileViewer)
    • LinkedFileFormatter

      public LinkedFileFormatter​(boolean enableEditLink, boolean enableViewDownload)
  • Method Details

    • format

      public String format​(File file)
      Description copied from interface: Formatter
      Format a value by converting it to a string.
      Specified by:
      format in interface Formatter<File>
      Parameters:
      file - The value to format
      Returns:
      A formatted string
    • parseString

      public File parseString​(String value)
      Description copied from interface: Formatter
      Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.
      Specified by:
      parseString in interface Formatter<File>
      Parameters:
      value - The string to parse
      Returns:
      An object