Interface
caplin.control

Control

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 caplin.element.Stylers to interact with the Control in order to apply visual effects.

Constructor Summary

Attributes Name and Description
caplin.control.Control()

Method Summary

Attributes Name and Description
void addClass(String sClass)

Adds the specified CSS class name to the control.

void clear()

Clear the control and returns it to its original state.

void clearState()

Clears the state of the control without modifying the displayed value.

void disable()

Disables the control.

void enable()

Enables the control.

void flash(Variant vValue, int nDuration)

Flashes the control based on the new control value.

void focus()

Moves the focus to this control.

Map getAttributes()

Gets the controls attributes

Variant getValue()

Gets the control value from the control.

boolean isEnabled()

Determines whether the control is enabled.

void refresh()

Refresh the screen.

void removeClass(String sClass)

Removes the specified CSS class name from the control.

void replaceClass(String sOldClass, String sNewClass)

Replaces the specified CSS class on the control with a new class.

void select()

Moves the focus and highlights this control.

void setStyle(String sStyleName, String sStyleValue)

Sets the specified style the control's DOM element.

void setValue(Variant vValue)

Sets the control value, which will update the screen.

String toString()

Returns a human-readable string representation of the object, which is useful for debugging.

Constructor Detail

caplin.control.Control()

Method Detail

void addClass(String sClass)

Adds the specified CSS class name to the control. This has no effect if it is already on the element.

Parameters
String sClass The CSS class name to add to the DOM

void clear()

Clear the control and returns it to its original state.

void clearState()

Clears the state of the control without modifying the displayed value. This is a performant version of clear for when you are going to update the displayed value immediately after clearing.

void disable()

Disables the control. Does nothing if the control has no concept of enabled/disabled.

void enable()

Enables the control. Does nothing if the control has no concept of enabled/disabled.

void flash(Variant vValue, int nDuration)

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
Variant vValue The new control value
int nDuration The flash duration in milliseconds

void focus()

Moves the focus to this control. Does nothing if the control has no concept of focus.

Map getAttributes()

Gets the controls attributes

Returns
a map of attributes.

Variant getValue()

Gets the control value from the control.

Returns
The control value

boolean isEnabled()

Determines whether the control is enabled.

Returns
true if the control is enabled.

void refresh()

Refresh the screen.

void removeClass(String sClass)

Removes the specified CSS class name from the control. This has no effect if it is not already on the element.

Parameters
String sClass The CSS class name to add to the DOM

void replaceClass(String sOldClass, String sNewClass)

Replaces the specified CSS class on the control with a new class.

Parameters
String sOldClass The old CSS class to remove
String sNewClass The new CSS class to add

void select()

Moves the focus and highlights this control. Does nothing if the control has no concept of focus.

void setStyle(String sStyleName, String sStyleValue)

Sets the specified style the control's DOM element.

Parameters
String sStyleName The style name to add to the DOM
String sStyleValue The style value

void setValue(Variant vValue)

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
Variant vValue The new control value.

String toString()

Returns a human-readable string representation of the object, which is useful for debugging.

Returns
The string representation