Class FileProperty

  • All Implemented Interfaces:
    PropertyVisitorAcceptor, java.lang.Cloneable

    @OpenApiAll
    public class FileProperty
    extends Property
    The property for storing and editing some java.io.File value.
    See Also:
    File
    • Field Detail

      • FILES_ONLY

        public static final int FILES_ONLY
        Instruction to choose only files.
        See Also:
        Constant Field Values
      • DIRECTORIES_ONLY

        public static final int DIRECTORIES_ONLY
        Instruction to choose only directories.
        See Also:
        Constant Field Values
      • FILES_AND_DIRECTORIES

        public static final int FILES_AND_DIRECTORIES
        Instruction to choose both files and directories.
        See Also:
        Constant Field Values
      • mSelectionMode

        private int mSelectionMode
        File type (file or directory or both) selection model for this property.
      • mDisplayFullPath

        private boolean mDisplayFullPath
        Controls if full file path should be visible to the user in the property editor.
      • mUseFilePreviewer

        private boolean mUseFilePreviewer
        Controls if file preview should be used when selecting file from the file system.
      • mDisplayAllFiles

        private boolean mDisplayAllFiles
        Controls if all files option should be allowed for property file selection dialog.
      • FILE_TYPE_ANY

        @Deprecated
        public static final java.lang.String FILE_TYPE_ANY
        Deprecated.
        File type constant for any file.
        See Also:
        Constant Field Values
      • FILE_TYPE_IMAGE

        @Deprecated
        public static final java.lang.String FILE_TYPE_IMAGE
        Deprecated.
        File type constant for image file.
        See Also:
        Constant Field Values
      • mFileType

        @Deprecated
        private java.lang.String mFileType
        Deprecated.
        File type supported by this property.
      • mFileExtensions

        private java.util.List<java.lang.String> mFileExtensions
        Supported file extensions.
    • Constructor Detail

      • FileProperty

        public FileProperty()
        Default constructor. Value of the property will be null. ID will be empty string.
      • FileProperty

        public FileProperty​(java.lang.String id,
                            java.lang.String path)
        The property constructor. The selection model will be FILES_ONLY.
        Parameters:
        id - the ID of property.
        path - the file path.
      • FileProperty

        public FileProperty​(java.lang.String id,
                            java.lang.String path,
                            int selectionMode)
        The property constructor.
        Parameters:
        id - the ID of property.
        path - the file path.
        selectionMode - the file selection mode - FILES_ONLY, DIRECTORIES_ONLY or FILES_AND_DIRECTORIES.
    • Method Detail

      • setSelectionMode

        public void setSelectionMode​(int selectionMode)
        Sets the file selection mode for this property.
        Parameters:
        selectionMode - the file selection mode. Possible values are FILES_ONLY, DIRECTORIES_ONLY and FILES_AND_DIRECTORIES.
      • getSelectionMode

        public int getSelectionMode()
        Returns file selection mode.
        Returns:
        file selection mode.
      • constructRepresentationText

        private java.lang.String constructRepresentationText​(java.lang.String text)
      • setValue

        public void setValue​(@CheckForNull
                             java.lang.Object value)
        Description copied from class: Property
        Sets new property value. Will fire a PropertyChangeEvent with propertyName - property ID, newValue and oldValue.
        Overrides:
        setValue in class Property
        Parameters:
        value - a new property value.
        See Also:
        Property.setValue(java.lang.Object)
      • setPathAndCollapse

        public void setPathAndCollapse​(java.lang.String path)
        Set Path and Collapse it by using path variables.
        Parameters:
        path - Path string.
      • getPathAndExpand

        public java.lang.String getPathAndExpand​(@CheckForNull
                                                 java.lang.String purpose)
                                          throws RecursivePathVariableException
        Get expanded (using path variables) path.
        Parameters:
        purpose - used in an undefined-path-variable prompt for a user, e.g. 'The path variable <variable> used for <purpose> is not set.
        Returns:
        Path String.
        Throws:
        RecursivePathVariableException - in case of error
      • setDisplayFullPath

        public void setDisplayFullPath​(boolean displayFullPath)
        Sets display full path flag.
        Parameters:
        displayFullPath - - display full path flag.
      • isDisplayFullPath

        public boolean isDisplayFullPath()
        Returns display full path flag.
        Returns:
        display full path flag.
      • isUseFilePreviewer

        public boolean isUseFilePreviewer()
        Returns use file preview flag.
        Returns:
        use file preview flag.
      • setUseFilePreviewer

        public void setUseFilePreviewer​(boolean useFilePreviewer)
        Sets use file previewer flag.
        Parameters:
        useFilePreviewer - - use file previewer flag.
      • isDisplayAllFiles

        public boolean isDisplayAllFiles()
        Returns display all files flag.
        Returns:
        display all files flag.
      • setDisplayAllFiles

        public void setDisplayAllFiles​(boolean displayAllFiles)
        Sets display all files flag.
        Parameters:
        displayAllFiles - - display all files flag.
      • getFileType

        @Deprecated
        public java.lang.String getFileType()
        Deprecated.
        Gets supported file type.
        Returns:
        file type
      • setFileType

        @Deprecated
        public void setFileType​(@CheckForNull
                                java.lang.String fileType)
        Sets supported file type.
        Parameters:
        fileType - - type of the file.
      • getFileExtensions

        @CheckForNull
        public java.util.List<java.lang.String> getFileExtensions()
        Get supported file extensions.
        Returns:
        file extensions.
      • setFileExtensions

        public void setFileExtensions​(java.util.List<java.lang.String> fileExtensions)
        Set supported file extensions.
        Parameters:
        fileExtensions - file extensions.
      • clone

        public FileProperty clone()
        Description copied from class: Property
        Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
        Overrides:
        clone in class Property
        Returns:
        the cloned property.