Module xaos.ui

Interface FileExtensionIconProvider


  • public interface FileExtensionIconProvider
    Provides icons (i.e. square Nodes) for a given file extension.
    Author:
    claudio.rosati@esss.se
    • Method Detail

      • iconFor

        Node iconFor​(String extension,
                     int size)
        Return an icon (i.e. a square Node for the given file extension. A file extension is string following the last '.' in the file's pathname.
        Parameters:
        extension - File extension for which a graphical representation is needed. Implementation should discard the first character if equal to '.'. Can be null.
        size - The size of the square Node to be returned.
        Returns:
        An icon as a Node instance, or null if extension is null or empty, size <= 0, or no suitable representation can be found.
      • extensionFor

        static String extensionFor​(Path path)
        Parameters:
        path - The Path for which the extension must be returned.
        Returns:
        The extension for the given Path, or null if it is null, is not a file or it has no extension.