## install4j API documentation

## com.install4j.api.beaninfo
Class Install4JPropertyDescriptor

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

Direct Known Subclasses:
  FilePropertyDescriptor, ScriptPropertyDescriptor

    public class Install4JPropertyDescriptor

extends java.beans.PropertyDescriptor

Property descriptor for use in instances of `Install4JBeanInfo`. For file and script properties, derived classes are available.

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.

Field Summary
`static java.lang.String` | `ATTRIBUTE_CONTEXT`
`static java.lang.String` | `ATTRIBUTE_PARENT_PROPERTY`
`static java.lang.String` | `ATTRIBUTE_PROPERTY_CATEGORY`
`static java.lang.String` | `ATTRIBUTE_PROPERTY_CHANGE_LISTENER`
`static java.lang.String` | `ATTRIBUTE_SORT_KEY`
`static java.lang.String` | `ATTRIBUTE_VISIBILITY_DISCRIMINATOR`
`static java.lang.String` | `CATEGORY_CONFIGURATION` Default category used by install4j.
`static java.lang.String` | `CONTEXT_DATETIME` Special context for properties of type `java.util.Date` that tells the install4j GUI to offer a time editor besides the default date editor as well.
`static java.lang.String` | `CONTEXT_HTML` Special context for properties of type `java.lang.String` that tells the install4j GUI to allow the user to enter an HTML document in a separate editor with syntax coloring and preview functionality.
`static java.lang.String` | `CONTEXT_LAUNCHER_ID` Special context for properties of type `java.lang.String` that tells the install4j GUI to treat the string value as the id of a launcher.
`static java.lang.String` | `CONTEXT_MULTILINE` Special context for properties of type `java.lang.String` that tells the install4j GUI to allow the user to enter multi-line strings in a separate dialog.
`static java.lang.String` | `CONTEXT_NON_SERVICE_LAUNCHER_ID` Same as `CONTEXT_LAUNCHER_ID`, but service launchers are not selectable.
`static java.lang.String` | `CONTEXT_SERVICE_LAUNCHER_ID` Same as `CONTEXT_LAUNCHER_ID`, but only service launchers are selectable.
`static java.lang.String` | `CONTEXT_STRING_TO_STRING_MAP` Special context for properties of type `java.util.LinkedHashMap` that tells the install4j GUI that the map contains string keys and values and to offer a suitable converter and property customizer.

Method Summary
`static Install4JPropertyDescriptor` | `create(java.lang.String propertyName, java.lang.Class beanClass, java.lang.String displayName, java.lang.String shortDescription)` Same as `create(String, Class, String, String, String)` with a `context` of `null`.
`static Install4JPropertyDescriptor` | `create(java.lang.String propertyName, java.lang.Class beanClass, java.lang.String displayName, java.lang.String shortDescription, java.lang.String context)` Create a property descriptor that can be passed to `Install4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor)`.
`void` | `setContext(java.lang.String editorContext)` Set the context for the property.
`void` | `setDisplayName(java.lang.String displayName)`
`void` | `setParentProperty(java.lang.String parentProperty)` Set the parent property under which this property should be shown in the install4j IDE.
`void` | `setPropertyCategory(java.lang.String propertyCategory)` Configures the property category.
`void` | `setPropertyChangeListener(java.beans.PropertyChangeListener listener)` Set a property change listener that is invoked when the property is changed in the IDE.
`void` | `setSortKey(java.lang.Integer sortKey)` Set an integer key by which properties are sorted.
`void` | `setVisibilityDiscriminator(VisibilityDiscriminator visibilityDiscriminator)` Sets a visibility discriminator for this property.

Methods inherited from class java.beans.PropertyDescriptor
`createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod`

Methods inherited from class java.beans.FeatureDescriptor
`attributeNames, getDisplayName, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ATTRIBUTE_PROPERTY_CATEGORY

    public static final java.lang.String ATTRIBUTE_PROPERTY_CATEGORY

See Also:
  `setPropertyCategory(String)`, Constant Field Values

### CATEGORY_CONFIGURATION

    public static final java.lang.String CATEGORY_CONFIGURATION

  Default category used by install4j.

  See Also:
    Constant Field Values

### ATTRIBUTE_CONTEXT

    public static final java.lang.String ATTRIBUTE_CONTEXT

See Also:
  `create(String, Class, String, String, String)`, Constant Field Values

### CONTEXT_LAUNCHER_ID

    public static final java.lang.String CONTEXT_LAUNCHER_ID

  Special context for properties of type `java.lang.String` that tells the install4j GUI to treat the string value as the id of a launcher. In the property panel, a drop-down list of all defined launchers will be shown.

  See Also:
    Constant Field Values

### CONTEXT_NON_SERVICE_LAUNCHER_ID

    public static final java.lang.String CONTEXT_NON_SERVICE_LAUNCHER_ID

  Same as `CONTEXT_LAUNCHER_ID`, but service launchers are not selectable.

  See Also:
    Constant Field Values

### CONTEXT_SERVICE_LAUNCHER_ID

    public static final java.lang.String CONTEXT_SERVICE_LAUNCHER_ID

  Same as `CONTEXT_LAUNCHER_ID`, but only service launchers are selectable.

  See Also:
    Constant Field Values

### CONTEXT_MULTILINE

    public static final java.lang.String CONTEXT_MULTILINE

  Special context for properties of type `java.lang.String` that tells the install4j GUI to allow the user to enter multi-line strings in a separate dialog.

  See Also:
    Constant Field Values

### CONTEXT_HTML

    public static final java.lang.String CONTEXT_HTML

  Special context for properties of type `java.lang.String` that tells the install4j GUI to allow the user to enter an HTML document in a separate editor with syntax coloring and preview functionality.

  See Also:
    Constant Field Values

### CONTEXT_DATETIME

    public static final java.lang.String CONTEXT_DATETIME

  Special context for properties of type `java.util.Date` that tells the install4j GUI to offer a time editor besides the default date editor as well.

  See Also:
    Constant Field Values

### CONTEXT_STRING_TO_STRING_MAP

    public static final java.lang.String CONTEXT_STRING_TO_STRING_MAP

  Special context for properties of type `java.util.LinkedHashMap` that tells the install4j GUI that the map contains string keys and values and to offer a suitable converter and property customizer.

  See Also:
    Constant Field Values

### ATTRIBUTE_SORT_KEY

    public static final java.lang.String ATTRIBUTE_SORT_KEY

See Also:
  `setSortKey(Integer)`, Constant Field Values

### ATTRIBUTE_PROPERTY_CHANGE_LISTENER

    public static final java.lang.String ATTRIBUTE_PROPERTY_CHANGE_LISTENER

See Also:
  `setPropertyChangeListener(java.beans.PropertyChangeListener)`, Constant Field Values

### ATTRIBUTE_PARENT_PROPERTY

    public static final java.lang.String ATTRIBUTE_PARENT_PROPERTY

See Also:
  `setParentProperty(String)`, Constant Field Values

### ATTRIBUTE_VISIBILITY_DISCRIMINATOR

    public static final java.lang.String ATTRIBUTE_VISIBILITY_DISCRIMINATOR

See Also:
  `setVisibilityDiscriminator(VisibilityDiscriminator)`, Constant Field Values

Method Detail

### create

    public static Install4JPropertyDescriptor create(java.lang.String propertyName,
                                                     java.lang.Class beanClass,
                                                     java.lang.String displayName,
                                                     java.lang.String shortDescription)

  Same as `create(String, Class, String, String, String)` with a `context` of `null`.

### create

    public static Install4JPropertyDescriptor create(java.lang.String propertyName,
                                                     java.lang.Class beanClass,
                                                     java.lang.String displayName,
                                                     java.lang.String shortDescription,
                                                     java.lang.String context)

  Create a property descriptor that can be passed to `Install4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor)`.

  Parameters:
    `propertyName` - the name of the property
    `beanClass` - the class of the bean that contains th property. Note:This is not the class of the property.
    `displayName` - the display name of the property
    `shortDescription` - a short description of the property
    `context` - the context of the property. The context allows to specify different editors for the same property types. See the `CONTEXT_*` properties for the built-in contexts. This context is also used for enumerated properties in the `EnumerationMapper`. For properties of type `String[]`, you can pass an item name as the context.
  Returns:
    the property descriptor

### setContext

    public void setContext(java.lang.String editorContext)

  Set the context for the property.

  Parameters:
    `editorContext` - the context
  See Also:
    `for an explanation of the context.`

### setPropertyCategory

    public void setPropertyCategory(java.lang.String propertyCategory)

  Configures the property category. In the install4j GUI, properties are grouped by their categories. If no category has been specified, the default "Configuration" category is used.

  You can collapse certain categories by default with the `Install4JBeanInfo.setCollapsedPropertyCategories(String[])` method.

  Parameters:
    `propertyCategory` - the category

### setDisplayName

    public void setDisplayName(java.lang.String displayName)

  Overrides:
    `setDisplayName` in class `java.beans.FeatureDescriptor`

### setSortKey

    public void setSortKey(java.lang.Integer sortKey)

  Set an integer key by which properties are sorted. If no sort keys are specified, the properties will be sorted in the order they were added to the bean info.

  Parameters:
    `sortKey` - the sort key
  See Also:
    `Install4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor)`

### setPropertyChangeListener

    public void setPropertyChangeListener(java.beans.PropertyChangeListener listener)

  Set a property change listener that is invoked when the property is changed in the IDE. The source of the change event is the bean itself.

  Parameters:
    `listener` - the listener

### setParentProperty

    public void setParentProperty(java.lang.String parentProperty)

  Set the parent property under which this property should be shown in the install4j IDE. The property sheet is a tree table and each property can have child nodes. By assigning parent properties, you can build up a tree-like structure in the property sheet.

  For boolean properties, only descendant properties are only shown if the boolean value of the property is selected as `true`. If the user selection is false, all descendant properties will be hidden. If the selection is changed to true, all descendant properties will be shown.

  Parameters:
    `parentProperty` - the name of the parent property

### setVisibilityDiscriminator

    public void setVisibilityDiscriminator(VisibilityDiscriminator visibilityDiscriminator)

  Sets a visibility discriminator for this property. This only makes sense if `setParentProperty(String)` has been called for this property descriptor. Note that for a boolean parent properties, a default visibility discriminator is set that hides children if the user selection of the parent property is `false<`.

  Parameters:
    `visibilityDiscriminator` - the visibility discriminator
  See Also:
    `VisibilityDiscriminator`