Class FilenameTabCompleter

    • Constructor Detail

      • FilenameTabCompleter

        public FilenameTabCompleter​(CommandContext ctx)
    • Method Detail

      • getCandidates

        protected int getCandidates​(String buffer,
                                    List<String> candidates)
      • translatePath

        public String translatePath​(String path)
        Translate a path that has previously been unescaped and unquoted. That is called at command execution when the calue is retrieved prior to be used as ModelNode value.
        Parameters:
        path - The unquoted, unescaped path.
        Returns:
        A path with ~ and default dir expanded.
      • matchFiles

        protected int matchFiles​(String buffer,
                                 String translated,
                                 File[] entries,
                                 List<String> candidates)
        Match the specified buffer to the array of entries and enter the matches into the list of candidates. This method can be overridden in a subclass that wants to do more sophisticated file name completion.
        Parameters:
        buffer - the untranslated buffer
        translated - the buffer with common characters replaced
        entries - the list of files to match
        candidates - the list of candidates to populate
        Returns:
        the offset of the match