Class
caplin.control.basic

BasicControl

An implementation of caplin.control.Control and caplin.control.factory.ControlFramework that acts as a base class for implementations of real controls.

Constructor Summary

Attributes Name and Description
caplin.control.basic.BasicControl(caplin.control.factory.ControlType oControlType)

Constructs a new BasicControl with the specified arguments.

Method Summary

Attributes Name and Description
DOMElement getElement()

Gets the element associated with this control.

Number getFlashDuration()

Gets the value of the flash duration.

int getId()

Gets the numeric id of this control.

String getNumericFlashDirection(Number nNewValue, Number nOldValue)

Determines the numeric flash direction of the new value relative to the old value.

boolean isBound()

Indicates whether the control is bound to an HTML Element

void removeFlash()

Removes the flash state from the control.

void setAttribute(String sName, Variant vValue)

Sets a control attribute

void setDomAttribute(String sAttributeName, String vAttributeValue)

Sets the given HTML attribute value on of the underlying HTML element

void setDomClass(String sClassName)

Sets the DOM CSS classname of the underlying HTML element

void setDomParentClass(String sClassName)

Sets the DOM CSS classname of the underlying parent HTML element

void setDomStyle(String sStyleName, String sStyleValue)

Sets the given CSS style value on of the underlying HTML element

void setDomValue(String sValue)

Sets the value in the DOM.

void setId(int nId)

Sets the id of this control.

void setTooltip(String sTooltip)

Sets the tooltip value for this control.

Methods implemented from class caplin.control.Control:
addClass, clear, clearState, disable, enable, flash, focus, getAttributes, getValue, isEnabled, refresh, removeClass, replaceClass, select, setStyle, setValue, toString
Methods implemented from class caplin.control.factory.ControlFramework:
attachControlEventListener, bind, createHtml, detachControlEventListener, finalize, getInitialClassName, initialize, setInitialClassName, unbind

Constructor Detail

caplin.control.basic.BasicControl(caplin.control.factory.ControlType oControlType)

Constructs a new BasicControl with the specified arguments. This abstract class should never be constructed explicitly.

Parameters
caplin.control.factory.ControlType oControlType The control type.

Method Detail

DOMElement getElement()

Gets the element associated with this control.

Returns
the element associated with this control.

Number getFlashDuration()

Gets the value of the flash duration.

Returns
the value of the flash duration.

int getId()

Gets the numeric id of this control.

Returns
The numeric id of this control.

String getNumericFlashDirection(Number nNewValue, Number nOldValue)

Determines the numeric flash direction of the new value relative to the old value. If either new or old value is not a number (for example, if either value is undefined) then the function returns an empty string.

Parameters
Number nNewValue The new value
Number nOldValue The old value
Returns
'up', 'down' or 'flat' depending on whether the new value is respectively greater than, less than or equal to the old value

boolean isBound()

Indicates whether the control is bound to an HTML Element

Returns
true if the control is bound to an HTML Element; otherwise false.

void removeFlash()

Removes the flash state from the control.

void setAttribute(String sName, Variant vValue)

Sets a control attribute

Parameters
String sName The name of the attribute to set.
Variant vValue The value to set.
See
caplin.control.Control#getAttributes

void setDomAttribute(String sAttributeName, String vAttributeValue)

Sets the given HTML attribute value on of the underlying HTML element

Parameters
String sAttributeName the HTML attribute name to be set.
String vAttributeValue the HTML attribute value to set.

void setDomClass(String sClassName)

Sets the DOM CSS classname of the underlying HTML element

Parameters
String sClassName the CSS class name to set.

void setDomParentClass(String sClassName)

Sets the DOM CSS classname of the underlying parent HTML element

Parameters
String sClassName the CSS class name to set.

void setDomStyle(String sStyleName, String sStyleValue)

Sets the given CSS style value on of the underlying HTML element

Parameters
String sStyleName the CSS style name to be set.
String sStyleValue the CSS value to set.

void setDomValue(String sValue)

Sets the value in the DOM. Implementing classes must specify how their DOM value will be set

Parameters
String sValue The value to set in the DOM.

void setId(int nId)

Sets the id of this control.

Parameters
int nId the value of the id to set.

void setTooltip(String sTooltip)

Sets the tooltip value for this control.

Parameters
String sTooltip the tooltip value.