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 controlType)

Constructs a new BasicControl with the specified arguments.

Method Summary

Attributes Name and Description
void addClass( className, refreshClassName)

void attachControlEventListener( eventName, eventListener)

void bind( controlElement, isDummy)

void clear()

void clearState()

void detachControlEventListener()

void disable()

void enable()

void finalize()

void flash( delta, attributes)

void focus()

void getAttributes()

DOMElement getElement()

Gets the element associated with this control.

Numeric getFlashDuration()

Gets the value of the flash duration.

Integer getId()

Gets the numeric id of this control.

void getInitialClassName()

String getNumericFlashDirection(Numeric newValue, Numeric oldValue)

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

void getValue()

void initialize()

Boolean isBound()

Indicates whether the control is bound to an HTML Element.

void isEnabled()

void refresh()

void removeClass( className, refreshClassName)

void removeFlash()

Removes the flash state from the control.

void replaceClass( oldClassName, newClassname)

void select()

void setAttribute(String name, Variant value)

Sets a control attribute.

void setDomAttribute(String attributeName, String attributeValue)

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

void setDomClass(String className)

Sets the DOM CSS classname of the underlying HTML element.

void setDomParentClass(String className)

Sets the DOM CSS classname of the underlying parent HTML element.

void setDomStyle(String styleName, String styleValue)

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

void setDomValue(String value)

Sets the value in the DOM.

void setId(Integer id)

Sets the id of this control.

void setInitialClassName( initialClassName)

void setStyle( styleName, styleValue)

void setTooltip(String tooltip)

Sets the tooltip value for this control.

void setValue( value)

void toString()

void unbind()

Methods implemented from class caplin.control.factory.ControlFramework:
createHtml

Constructor Detail

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

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

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

Method Detail

void addClass( className, refreshClassName)

Parameters
className
refreshClassName
See
caplin.control.Control#addClass

void attachControlEventListener( eventName, eventListener)

Parameters
eventName
eventListener
See
caplin.control.factory.ControlFramework#attachControlEventListener

void bind( controlElement, isDummy)

Parameters
controlElement
isDummy
See
caplin.control.factory.ControlFramework#bind

void clear()

See
caplin.control.Control#clear

void clearState()

See
caplin.control.Control#clearState

void detachControlEventListener()

See
caplin.control.factory.ControlFramework#detachControlEventListener

void disable()

See
caplin.control.Control#disable

void enable()

See
caplin.control.Control#enable

void flash( delta, attributes)

Parameters
delta
attributes
See
caplin.control.Control#flash

void focus()

See
caplin.control.Control#focus

void getAttributes()

See
caplin.control.Control#getAttributes

DOMElement getElement()

Gets the element associated with this control.

Returns
{DOMElement} the element associated with this control.

Numeric getFlashDuration()

Gets the value of the flash duration.

Returns
{Numeric} the value of the flash duration.

Integer getId()

Gets the numeric id of this control.

Returns
{Integer} The numeric id of this control.

String getNumericFlashDirection(Numeric newValue, Numeric oldValue)

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
Numeric newValue The new value.
Numeric oldValue The old value.
Returns
{String} 'up', 'down' or 'flat' depending on whether the new value is respectively greater than, less than or equal to the old value.

void getValue()

See
caplin.control.Control#getValue

Boolean isBound()

Indicates whether the control is bound to an HTML Element.

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

void isEnabled()

See
caplin.control.Control#isEnabled

void refresh()

See
caplin.control.Control#refresh

void removeClass( className, refreshClassName)

Parameters
className
refreshClassName
See
caplin.control.Control#removeClass

void removeFlash()

Removes the flash state from the control.

void replaceClass( oldClassName, newClassname)

Parameters
oldClassName
newClassname
See
caplin.control.Control#replaceClass

void select()

See
caplin.control.Control#select

void setAttribute(String name, Variant value)

Sets a control attribute.

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

void setDomAttribute(String attributeName, String attributeValue)

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

Parameters
String attributeName the HTML attribute name to be set.
String attributeValue the HTML attribute value to set.

void setDomClass(String className)

Sets the DOM CSS classname of the underlying HTML element.

Parameters
String className the CSS class name to set.

void setDomParentClass(String className)

Sets the DOM CSS classname of the underlying parent HTML element.

Parameters
String className the CSS class name to set.

void setDomStyle(String styleName, String styleValue)

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

Parameters
String styleName the CSS style name to be set.
String styleValue the CSS value to set.

void setDomValue(String value)

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

Parameters
String value The value to set in the DOM.

void setId(Integer id)

Sets the id of this control.

Parameters
Integer id the value of the id to set.

void setInitialClassName( initialClassName)

Parameters
initialClassName
See
caplin.control.factory.ControlFramework#setInitialClassName

void setStyle( styleName, styleValue)

Parameters
styleName
styleValue
See
caplin.control.Control#setStyle

void setTooltip(String tooltip)

Sets the tooltip value for this control.

Parameters
String tooltip the tooltip value.

void setValue( value)

Parameters
value
See
caplin.control.Control#setValue

void toString()

See
caplin.control.Control#toString