Package 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
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:
-
Field Summary
Fields inherited from class com.install4j.api.beaninfo.Install4JPropertyDescriptor
ATTRIBUTE_ACTION_LIST_HIDDEN_KEYS, ATTRIBUTE_ACTION_LIST_SHOWN_KEYS, ATTRIBUTE_ALLOW_TEXT_OVERRIDE, ATTRIBUTE_CONTEXT, ATTRIBUTE_EMPTY_MESSAGE, 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptPropertyDescriptor
create
(String propertyName, Class beanClass, String displayName, String shortDescription, Class returnType, ScriptParameter[] scriptParameters) Create a file property descriptor as withInstall4JPropertyDescriptor.create(String, Class, String, String)
and additional configuration specific to script properties.setCodeGalleryTags
(String[] tags) Sets the code gallery tags that are used to build the code gallery for this script property.Methods inherited from class com.install4j.api.beaninfo.Install4JPropertyDescriptor
create, create, setActionListHiddenKeys, setActionListShownKeys, setAllowTextOverride, setContext, setDisplayName, setEmptyMessage, setHiddenInActionLists, setParentProperty, setPreferred, setPropertyCategory, setPropertyChangeListener, setSortKey, setSuggestedValues, setVariableValueClass, setVisibilityDiscriminator
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, setShortDescription, setValue, toString
-
Field Details
-
ATTRIBUTE_RETURN_TYPE
- See Also:
-
ATTRIBUTE_SCRIPT_PARAMETERS
- See Also:
-
ATTRIBUTE_CODE_GALLERY_TAGS
- See Also:
-
-
Method Details
-
create
public static ScriptPropertyDescriptor create(String propertyName, Class beanClass, String displayName, String shortDescription, Class returnType, ScriptParameter[] scriptParameters) Create a file property descriptor as withInstall4JPropertyDescriptor.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 asvoid.class
orint.class
.scriptParameters
- the additional parameters for the script ornull
if no additional parameters are passed.- Returns:
- the property descriptor
- See Also:
-
setCodeGalleryTags
Sets the code gallery tags that 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 (attributeCode-Gallery: true
)- Parameters:
tags
- the additional tags that should be included in the code gallery- Returns:
this
, for chained calls on this property descriptor
-