Package ca.phon.script.params
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
Modifier and TypeFieldDescriptionstatic final String
protected final PropertyChangeSupport
Property change supportstatic final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) getDefaultValue
(String paramId) Returns the first (and many times only) param id for this ScriptParamgetPropertyChangeListeners
(String propertyName) abstract String
Get the string representation of this param.boolean
Get the visiblity status of this param.boolean
Has the value of any of the paramIds changed from the default value.boolean
Is this param enabled.void
void
removePropertyChangeListener
(String propertyName, PropertyChangeListener listener) void
setDefaultValue
(String paramId, Object defaultValue) void
setEnabled
(boolean enabled) Set the enabled state of this ScriptParamvoid
setParamDesc
(String paramDesc) void
setParamType
(String paramType) void
void
setVisible
(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:
true
if this param is enabled,false
otherwise
-
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:
true
if this param should be invisible,false
otherwise
-
setVisible
Set visibility status of param- Parameters:
visible
-
-