Class JaxoChooseFile


  • public class JaxoChooseFile
    extends java.lang.Object
    Opens a file chooser dialog that is used for opening, saving and exporting files.
    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      JaxoChooseFile​(java.awt.Component parentc)
      Constructor.
      JaxoChooseFile​(java.awt.Component parentc, java.lang.String text)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String chooseFile​(java.lang.String[] allowedExtensions, java.lang.String description, java.lang.String selectedFile)
      Brings up a file chooser dialog.
      java.lang.String getApproveText()
      Text for the JFileChooser approve button.
      java.awt.Component getComponentParent()
      Parent component for the dialog.
      java.lang.String getDialogTitle()
      Title to be used for dialogs.
      void setApproveText​(java.lang.String value)
      The text for the approve button.
      void setComponentParent​(java.awt.Component value)
      Sets the parent component.
      void setDialogTitle​(java.lang.String value)
      Sets the dialog title.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JaxoChooseFile

        public JaxoChooseFile​(java.awt.Component parentc)
        Constructor.
        Parameters:
        parentc - The parent component.
      • JaxoChooseFile

        public JaxoChooseFile​(java.awt.Component parentc,
                              java.lang.String text)
        Constructor.
        Parameters:
        parentc - The parent component.
        text - The text to use as a dialog title.
    • Method Detail

      • getComponentParent

        public final java.awt.Component getComponentParent()
        Parent component for the dialog.
        Returns:
        The parent component.
      • setComponentParent

        public void setComponentParent​(java.awt.Component value)
        Sets the parent component.
        Parameters:
        value - The parent component.
      • getApproveText

        public final java.lang.String getApproveText()
        Text for the JFileChooser approve button. Must be set.
        Returns:
        The approve button text.
      • setApproveText

        public void setApproveText​(java.lang.String value)
        The text for the approve button.
        Parameters:
        value - The approve button text.
      • getDialogTitle

        public final java.lang.String getDialogTitle()
        Title to be used for dialogs. If 'null' (the default), a default will be created using the approve text, but this is typically inferior to setting a custom one.
        Returns:
        The dialog title.
      • setDialogTitle

        public void setDialogTitle​(java.lang.String value)
        Sets the dialog title.
        Parameters:
        value - The dialog title.
      • chooseFile

        public final java.lang.String chooseFile​(java.lang.String[] allowedExtensions,
                                                 java.lang.String description,
                                                 java.lang.String selectedFile)
        Brings up a file chooser dialog.
        Parameters:
        selectedFile - A file that should be marked as pre-selected.
        allowedExtensions - Files with these extensions (and directories) will be shown. May be 'null' indication no filtering.
        description - A description of this dialog.
        Returns:
        A string with the absolute path of the chosen file, or an empty string, if no file was selected.