Class DirectoryChooserPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class DirectoryChooserPanel extends AbstractChooserPanel<File>
A panel that contains a text field with the current directory and a button for bringing up a BaseDirectoryChooser.
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Details

    • m_DirectoryChooser

      protected BaseDirectoryChooser m_DirectoryChooser
      the JFileChooser for selecting a file.
  • Constructor Details

    • DirectoryChooserPanel

      public DirectoryChooserPanel()
      Initializes the panel with no file.
    • DirectoryChooserPanel

      public DirectoryChooserPanel(String path)
      Initializes the panel with the given filename/directory.
      Parameters:
      path - the filename/directory to use
    • DirectoryChooserPanel

      public DirectoryChooserPanel(File path)
      Initializes the panel with the given filename/directory.
      Parameters:
      path - the filename/directory to use
  • Method Details

    • initialize

      protected void initialize()
      Initializes the members.
      Overrides:
      initialize in class AbstractChooserPanel<File>
    • doChoose

      protected File doChoose()
      Performs the actual choosing of an object.
      Specified by:
      doChoose in class AbstractChooserPanel<File>
      Returns:
      the chosen object or null if none chosen
    • toString

      protected String toString(File value)
      Converts the value into its string representation.
      Specified by:
      toString in class AbstractChooserPanel<File>
      Parameters:
      value - the value to convert
      Returns:
      the generated string
    • fromString

      protected File fromString(String value)
      Converts the string representation into its object representation.
      Specified by:
      fromString in class AbstractChooserPanel<File>
      Parameters:
      value - the string value to convert
      Returns:
      the generated object
    • setCurrentDirectory

      public void setCurrentDirectory(String value)
      Sets the current directory.
      Parameters:
      value - the current directory
      See Also:
    • getCurrentDirectory

      public String getCurrentDirectory()
      Returns the current directory.
      Returns:
      the current directory
      See Also:
    • setCurrent

      public boolean setCurrent(File value)
      Sets the current value.
      Overrides:
      setCurrent in class AbstractChooserPanel<File>
      Parameters:
      value - the value to use, can be null
      Returns:
      true if successfully set
    • getChooserType

      public String getChooserType()
      Returns the type of chooser (description).
      Returns:
      the type