Class FileChooserOption

All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class FileChooserOption extends AbstractOption
This option encapsulates a file chooser control. It is composed of three components: a label, a text field containing the file name, and a button used to pop up a file chooser dialog.
Author:
Laurent Cohen
See Also:
  • Field Details

    • OPEN

      public static final int OPEN
      The file chooser is for opening files.
      See Also:
    • SAVE

      public static final int SAVE
      The file chooser is for saving files.
      See Also:
  • Constructor Details

    • FileChooserOption

      public FileChooserOption()
      Default constructor.
    • FileChooserOption

      public FileChooserOption(String name, String label, String tooltip, String value, int dialogType)
      Initialize this combo box option with the specified parameters.
      Parameters:
      name - this component's name.
      label - the label displayed with the checkbox.
      tooltip - the tooltip associated with the combobox.
      value - the initially selected value of this component.
      dialogType - determines the type of file chooser dialog, either open or save.
  • Method Details

    • createUI

      public void createUI()
      Create the UI components for this option.
      Specified by:
      createUI in class AbstractOptionProperties
    • setupValueChangeNotifications

      protected void setupValueChangeNotifications()
      Define a selection listener that will forward changes to the chosen file name to all value change listeners that registered with this option.
      Specified by:
      setupValueChangeNotifications in class AbstractOption
    • setEnabled

      public void setEnabled(boolean enabled)
      Enable or disable this option.
      Parameters:
      enabled - true to enable this option, false to disable it.
    • doChooseFile

      public void doChooseFile()
      Select a file using a chooser dialog and according to this option's specifications.
    • getDialogType

      public int getDialogType()
      Get the type of the file chooser dialog.
      Returns:
      the type as an int value.
    • setDialogType

      public void setDialogType(int dialogType)
      Set the type of the file chooser dialog.
      Parameters:
      dialogType - the type as an int value.
    • getExtensions

      public String getExtensions()
      Get the list of extensions for the files the user can select.
      Returns:
      the extensions as a string.
      See Also:
    • setExtensions

      public void setExtensions(String extensions)
      Set the list of extensions for the files the user can select.
      Parameters:
      extensions - the extensions as a string with the format ext1; desc1 | ... | extN; descN.