Class AbstractAutoloadManager

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public abstract class AbstractAutoloadManager extends JDialog
A dialog for managing autoloadable functions for a FunctionTool. The functions are organized by search directory and fileName. Each function is described by a name, expression and optional descriptor (eg track type for TrackDataBuilder.AutoloadManager).
Author:
Douglas Brown
See Also:
  • Field Details

    • initialized

      protected boolean initialized
  • Constructor Details

    • AbstractAutoloadManager

      protected AbstractAutoloadManager(JDialog dialog)
      Constructor for a dialog, typically a FunctionTool.
      Parameters:
      dialog - the dialog
  • Method Details

    • setAutoloadData

      public void setAutoloadData(Map<String,Map<String,ArrayList<String[]>>> data)
      Sets the autoload data. The data is a map of directory path to directory contents, where directory contents is a map of file path to file contents, file contents is a list of function arrays, and each function array is {String name, String expression, optional String descriptor)
      Parameters:
      data - the data
    • setInstructions

      public void setInstructions(String instructions)
      Sets the instructions describing how to use this manager.
      Parameters:
      instructions - the instructions
    • addSearchPath

      public void addSearchPath(String dir)
      Add a search path.
      Parameters:
      dir - the (directory) search path to add
    • getSearchPaths

      public Collection<String> getSearchPaths()
      Gets the collection (shallow clone) of search paths.
      Returns:
      the search paths
    • createGUI

      protected void createGUI()
      Creates the GUI.
    • refreshGUI

      protected void refreshGUI()
      Refreshes the GUI including locale-based resource strings.
    • refreshFunctionList

      protected void refreshFunctionList()
      Refreshes the function list.
    • setFontLevel

      public void setFontLevel(int level)
      Sets the font level.
      Parameters:
      level - the desired font level
    • getAllFunctions

      public String[][] getAllFunctions(String filePath)
    • setFunctionSelected

      protected void setFunctionSelected(String filePath, String[] function, boolean select)
      Sets the selection state of a function.
      Parameters:
      filePath - the path to the file defining the function
      function - the function {name, expression, optional descriptor}
      select - true to select the function
    • isFunctionSelected

      protected boolean isFunctionSelected(String filePath, String[] function)
      Gets the selection state of a function.
      Parameters:
      filePath - the path to the file defining the function
      function - the function {name, expression, optional descriptor}
      Returns:
      true if the function is selected
    • setFileSelected

      protected void setFileSelected(String filePath, boolean select)
      Sets the selection state of a file.
      Parameters:
      filePath - the path to the file
      select - true to select the file
    • getExclusionsMap

      protected abstract Map<String,String[]> getExclusionsMap()
      Gets the exclusions map, mapping filePath to array of excluded function names.
    • isFileSelected

      protected boolean isFileSelected(String filePath)
      Gets the selection state of a file.
      Parameters:
      filePath - the path to the file
      Returns:
      true if selected
    • refreshAutoloadData

      protected abstract void refreshAutoloadData()
      Refreshes the autoload data.