Class ScriptParam
java.lang.Object
ca.phon.script.params.ScriptParam
- Direct Known Subclasses:
BooleanScriptParam,DiacriticOptionsScriptParam,EnumScriptParam,LabelScriptParam,MultiboolScriptParam,SeparatorScriptParam,StringScriptParam,TierListScriptParam,TierSelectionScriptParam
A parameter for a script. These parameters are setup by the
PhonScriptContext
when running the script.
Each ScriptParam can have more than one paramId which
maps to the same property name in the script.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final PropertyChangeSupportProperty change supportstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) getDefaultValue(String paramId) Returns the first (and many times only) param id for this ScriptParamgetPropertyChangeListeners(String propertyName) abstract StringGet the string representation of this param.booleanGet the visiblity status of this param.booleanHas the value of any of the paramIds changed from the default value.booleanIs this param enabled.voidvoidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) voidsetDefaultValue(String paramId, Object defaultValue) voidsetEnabled(boolean enabled) Set the enabled state of this ScriptParamvoidsetParamDesc(String paramDesc) voidsetParamType(String paramType) voidvoidsetVisible(Boolean visible) Set visibility status of param
-
Field Details
-
ENABLED_PROP
-
VISIBLE_PROP
-
propSupport
Property change support
-
-
Constructor Details
-
ScriptParam
public ScriptParam()Constructor -
ScriptParam
-
-
Method Details
-
addPropertyChangeListener
-
removePropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
getPropertyChangeListeners
-
getPropertyChangeListeners
-
getParamId
Returns the first (and many times only) param id for this ScriptParam- Returns:
- first param id
-
getParamIds
-
getParamType
-
setParamType
-
getParamDesc
-
setParamDesc
-
getValue
-
setValue
-
getDefaultValue
-
setDefaultValue
-
hasChanged
public boolean hasChanged()Has the value of any of the paramIds changed from the default value.- Returns:
-
getStringRepresentation
Get the string representation of this param. -
isEnabled
public boolean isEnabled()Is this param enabled. If a script param is not enabled it will not be added to the scriptable scope for the script during execution. As well, if a UI is visible, the component controlling this param should also appear 'disabled'- Returns:
trueif this param is enabled,falseotherwise
-
setEnabled
public void setEnabled(boolean enabled) Set the enabled state of this ScriptParam- Parameters:
enabled-
-
getVisible
public boolean getVisible()Get the visiblity status of this param. This property affects any UI component that is controlling this param. An invisible param may still be enabled and setup during script execution.- Returns:
trueif this param should be invisible,falseotherwise
-
setVisible
-