public class ScriptPropertyDescriptor extends Install4JPropertyDescriptor
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.
ScriptParameter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTRIBUTE_CODE_GALLERY_TAGS |
static java.lang.String |
ATTRIBUTE_RETURN_TYPE |
static java.lang.String |
ATTRIBUTE_SCRIPT_PARAMETERS |
ATTRIBUTE_ACTION_LIST_HIDDEN_KEYS, ATTRIBUTE_ACTION_LIST_SHOWN_KEYS, ATTRIBUTE_CONTEXT, ATTRIBUTE_PARENT_PROPERTY, ATTRIBUTE_PROPERTY_CATEGORY, ATTRIBUTE_PROPERTY_CHANGE_LISTENER, ATTRIBUTE_SORT_KEY, 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_MULTILINE, CONTEXT_NO_INSTALLER_VARIABLES, CONTEXT_NON_SERVICE_LAUNCHER_ID, CONTEXT_SERVICE_LAUNCHER_ID, CONTEXT_STRING_TO_STRING_MAP, CONTEXT_VARIABLE_NAME
Modifier and Type | Method and Description |
---|---|
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. |
ScriptPropertyDescriptor |
setCodeGalleryTags(java.lang.String[] tags)
Sets the code gallery tags that are are used to build the code gallery for this script property.
|
create, create, setActionListHiddenKeys, setActionListShownKeys, setContext, setDisplayName, setHiddenInActionLists, setParentProperty, setPropertyCategory, setPropertyChangeListener, setSortKey, setVariableValueClass, setVisibilityDiscriminator
createPropertyEditor, equals, getPropertyEditorClass, getPropertyType, getReadMethod, getWriteMethod, hashCode, isBound, isConstrained, setBound, setConstrained, setPropertyEditorClass, setReadMethod, setWriteMethod
public static final java.lang.String ATTRIBUTE_RETURN_TYPE
public static final java.lang.String ATTRIBUTE_SCRIPT_PARAMETERS
public static final java.lang.String ATTRIBUTE_CODE_GALLERY_TAGS
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)
Install4JPropertyDescriptor.create(String, Class, String, String)
and additional configuration specific to script properties.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.ScriptProperty
,
Context.runScript(com.install4j.api.beans.ScriptProperty, com.install4j.api.beans.Bean, Object[])
public ScriptPropertyDescriptor setCodeGalleryTags(java.lang.String[] tags)
$INSTALL4J_HOME/resource/codeGallery.dtd
) in the extension manifest (attribute Code-Gallery: true
)tags
- the additional tags that should be included in the code gallerythis
, for chained calls on this property descriptor