Class FilePropertyDescriptor
java.lang.Object
java.beans.FeatureDescriptor
java.beans.PropertyDescriptor
com.install4j.api.beaninfo.Install4JPropertyDescriptor
com.install4j.api.beaninfo.FilePropertyDescriptor
Property descriptor for properties that contain one or several files.
The supported property types are
- java.io.File
ExternalFileLocalizedExternalFile- 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringSpecial context for properties of typecom.install4j.api.beans.ExternalFilethat 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_IDModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringDefault category used by install4j.static final StringSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the corner values of the anchor (north-west, north-east, south-west, south-east).static final StringSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the horizontal values of the anchor (west, center, east).static final StringSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the side values of the anchor (north, west, east, south).static final StringSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the vertical values of the anchor (north, center, south).static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of an installation component.static final StringSpecial context for properties of typejava.util.Datethat tells the install4j GUI to offer a time editor besides the default date editor as well.static final StringSame asInstall4JPropertyDescriptor.CONTEXT_COMPONENT_ID, but only downloadable installation components are selectable.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a form component.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to allow the user to enter an HTML document in a separate editor with syntax coloring and preview functionality.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a launcher.static final StringSame asInstall4JPropertyDescriptor.CONTEXT_LAUNCHER_ID, but with an additional "[Other executable]" entry that sets the id property to null.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to allow the user to enter multi-line strings in a separate dialog.static final StringSpecial context for properties of typejava.lang.Stringandjava.io.Filethat tells the install4j GUI not to offer installer variables in the text field for the property.static final StringSame asInstall4JPropertyDescriptor.CONTEXT_LAUNCHER_ID, but service launchers are not selectable.static final StringSame asInstall4JPropertyDescriptor.CONTEXT_LAUNCHER_ID, but only service launchers are selectable.static final StringSpecial context for properties of typejava.util.LinkedHashMapthat tells the install4j GUI that the map contains string keys and values and to offer a suitable converter and property customizer.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a style.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as an installer variable name.static final StringSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a widget style. -
Method Summary
Modifier and TypeMethodDescriptionstatic FilePropertyDescriptorcreate(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withsuffixes,filterNameandcontextset tonull.static FilePropertyDescriptorcreate(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String context) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withsuffixesandfilterNameset tonull.static FilePropertyDescriptorcreate(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withcontextset tonull.static FilePropertyDescriptorcreate(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName, String context) Create a file property descriptor as withInstall4JPropertyDescriptor.create(String, Class, String, String)and additional configuration specific to file properties.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, setVisibilityDiscriminatorModifier and TypeMethodDescriptionstatic Install4JPropertyDescriptorSame asInstall4JPropertyDescriptor.create(String, Class, String, String, String)with acontextofnull.static Install4JPropertyDescriptorcreate(String propertyName, Class beanClass, String displayName, String shortDescription, String context) Create a property descriptor that can be passed toInstall4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor).static Install4JPropertyDescriptorcreateNested(String propertyName, Class beanClass) Same asInstall4JPropertyDescriptor.createNested(String, String, Class)with anestedBeanCategoryofnull.static Install4JPropertyDescriptorcreateNested(String propertyName, String nestedBeanCategory, Class beanClass) Same asInstall4JPropertyDescriptor.createNested(String, String, Class, PropertyFilter)with apropertyFilterofname -> true.static Install4JPropertyDescriptorcreateNested(String propertyName, String nestedBeanCategory, Class beanClass, PropertyFilter propertyFilter) Create a property descriptor for a nested bean that can be passed toInstall4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor).setActionListHiddenKeys(String[] hiddenKeys) Hide this property if the bean is shown in the configuration of an action list property whose configured action keys contain one of the specified strings.setActionListShownKeys(String[] shownKeys) Show this property only if the bean is shown in the configuration of an action list property whose configured action keys contain one of the specified strings.setAllowTextOverride(boolean allowTextOverride) Allow the user to switch to text mode in the context menu when editing the property in the install4j IDE.setContext(String editorContext) Set the context for the property.voidsetDisplayName(String displayName) setEmptyMessage(String message) If the value isnullor empty, display a special text in a shaded color in the install4j IDE.Do not show this property if the bean is shown in the configuration of the action list.setNestedBean(boolean nestedBean) Mark a property as a nested bean.setNestedBeanCategory(String category) Set the category for properties of the nested bean.setNestedBeanPropertyFilter(PropertyFilter propertyFilter) Set a propertyFilter for properties of the nested bean.setParentProperty(String parentProperty) Set the parent property under which this property should be shown in the install4j IDE.voidsetPreferred(boolean preferred) Highlight a property as important.setPropertyCategory(String propertyCategory) Configures the property category.Set a property change listener that is invoked when the property is changed in the IDE.setSortKey(Integer sortKey) Set an integer key by which properties are sorted.setSuggestedValues(String[] values) Enable auto-completion of a list of values when using the text field property editor in the install4j IDE.setVariableValueClass(Class variableClass) Set the class of the variable value, ifInstall4JPropertyDescriptor.CONTEXT_VARIABLE_NAMEis set.setVisibilityDiscriminator(VisibilityDiscriminator visibilityDiscriminator) Sets a visibility discriminator for this property.Methods inherited from class PropertyDescriptor
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethodMethods inherited from class FeatureDescriptor
attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setExpert, setHidden, setName, setShortDescription, setValue, toString
-
Field Details
-
ATTRIBUTE_SELECTION_MODE
- See Also:
-
ATTRIBUTE_SUFFIXES
- See Also:
-
ATTRIBUTE_FILTER_NAME
- See Also:
-
ATTRIBUTE_FILE_CONTENT_TYPE
- See Also:
-
CONTEXT_EXTERNAL_OR_INTERNAL
Special context for properties of typecom.install4j.api.beans.ExternalFilethat 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.contentDir}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:
-
-
Method Details
-
create
public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withsuffixes,filterNameandcontextset tonull. -
create
public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String context) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withsuffixesandfilterNameset tonull. -
create
public static FilePropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, FileSelectionMode selectionMode, String[] suffixes, String filterName) Same ascreate(String, Class, String, String, FileSelectionMode, String[], String, String)withcontextset tonull. -
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 withInstall4JPropertyDescriptor.create(String, Class, String, String)and additional configuration specific to file properties.- Parameters:
selectionMode- the file selection mode when the user invokes the file choosersuffixes- the accepted suffixes in the file chooserfilterName- the filter name in the file choosercontext- the context. The context allows specifying different editors for the same property types. See theCONTEXT_*properties for the built-in contexts.- Returns:
- the property descriptor
-
setFileContentType
Set the file content type. The install4j IDE can create some file types as described in the documentation forFileContentType. 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
-