Zimlet JavaScript API Reference - ZmObjectHandler

Class ZmObjectHandler


This class defines the default implementation for a zimlet object handler.

To write a zimlet, see ZmZimletBase.

Defined in: ZmObjectHandler.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmObjectHandler(typeName, className)
Creates the object handler.
Method Summary
Method Attributes Method Name and Description
 
clicked(obj, span, ev, context)
This method is called by the Zimlet framework when the object is clicked.
 
getActiveClassName(obj, context, spanId)
Gets the active class name for a given object.
 
getClassName(obj, context, spanId)
Gets the class name for a given object.
 
getHoveredClassName(obj, context, spanId)
Gets the hovered class name for the given object.
 
getToolTipText(obj, context)
Gets the handler tool tip text.
 
Gets the type name.
 
hasToolTipText(obj, context)
Checks if the handler has tool tip text.
 
init(typeName, className)
This method is called by the Zimlet framework to initialize the object.
 
match(content, startIndex)
This method is used to match content for a zimlet.
 
populateToolTip(obj, context)
Populates the handler tool tip text.
 
selected(obj, span, ev, context)
This method is called by the Zimlet framework when the object is selected.
 
Returns a string representation of the object.
Class Detail
ZmObjectHandler(typeName, className)
Creates the object handler.
Parameters:
{string} typeName
the type name
{string} className
the class name
Method Detail
clicked(obj, span, ev, context)
This method is called by the Zimlet framework when the object is clicked.
Parameters:
{Object} obj
the object
{string} span
the span element
{Object} ev
the event
{Object} context
the context

{string} getActiveClassName(obj, context, spanId)
Gets the active class name for a given object.
Parameters:
{Object} obj
the object
{Object} context
the content
{string} spanId
ID of the SPAN
Returns:
{string} the active class name

{string} getClassName(obj, context, spanId)
Gets the class name for a given object.
Parameters:
{Object} obj
the object
{Object} context
the content
{string} spanId
ID of the SPAN
Returns:
{string} the class name

{string} getHoveredClassName(obj, context, spanId)
Gets the hovered class name for the given object.
Parameters:
{Object} obj
the object
{Object} context
the content
{string} spanId
ID of hovered SPAN
Returns:
{string} the hovered class name

{string} getToolTipText(obj, context)
Gets the handler tool tip text.
Parameters:
{Object} obj
the object
{Object} context
the context
Returns:
{string} the handler has tool tip text

{string} getTypeName()
Gets the type name.
Returns:
{string} the type name

hasToolTipText(obj, context)
Checks if the handler has tool tip text.
Parameters:
{Object} obj
the object
{Object} context
the context
Returns:
true if the handler has tool tip text; false otherwise

init(typeName, className)
This method is called by the Zimlet framework to initialize the object.
Parameters:
{string} typeName
the type name
{string} className
the class name; if null, "Object" will be used

match(content, startIndex)
This method is used to match content for a zimlet. Zimlet implementations should override this method. Usage should return a non-null result in the format of String.match if text on the line matched the handler regular expression.
var result = handler.match(line);
result[0] // should be matched string
result.index // should be location within line match occurred
Handlers can also set result.context which will be passed back to them during the various method calls (#getToolTipText, etc). Handlers should set regex.lastIndex to startIndex and then use regex.exec(content). Handlers should also use the "g" option when constructing their regex.
Parameters:
content
startIndex

populateToolTip(obj, context)
Populates the handler tool tip text.
Parameters:
{Object} obj
the object
{Object} context
the context

selected(obj, span, ev, context)
This method is called by the Zimlet framework when the object is selected.
Parameters:
{Object} obj
the object
{string} span
the span element
{Object} ev
the event
{Object} context
the context
See:
#clicked

{string} toString()
Returns a string representation of the object.
Returns:
{string} a string representation of the object

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:38 GMT-0400 (EDT)