## install4j API documentation

## com.install4j.api.beaninfo
Class ScriptPropertyDescriptor

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

    public class ScriptPropertyDescriptor

extends Install4JPropertyDescriptor

Property descriptor for properties of type `ScriptProperty`. With this descriptor you define the return type and the parameters that are passed to the script by `Context.runScript(com.install4j.api.beans.ScriptProperty, com.install4j.api.beans.Bean, Object[])` at runtime.

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:
  `ScriptParameter`

Field Summary
`static java.lang.String` | `ATTRIBUTE_CODE_GALLERY_TAGS`
`static java.lang.String` | `ATTRIBUTE_RETURN_TYPE`
`static java.lang.String` | `ATTRIBUTE_SCRIPT_PARAMETERS`

Fields inherited from class com.install4j.api.beaninfo.Install4JPropertyDescriptor
`ATTRIBUTE_CONTEXT, ATTRIBUTE_PROPERTY_CATEGORY, ATTRIBUTE_PROPERTY_CHANGE_LISTENER, ATTRIBUTE_SORT_KEY, CATEGORY_CONFIGURATION, CONTEXT_DATETIME, CONTEXT_HTML, CONTEXT_LAUNCHER_ID, CONTEXT_MULTILINE, CONTEXT_NON_SERVICE_LAUNCHER_ID, CONTEXT_SERVICE_LAUNCHER_ID`

Method Summary
`static ScriptPropertyDescriptor` | `create(java.lang.String propertyName, java.lang.Class beanClass, java.lang.String displayName, java.lang.String shortDescription, java.lang.Class returnType, ScriptParameter[] scriptParameters)` Create a file property descriptor as with `Install4JPropertyDescriptor.create(String, Class, String, String)` and additional configuration specific to script properties.
`void` | `setCodeGalleryTags(java.lang.String[] tags)` Sets the code gallery tags that are are used to build the code gallery for this script property.

Methods inherited from class com.install4j.api.beaninfo.Install4JPropertyDescriptor
`create, create, setContext, setDisplayName, setPropertyCategory, setPropertyChangeListener, setSortKey`

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_RETURN_TYPE

    public static final java.lang.String ATTRIBUTE_RETURN_TYPE

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

### ATTRIBUTE_SCRIPT_PARAMETERS

    public static final java.lang.String ATTRIBUTE_SCRIPT_PARAMETERS

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

### ATTRIBUTE_CODE_GALLERY_TAGS

    public static final java.lang.String ATTRIBUTE_CODE_GALLERY_TAGS

See Also:
  `setCodeGalleryTags(String[])`, Constant Field Values

Method Detail

### create

    public static ScriptPropertyDescriptor create(java.lang.String propertyName,
                                                  java.lang.Class beanClass,
                                                  java.lang.String displayName,
                                                  java.lang.String shortDescription,
                                                  java.lang.Class returnType,
                                                  ScriptParameter[] scriptParameters)

  Create a file property descriptor as with `Install4JPropertyDescriptor.create(String, Class, String, String)` and additional configuration specific to script properties.

  Parameters:
    `returnType` - the class or the return type. Classes for primitive types are written as `void.class` or `int.class`.
    `scriptParameters` - the additional parameters for the script or `null` if no additional parameters are passed.
  Returns:
    the property descriptor
  See Also:
    `ScriptProperty`, `Context.runScript(com.install4j.api.beans.ScriptProperty, com.install4j.api.beans.Bean, Object[])`

### setCodeGalleryTags

    public void setCodeGalleryTags(java.lang.String[] tags)

  Sets the code gallery tags that are are used to build the code gallery for this script property. This is only relevant if you supply your own code gallery by including a code gallery file (see `$INSTALL4J_HOME/resource/codeGallery.dtd`) in the extension manifest (attribute `Code-Gallery: true`)

  Parameters:
    `tags` - the additional tags that should be included in the code gallery