Package com.install4j.api.beaninfo
Class Install4JPropertyDescriptor
- java.lang.Object
-
- java.beans.FeatureDescriptor
-
- java.beans.PropertyDescriptor
-
- com.install4j.api.beaninfo.Install4JPropertyDescriptor
-
- Direct Known Subclasses:
ActionListPropertyDescriptor,FilePropertyDescriptor,ScriptPropertyDescriptor
public class Install4JPropertyDescriptor extends java.beans.PropertyDescriptorProperty descriptor for use in instances ofInstall4JBeanInfo. 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
Fields Modifier and Type Field Description static java.lang.StringATTRIBUTE_ACTION_LIST_HIDDEN_KEYSstatic java.lang.StringATTRIBUTE_ACTION_LIST_SHOWN_KEYSstatic java.lang.StringATTRIBUTE_ALLOW_TEXT_OVERRIDEstatic java.lang.StringATTRIBUTE_CONTEXTstatic java.lang.StringATTRIBUTE_EMPTY_MESSAGEstatic java.lang.StringATTRIBUTE_PARENT_PROPERTYstatic java.lang.StringATTRIBUTE_PROPERTY_CATEGORYstatic java.lang.StringATTRIBUTE_PROPERTY_CHANGE_LISTENERstatic java.lang.StringATTRIBUTE_SORT_KEYstatic java.lang.StringATTRIBUTE_SUGGESTED_VALUESstatic java.lang.StringATTRIBUTE_VARIABLE_VALUE_CLASSstatic java.lang.StringATTRIBUTE_VISIBILITY_DISCRIMINATORstatic java.lang.StringCATEGORY_CONFIGURATIONDefault category used by install4j.static java.lang.StringCONTEXT_ANCHOR_CORNERSSpecial 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 java.lang.StringCONTEXT_ANCHOR_HORIZONTALSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the horizontal values of the anchor (west, center, east).static java.lang.StringCONTEXT_ANCHOR_SIDESSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the side values of the anchor (north, west, east, south).static java.lang.StringCONTEXT_ANCHOR_VERTICALSpecial context for properties of typeAnchorthat tells the install4j GUI to offer only the vertical values of the anchor (north, center, south).static java.lang.StringCONTEXT_COMPONENT_IDSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of an installation component.static java.lang.StringCONTEXT_DATETIMESpecial context for properties of typejava.util.Datethat tells the install4j GUI to offer a time editor besides the default date editor as well.static java.lang.StringCONTEXT_DOWNLOADABLE_COMPONENT_IDSame asCONTEXT_COMPONENT_ID, but only downloaded installation components are selectable.static java.lang.StringCONTEXT_FORM_COMPONENT_IDSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a form component.static java.lang.StringCONTEXT_HTMLSpecial 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 java.lang.StringCONTEXT_LAUNCHER_IDSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a launcher.static java.lang.StringCONTEXT_MULTILINESpecial 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 java.lang.StringCONTEXT_NO_INSTALLER_VARIABLESSpecial 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 java.lang.StringCONTEXT_NON_SERVICE_LAUNCHER_IDSame asCONTEXT_LAUNCHER_ID, but service launchers are not selectable.static java.lang.StringCONTEXT_SERVICE_LAUNCHER_IDSame asCONTEXT_LAUNCHER_ID, but only service launchers are selectable.static java.lang.StringCONTEXT_STRING_TO_STRING_MAPSpecial 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 java.lang.StringCONTEXT_STYLE_IDSpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a style.static java.lang.StringCONTEXT_VARIABLE_NAMESpecial context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as an installer variable name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Install4JPropertyDescriptorcreate(java.lang.String propertyName, java.lang.Class beanClass, java.lang.String displayName, java.lang.String shortDescription)static Install4JPropertyDescriptorcreate(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 toInstall4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor).Install4JPropertyDescriptorsetActionListHiddenKeys(java.lang.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.Install4JPropertyDescriptorsetActionListShownKeys(java.lang.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.Install4JPropertyDescriptorsetAllowTextOverride(boolean allowTextOverride)Allow the user to switch to text mode in the context menu when editing the property in the install4j IDE.Install4JPropertyDescriptorsetContext(java.lang.String editorContext)Set the context for the property.voidsetDisplayName(java.lang.String displayName)Install4JPropertyDescriptorsetEmptyMessage(java.lang.String message)If the the value isnullor empty, display a special text in a shaded color in the install4j IDE.Install4JPropertyDescriptorsetHiddenInActionLists()Do not show this property if the bean is shown in the configuration of the action list.Install4JPropertyDescriptorsetParentProperty(java.lang.String parentProperty)Set the parent property under which this property should be shown in the install4j IDE.Install4JPropertyDescriptorsetPropertyCategory(java.lang.String propertyCategory)Configures the property category.Install4JPropertyDescriptorsetPropertyChangeListener(java.beans.PropertyChangeListener listener)Set a property change listener that is invoked when the property is changed in the IDE.Install4JPropertyDescriptorsetSortKey(java.lang.Integer sortKey)Set an integer key by which properties are sorted.Install4JPropertyDescriptorsetSuggestedValues(java.lang.String[] values)Enable auto-completion of a list of values when using the text field property editor in the install4j IDE.Install4JPropertyDescriptorsetVariableValueClass(java.lang.Class variableClass)Set the class of the variable value, ifCONTEXT_VARIABLE_NAMEis set.Install4JPropertyDescriptorsetVisibilityDiscriminator(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
-
-
-
-
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
-
CONTEXT_LAUNCHER_ID
public static final java.lang.String CONTEXT_LAUNCHER_ID
Special context for properties of typejava.lang.Stringthat 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 asCONTEXT_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 asCONTEXT_LAUNCHER_ID, but only service launchers are selectable.- See Also:
- Constant Field Values
-
CONTEXT_COMPONENT_ID
public static final java.lang.String CONTEXT_COMPONENT_ID
Special context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of an installation component. In the property panel, a drop-down list of all defined installation components will be shown.- See Also:
- Constant Field Values
-
CONTEXT_FORM_COMPONENT_ID
public static final java.lang.String CONTEXT_FORM_COMPONENT_ID
Special context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a form component. This is only relevant for properties of form components. In the property panel, a drop-down list of all defined form components in the current screen will be shown. Layout groups and the currently edited form component will not be shown.- See Also:
- Constant Field Values
-
CONTEXT_STYLE_ID
public static final java.lang.String CONTEXT_STYLE_ID
Special context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as the ID of a style. This is useful for style implementations that need to refer to other user-selectable styles, for example for nesting them. In the property panel, a drop-down list of all defined styles will be shown.- See Also:
Style,StyleManager, Constant Field Values
-
CONTEXT_DOWNLOADABLE_COMPONENT_ID
public static final java.lang.String CONTEXT_DOWNLOADABLE_COMPONENT_ID
Same asCONTEXT_COMPONENT_ID, but only downloaded installation components are selectable.- See Also:
- Constant Field Values
-
CONTEXT_MULTILINE
public static final java.lang.String CONTEXT_MULTILINE
Special context for properties of typejava.lang.Stringthat 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 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.- See Also:
- Constant Field Values
-
CONTEXT_DATETIME
public static final java.lang.String CONTEXT_DATETIME
Special context for properties of typejava.util.Datethat tells the install4j GUI to offer a time editor besides the default date editor as well.- See Also:
- Constant Field Values
-
CONTEXT_VARIABLE_NAME
public static final java.lang.String CONTEXT_VARIABLE_NAME
Special context for properties of typejava.lang.Stringthat tells the install4j GUI to treat the string value as an installer variable name. The user will be offered a selector to choose pre-defined installer variables.- See Also:
- Constant Field Values
-
CONTEXT_NO_INSTALLER_VARIABLES
public static final java.lang.String CONTEXT_NO_INSTALLER_VARIABLES
Special 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.- 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 typejava.util.LinkedHashMapthat 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
-
CONTEXT_ANCHOR_CORNERS
public static final java.lang.String CONTEXT_ANCHOR_CORNERS
Special 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).- See Also:
- Constant Field Values
-
CONTEXT_ANCHOR_SIDES
public static final java.lang.String CONTEXT_ANCHOR_SIDES
Special context for properties of typeAnchorthat tells the install4j GUI to offer only the side values of the anchor (north, west, east, south).- See Also:
- Constant Field Values
-
CONTEXT_ANCHOR_HORIZONTAL
public static final java.lang.String CONTEXT_ANCHOR_HORIZONTAL
Special context for properties of typeAnchorthat tells the install4j GUI to offer only the horizontal values of the anchor (west, center, east).- See Also:
- Constant Field Values
-
CONTEXT_ANCHOR_VERTICAL
public static final java.lang.String CONTEXT_ANCHOR_VERTICAL
Special context for properties of typeAnchorthat tells the install4j GUI to offer only the vertical values of the anchor (north, center, south).- 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
-
ATTRIBUTE_PARENT_PROPERTY
public static final java.lang.String ATTRIBUTE_PARENT_PROPERTY
- See Also:
setParentProperty(String), Constant Field Values
-
ATTRIBUTE_VARIABLE_VALUE_CLASS
public static final java.lang.String ATTRIBUTE_VARIABLE_VALUE_CLASS
-
ATTRIBUTE_VISIBILITY_DISCRIMINATOR
public static final java.lang.String ATTRIBUTE_VISIBILITY_DISCRIMINATOR
-
ATTRIBUTE_ACTION_LIST_HIDDEN_KEYS
public static final java.lang.String ATTRIBUTE_ACTION_LIST_HIDDEN_KEYS
-
ATTRIBUTE_ACTION_LIST_SHOWN_KEYS
public static final java.lang.String ATTRIBUTE_ACTION_LIST_SHOWN_KEYS
-
ATTRIBUTE_ALLOW_TEXT_OVERRIDE
public static final java.lang.String ATTRIBUTE_ALLOW_TEXT_OVERRIDE
-
ATTRIBUTE_EMPTY_MESSAGE
public static final java.lang.String ATTRIBUTE_EMPTY_MESSAGE
- See Also:
setEmptyMessage(String), Constant Field Values
-
ATTRIBUTE_SUGGESTED_VALUES
public static final java.lang.String ATTRIBUTE_SUGGESTED_VALUES
-
-
Method Detail
-
create
public static Install4JPropertyDescriptor create(java.lang.String propertyName, java.lang.Class beanClass, java.lang.String displayName, java.lang.String shortDescription)
-
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 toInstall4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor).- Parameters:
propertyName- the name of the propertybeanClass- the class of the bean that contains the property. Note: This is not the class of the property.displayName- the display name of the propertyshortDescription- a short description of the property in HTML format. You do not have to start the description with <html>, it will be prepended automatically.context- the context of the property. The context allows to specify different editors for the same property types. See theCONTEXT_*properties for the built-in contexts. This context is also used for enumerated properties in theEnumerationMapper. For properties of typeString[], you can pass an item name as the context.- Returns:
- the property descriptor
-
setContext
public Install4JPropertyDescriptor setContext(java.lang.String editorContext)
Set the context for the property.- Parameters:
editorContext- the context- Returns:
this, for chained calls on this property descriptor- See Also:
for an explanation of the context.
-
setPropertyCategory
public Install4JPropertyDescriptor 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- Returns:
this, for chained calls on this property descriptor
-
setDisplayName
public void setDisplayName(java.lang.String displayName)
- Overrides:
setDisplayNamein classjava.beans.FeatureDescriptor
-
setSortKey
public Install4JPropertyDescriptor 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- Returns:
this, for chained calls on this property descriptor- See Also:
Install4JBeanInfo.addPropertyDescriptor(Install4JPropertyDescriptor)
-
setVariableValueClass
public Install4JPropertyDescriptor setVariableValueClass(java.lang.Class variableClass)
Set the class of the variable value, ifCONTEXT_VARIABLE_NAMEis set. This information is displayed in the install4j IDE.- Parameters:
variableClass- the class of the variable value- Returns:
this, for chained calls on this property descriptor
-
setPropertyChangeListener
public Install4JPropertyDescriptor 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- Returns:
this, for chained calls on this property descriptor
-
setParentProperty
public Install4JPropertyDescriptor 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- Returns:
this, for chained calls on this property descriptor
-
setVisibilityDiscriminator
public Install4JPropertyDescriptor setVisibilityDiscriminator(VisibilityDiscriminator visibilityDiscriminator)
Sets a visibility discriminator for this property. This only makes sense ifsetParentProperty(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 isfalse.- Parameters:
visibilityDiscriminator- the visibility discriminator- Returns:
this, for chained calls on this property descriptor- See Also:
VisibilityDiscriminator
-
setActionListHiddenKeys
public Install4JPropertyDescriptor setActionListHiddenKeys(java.lang.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.- Parameters:
hiddenKeys- an array with the the contexts of theActionListproperty for which the property should be hidden. If one of the array elements isnull, the property is always hidden in action lists.- Returns:
this, for chained calls on this property descriptor- See Also:
ActionListPropertyDescriptor.setActionKeys(String[])
-
setActionListShownKeys
public Install4JPropertyDescriptor setActionListShownKeys(java.lang.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.- Parameters:
shownKeys- an array with the the contexts of theActionListproperty for which the property should be shown.- Returns:
this, for chained calls on this property descriptor- See Also:
ActionListPropertyDescriptor.setActionKeys(String[])
-
setHiddenInActionLists
public Install4JPropertyDescriptor setHiddenInActionLists()
Do not show this property if the bean is shown in the configuration of the action list. Equivalent to a call tosetActionListHiddenContexts(new String[] {null})- Returns:
this, for chained calls on this property descriptor- See Also:
ActionListPropertyDescriptor
-
setAllowTextOverride
public Install4JPropertyDescriptor setAllowTextOverride(boolean allowTextOverride)
Allow the user to switch to text mode in the context menu when editing the property in the install4j IDE. This only has an effect for non-String properties. In the getter of the property, you have to call one of thereplaceWithTextOverridemethods inAbstractBean- Parameters:
allowTextOverride- if text mode should be available- Returns:
this, for chained calls on this property descriptor- See Also:
AbstractBean.getTextOverrideValue(Bean, String, Class)
-
setEmptyMessage
public Install4JPropertyDescriptor setEmptyMessage(java.lang.String message)
If the the value isnullor empty, display a special text in a shaded color in the install4j IDE. This only has an effect for properties of typejava.lang.String,java.lang.String[]andjava.io.File.- Parameters:
message- the message- Returns:
this, for chained calls on this property descriptor
-
setSuggestedValues
public Install4JPropertyDescriptor setSuggestedValues(java.lang.String[] values)
Enable auto-completion of a list of values when using the text field property editor in the install4j IDE. This only has an effect for properties of typejava.lang.String.- Parameters:
values- the values that should be auto-completed.- Returns:
this, for chained calls on this property descriptor
-
-