FilePropertyDescriptor (install4j API)
Description: declaration: package: com.install4j.api.beaninfo, class: FilePropertyDescriptor

# Class FilePropertyDescriptor

java.lang.Object
java.beans.FeatureDescriptor
java.beans.PropertyDescriptor
com.install4j.api.beaninfo.Install4JPropertyDescriptor
com.install4j.api.beaninfo.FilePropertyDescriptor

public class FilePropertyDescriptor extends Install4JPropertyDescriptor
Property descriptor for properties that contain one or several file. The supported property types are

- java.io.File
- `ExternalFile`
- `LocalizedExternalFile`
- File[]

Using this class is not strictly required. In principle, you could also set values for the `ATTRIBUTE_*` constants in the property descriptor of an unrelated property descriptor class.

See Also:
  - `ExternalFile`
  - `LocalizedExternalFile`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ATTRIBUTE_FILE_CONTENT_TYPE`
  `static final String`
  `ATTRIBUTE_FILTER_NAME`
  `static final String`
  `ATTRIBUTE_SELECTION_MODE`
  `static final String`
  `ATTRIBUTE_SUFFIXES`
  `static final String`
  `CONTEXT_EXTERNAL_OR_INTERNAL`
  Special context for properties of type `com.install4j.api.beans.ExternalFile` that tells the install4j GUI to offer the user the possibility to select a file from the distribution tree instead.

  ### Fields inherited from class Install4JPropertyDescriptor

  `ATTRIBUTE_ACTION_LIST_HIDDEN_KEYS, ATTRIBUTE_ACTION_LIST_SHOWN_KEYS, ATTRIBUTE_ALLOW_TEXT_OVERRIDE, ATTRIBUTE_CONTEXT, ATTRIBUTE_EMPTY_MESSAGE, ATTRIBUTE_NESTED_BEAN, ATTRIBUTE_NESTED_BEAN_CATEGORY, ATTRIBUTE_NESTED_BEAN_PROPERTY_FILTER, ATTRIBUTE_PARENT_PROPERTY, ATTRIBUTE_PROPERTY_CATEGORY, ATTRIBUTE_PROPERTY_CHANGE_LISTENER, ATTRIBUTE_SORT_KEY, ATTRIBUTE_SUGGESTED_VALUES, ATTRIBUTE_VARIABLE_VALUE_CLASS, ATTRIBUTE_VISIBILITY_DISCRIMINATOR, CATEGORY_CONFIGURATION, CONTEXT_ANCHOR_CORNERS, CONTEXT_ANCHOR_HORIZONTAL, CONTEXT_ANCHOR_SIDES, CONTEXT_ANCHOR_VERTICAL, CONTEXT_COMPONENT_ID, CONTEXT_DATETIME, CONTEXT_DOWNLOADABLE_COMPONENT_ID, CONTEXT_FORM_COMPONENT_ID, CONTEXT_HTML, CONTEXT_LAUNCHER_ID, CONTEXT_LAUNCHER_ID_OR_OTHER, CONTEXT_MULTILINE, CONTEXT_NO_INSTALLER_VARIABLES, CONTEXT_NON_SERVICE_LAUNCHER_ID, CONTEXT_SERVICE_LAUNCHER_ID, CONTEXT_STRING_TO_STRING_MAP, CONTEXT_STYLE_ID, CONTEXT_VARIABLE_NAME, CONTEXT_WIDGET_STYLE_ID`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static FilePropertyDescriptor`
  `create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode)`
  Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `suffixes`, `filterName` and `context` set to `null`.
  `static FilePropertyDescriptor`
  `create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String context)`
  Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `suffixes` and `filterName` set to `null`.
  `static FilePropertyDescriptor`
  `create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName)`
  Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `context` set to `null`.
  `static FilePropertyDescriptor`
  `create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName, String context)`
  Create a file property descriptor as with `Install4JPropertyDescriptor.create(String, Class, String, String)` and additional configuration specific to file properties.
  `FilePropertyDescriptor`
  `setFileContentType(FileContentType fileContentType)`
  Set the file content type.

  ### Methods inherited from class Install4JPropertyDescriptor

  `create, create, createNested, createNested, createNested, setActionListHiddenKeys, setActionListShownKeys, setAllowTextOverride, setContext, setDisplayName, setEmptyMessage, setHiddenInActionLists, setNestedBean, setNestedBeanCategory, setNestedBeanPropertyFilter, setParentProperty, setPreferred, setPropertyCategory, setPropertyChangeListener, setSortKey, setSuggestedValues, setVariableValueClass, setVisibilityDiscriminator`

  ### Methods inherited from class PropertyDescriptor

  `createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod`

  ### Methods inherited from class FeatureDescriptor

  `attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setExpert, setHidden, setName, setShortDescription, setValue, toString`

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### ATTRIBUTE_SELECTION_MODE

    public static final String ATTRIBUTE_SELECTION_MODE
    See Also:
      - `create(String, Class, String, String, FileSelectionMode, String[], String)`
      - Constant Field Values

  - ### ATTRIBUTE_SUFFIXES

    public static final String ATTRIBUTE_SUFFIXES
    See Also:
      - `create(String, Class, String, String, FileSelectionMode, String[], String)`
      - Constant Field Values

  - ### ATTRIBUTE_FILTER_NAME

    public static final String ATTRIBUTE_FILTER_NAME
    See Also:
      - `create(String, Class, String, String, FileSelectionMode, String[], String)`
      - Constant Field Values

  - ### ATTRIBUTE_FILE_CONTENT_TYPE

    public static final String ATTRIBUTE_FILE_CONTENT_TYPE
    See Also:
      - `setFileContentType(FileContentType)`
      - Constant Field Values

  - ### CONTEXT_EXTERNAL_OR_INTERNAL

    public static final String CONTEXT_EXTERNAL_OR_INTERNAL
    Special context for properties of type `com.install4j.api.beans.ExternalFile` that tells the install4j GUI to offer the user the possibility to select a file from the distribution tree instead. The selected file will then be prepended with `${installer:sys.installationDir}` and will not be packaged separately. In that case, the enclosing action or screen can only be used if the "Install files" action has already run.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### create

    public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode)
    Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `suffixes`, `filterName` and `context` set to `null`.

  - ### create

    public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String context)
    Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `suffixes` and `filterName` set to `null`.

  - ### create

    public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName)
    Same as `create(String, Class, String, String, FileSelectionMode, String[], String, String)` with `context` set to `null`.

  - ### create

    public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName, String context)
    Create a file property descriptor as with `Install4JPropertyDescriptor.create(String, Class, String, String)` and additional configuration specific to file properties.
    Parameters:
      `selectionMode` - the file selection mode when the user invokes the file chooser
      `suffixes` - the accepted suffixes in the file chooser
      `filterName` - the filter name in the file chooser
      `context` - the context. The context allows specifying different editors for the same property types. See the `CONTEXT_*` properties for the built-in contexts.
    Returns:
      the property descriptor

  - ### setFileContentType

    public FilePropertyDescriptor setFileContentType(FileContentType fileContentType)
    Set the file content type. The install4j IDE can create some file types as described in the documentation for `FileContentType`. If you do not call this method, users will only be able to select the file, but there will be no way to create or edit a selected file.
    Parameters:
      `fileContentType` - the file content type
    Returns:
      `this`, for chained calls on this property descriptor