A
Control
is a screen control with which a user interacts, such as an input box, a drop-down box, or a
straightforward text label.
This interface allows module:caplin/element/Styler
s to interact with the Control
in order to apply
visual effects.
Methods
-
addClass(className)
-
Adds the specified CSS class name to the control. This has no effect if it is already on the element.
Parameters:
Name Type Description className
String The CSS class name to add to the DOM. - Implementations:
- module:caplin/control/basic/BasicControl#addClass
- module:caplin/control/composite/CompositeControl#addClass
-
clear()
-
Clear the control and returns it to its original state.
- Implementations:
- module:caplin/control/basic/BasicControl#clear
- module:caplin/control/composite/CompositeControl#clear
-
clearState()
-
Clears the state of the control without modifying the displayed value. This is a faster version of clear for when you are going to update the displayed value immediately after clearing.
- Implementations:
- module:caplin/control/basic/BasicControl#clearState
- module:caplin/control/composite/CompositeControl#clearState
-
disable()
-
Disables the control. Does nothing if the control has no concept of enabled/disabled.
- Implementations:
- module:caplin/control/basic/BasicControl#disable
- module:caplin/control/composite/CompositeControl#disable
-
enable()
-
Enables the control. Does nothing if the control has no concept of enabled/disabled.
- Implementations:
- module:caplin/control/basic/BasicControl#enable
- module:caplin/control/composite/CompositeControl#enable
-
flash(value, duration)
-
Flashes the control based on the new control value. Does nothing if the control has no concept of flash. Note that this does not write the new value to the control itself, it merely styles the control according to the value.
Parameters:
Name Type Description value
Variant The new control value. duration
int The flash duration in milliseconds. - Implementations:
- module:caplin/control/basic/BasicControl#flash
- module:caplin/control/composite/CompositeControl#flash
-
focus()
-
Moves the focus to this control. Does nothing if the control has no concept of focus.
- Implementations:
- module:caplin/control/basic/BasicControl#focus
- module:caplin/control/composite/CompositeControl#focus
-
getAttributes() → {Map}
-
Gets the controls attributes
- Implementations:
- module:caplin/control/basic/BasicControl#getAttributes
- module:caplin/control/composite/CompositeControl#getAttributes
Returns:
A map of attributes.- Type
- Map
-
getValue() → {Variant}
-
Gets the control value from the control.
- Implementations:
- module:caplin/control/basic/BasicControl#getValue
- module:caplin/control/composite/CompositeControl#getValue
Returns:
The control value.- Type
- Variant
-
isEnabled() → {Boolean}
-
Determines whether the control is enabled.
- Implementations:
- module:caplin/control/basic/BasicControl#isEnabled
- module:caplin/control/composite/CompositeControl#isEnabled
Returns:
true if the control is enabled.- Type
- Boolean
-
refresh()
-
Refresh the screen.
- Implementations:
- module:caplin/control/basic/BasicControl#refresh
- module:caplin/control/composite/CompositeControl#refresh
-
removeClass(className)
-
Removes the specified CSS class name from the control. This has no effect if it is not already on the element.
Parameters:
Name Type Description className
String The CSS class name to add to the DOM. - Implementations:
- module:caplin/control/basic/BasicControl#removeClass
- module:caplin/control/composite/CompositeControl#removeClass
-
replaceClass(oldClassName, newClassName)
-
Replaces the specified CSS class on the control with a new class.
Parameters:
Name Type Description oldClassName
String The old CSS class to remove. newClassName
String The new CSS class to add. - Implementations:
- module:caplin/control/basic/BasicControl#replaceClass
- module:caplin/control/composite/CompositeControl#replaceClass
-
select()
-
Moves the focus and highlights this control. Does nothing if the control has no concept of focus.
- Implementations:
- module:caplin/control/basic/BasicControl#select
- module:caplin/control/composite/CompositeControl#select
-
setStyle(styleName, styleValue)
-
Sets the specified style the control's DOM element.
Parameters:
Name Type Description styleName
String The style name to add to the DOM. styleValue
String The style value. - Implementations:
- module:caplin/control/basic/BasicControl#setStyle
- module:caplin/control/composite/CompositeControl#setStyle
-
setValue(value)
-
Sets the control value, which will update the screen. Depending on the renderer type, this will either be a simple string (if the renderer has no streams) or a map with stream names as its keys.
Parameters:
Name Type Description value
Variant The new control value. - Implementations:
- module:caplin/control/basic/BasicControl#setValue
- module:caplin/control/composite/CompositeControl#setValue
-
toString() → {String}
-
Returns a human-readable string representation of the object, which is useful for debugging.
- Implementations:
- module:caplin/control/basic/BasicControl#toString
- module:caplin/control/composite/CompositeControl#toString
Returns:
The string representation- Type
- String