Class FileDescriptor

java.lang.Object
com.motivewave.platform.sdk.common.desc.SettingDescriptor<File>
com.motivewave.platform.sdk.common.desc.FileDescriptor

public class FileDescriptor extends SettingDescriptor<File>
Describes a File Input.
  • Constructor Details

    • FileDescriptor

      public FileDescriptor(String name, String label, File file)
      Constructor
      Parameters:
      name - name of this setting
      label - label displayed to the user
      file - default file value
    • FileDescriptor

      public FileDescriptor(String name, String label, File file, boolean enabled, boolean supportsDisable)
      Constructor
      Parameters:
      name - - Name of this setting
      label - - Label displayed to the user
      file - - default file value
      enabled - true if this file input is enabled
      supportsDisable - true if this file input can be disabled
  • Method Details

    • getDefaultValue

      public File getDefaultValue()
      Gets the default value for this setting.
      Overrides:
      getDefaultValue in class SettingDescriptor<File>
      Returns:
      default value for the setting
    • createInputFX

      public javafx.scene.Node createInputFX(Settings settings, boolean readOnly)
      Creates an editor for this input and returns it as a JavaFX Node.
      Specified by:
      createInputFX in class SettingDescriptor<File>
      Parameters:
      settings - settings for the study
      readOnly - true if the component should not accept user input
      Returns:
      component that will accept user input.
    • isDisplaySetting

      public boolean isDisplaySetting()
      Determines if this setting is used for display purposes only.
      Overrides:
      isDisplaySetting in class SettingDescriptor<File>
      Returns:
      true if this setting is for display purposes only
    • getFile

      public File getFile()
      Gets the File.
      Returns:
      File
    • setExtensions

      public void setExtensions(List<String> extensions)
      Sets the list of file extensions to filter in the file chooser dialog. For example: *.txt, *.TXT
      Parameters:
      extensions - list of file extensions in the form '*.ext'
    • getExtensions

      public List<String> getExtensions()
      Gets the list of file extensions to filter in the file chooser dialog. For example: *.txt, *.TXT
      Returns:
      file extensions used to filter in the file chooser dialog in the form '*.ext'.
    • getFilterName

      public String getFilterName()
      Gets the name of the filter to display when showing the file chooser dialog.
      Returns:
      filter name
    • setFilterName

      public void setFilterName(String filterName)
      Sets the name of the filter to display when showing the file chooser dialog.
      Parameters:
      filterName - filter name
    • fromJson

      public Object fromJson(Object json)
      Overrides:
      fromJson in class SettingDescriptor<File>