Libraries.Web.Page.MouseAttributeAccepter Documentation
The MouseAttributeAccepter class is designed as a helper to ease adding and removing mouse event attributes from particular WebTag objects. While there is no harm in creating an object of this type, it is used most commonly by sub-classes that need to use attributes. The example for this class shows how to subclass the MouseAttributeAccepter class.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
class audio is MouseAttributeAccepter, WebGenerator
action Generate returns text
text result = "<button "
Attributes attributes = parent:WebTag:GetAttributes()
attributeText = attributes:Generate()
result = result + attributeText + ">"
result = result + me:GenerateNestedTags()
result = result + "</button>"
return result
end
end
Inherits from: Libraries.Web.Page.AttributeAccepter, Libraries.Language.Object
Summary
Actions Summary Table
Actions | Description |
---|---|
Add(Libraries.Web.Page.Attribute attribute) | This action adds an attribute to this object. |
AddAttribute(text name, text value) | This action adds an attribute to this object. |
Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |
Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |
GenerateAttributes() | This action returns a text description of all attributes stored. |
GetAttribute(text name) | This action returns an attribute from this object's Attributes object. |
GetAttributeValue(text name) | This action returns an attribute from this object's Attributes object. |
GetAttributes() | Returns a list of all attributes on the system. |
GetHashCode() | This action gets the hash code for an object. |
GetIterator() | This action returns an iterator of all attributes stored in this object. |
GetNumberOfAttributes() | This action returns the number of attributes that are currently stored in this object. |
GetOnClick() | Returns the OnClick attribute. |
GetOnDoubleClick() | Returns the OnDoubleClick attribute. |
GetOnDrag() | Returns the OnDrag attribute. |
GetOnDragEnd() | Returns the OnDragEnd attribute. |
GetOnDragEnter() | Returns the OnDragEnter attribute. |
GetOnDragLeave() | Returns the OnDragLeave attribute. |
GetOnDragOver() | Returns the OnDragOver attribute. |
GetOnDragStart() | Returns the OnDragStart attribute. |
GetOnDrop() | Returns the OnDrop attribute. |
GetOnMouseDown() | Returns the OnMouseDown attribute. |
GetOnMouseMove() | Returns the OnMouseMove attribute. |
GetOnMouseOut() | Returns the OnMouseOut attribute. |
GetOnMouseOver() | Returns the OnMouseOver attribute. |
GetOnMouseUp() | Returns the OnMouseUp attribute. |
GetOnMouseWheel() | Returns the OnMouseWheel attribute. |
GetOnScroll() | Returns the OnScroll attribute. |
HasAttribute(text name) | This action returns whether or not an attribute exists for the key passed in as a parameter. |
RemoveAttribute(text name) | This action removes an attribute with a particular key. |
SetOnClick(text value) | Sets the OnClick attribute script when the OnClick event is triggered. |
SetOnDoubleClick(text value) | Sets the OnDoubleClick attribute script when the OnDoubleClick event is triggered. |
SetOnDrag(text value) | Sets the OnDrag attribute script when the OnDrag event is triggered. |
SetOnDragEnd(text value) | Sets the OnDragEnd attribute script when the OnDragEnd event is triggered. |
SetOnDragEnter(text value) | Sets the OnDragEnter attribute script when the OnDragEnter event is triggered. |
SetOnDragLeave(text value) | Sets the OnDragLeave attribute script when the OnDragLeave event is triggered. |
SetOnDragOver(text value) | Sets the OnDragOver attribute script when the OnDragOver event is triggered. |
SetOnDragStart(text value) | Sets the OnDragStart attribute script when the OnDragStart event is triggered. |
SetOnDrop(text value) | Sets the OnDrop attribute script when the OnDrop event is triggered. |
SetOnMouseDown(text value) | Sets the OnMouseDown attribute script when the OnMouseDown event is triggered. |
SetOnMouseMove(text value) | Sets the OnMouseMove attribute script when the OnMouseMove event is triggered. |
SetOnMouseOut(text value) | Sets the OnMouseOut attribute script when the OnMouseOut event is triggered. |
SetOnMouseOver(text value) | Sets the OnMouseOver attribute script when the OnMouseOver event is triggered. |
SetOnMouseUp(text value) | Sets the OnMouseUp attribute script when the OnMouseUp event is triggered. |
SetOnMouseWheel(text value) | Sets the OnMouseWheel attribute script when the OnMouseWheel event is triggered. |
SetOnScroll(text value) | Sets the OnScroll attribute script when the OnScroll event is triggered. |
Actions Documentation
Add(Libraries.Web.Page.Attribute attribute)
This action adds an attribute to this object. If an attribute with the same name as
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
Attribute attribute
attribute:SetName("src")
attribute:SetValue("http://www.google.com")
AttributeAccepter accept
accept:Add(attribute)
Parameters
- Libraries.Web.Page.Attribute: The attribute that will be stored.
AddAttribute(text name, text value)
This action adds an attribute to this object. This action is a helper action, which essentially does the same thing as the Add(Attribute) action. If an attribute with the same name as
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
Parameters
- text name: The name of the attribute functions as a key. For example, in a link, we might have a "src" and an actual address, like google.com. In this case, the name would be equivalent to the src.
- text value: As an example of link, imagine we have a value of "src" and an actual address, like google.com. In this case, the value would be equivalent to google.com.
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Example Code
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Example Code
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
GenerateAttributes()
This action returns a text description of all attributes stored.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
text result = accept:GenerateAttributes()
Return
text:
GetAttribute(text name)
This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
//as we have not set any attribute, this would
//return undefined
Attribute attribute = accept:GetAttribute("src")
Parameters
Return
GetAttributeValue(text name)
This action returns an attribute from this object's Attributes object. If no attribute exists for a given key, this action returns undefined.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
text value = accept:GetAttributeValue("src")
Parameters
- text name: The key value in this case is described in more detail in the documentation for this class's Add actions.
Return
text:
GetAttributes()
Returns a list of all attributes on the system.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attributes
AttributeAccepter accept
Attributes attributes = accept:GetAttributes()
Return
Libraries.Web.Page.Attributes: The attributes class contains all of the attributes that have been set for this object.
GetHashCode()
This action gets the hash code for an object.
Example Code
Object o
integer hash = o:GetHashCode()
Return
integer: The integer hash code of the object.
GetIterator()
This action returns an iterator of all attributes stored in this object.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
use Libraries.Containers.Iterator
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//output out all of the attributes
Iterator<Attribute> it = accept:GetIterator()
repeat while it:HasNext()
Attribute at = it:Next()
output at:Generate()
end
Return
Libraries.Containers.Iterator:
GetNumberOfAttributes()
This action returns the number of attributes that are currently stored in this object.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
integer num = accept:GetNumberOfAttributes()
Return
integer:
GetOnClick()
Returns the OnClick attribute. If a on click event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnClick()
Return
Libraries.Web.Page.Attribute: The current OnClick attribute.
GetOnDoubleClick()
Returns the OnDoubleClick attribute. If a on double click event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDoubleClick()
Return
Libraries.Web.Page.Attribute: The current OnDoubleClick attribute.
GetOnDrag()
Returns the OnDrag attribute. If a on drag event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDrag()
Return
Libraries.Web.Page.Attribute: The current OnDrag attribute.
GetOnDragEnd()
Returns the OnDragEnd attribute. If a on drag end event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDragEnd()
Return
Libraries.Web.Page.Attribute: The current OnDragEnd attribute.
GetOnDragEnter()
Returns the OnDragEnter attribute. If a on drag into area event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDragEnter()
Return
Libraries.Web.Page.Attribute: The current OnDragEnter attribute.
GetOnDragLeave()
Returns the OnDragLeave attribute. If a on drag out of area event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDragLeave()
Return
Libraries.Web.Page.Attribute: The current OnDragLeave attribute.
GetOnDragOver()
Returns the OnDragOver attribute. If a on drag over event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDragOver()
Return
Libraries.Web.Page.Attribute: The current OnDragOver attribute.
GetOnDragStart()
Returns the OnDragStart attribute. If a on drag start event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDragStart()
Return
Libraries.Web.Page.Attribute: The current OnDragStart attribute.
GetOnDrop()
Returns the OnDrop attribute. If a on drop item event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnDrop()
Return
Libraries.Web.Page.Attribute: The current OnDrop attribute.
GetOnMouseDown()
Returns the OnMouseDown attribute. If a on mouse button down event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseDown()
Return
Libraries.Web.Page.Attribute: The current OnMouseDown attribute.
GetOnMouseMove()
Returns the OnMouseMove attribute. If a on mouse move event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseMove()
Return
Libraries.Web.Page.Attribute: The current OnMouseMove attribute.
GetOnMouseOut()
Returns the OnMouseOut attribute. If a on mouse out of area event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseOut()
Return
Libraries.Web.Page.Attribute: The current OnMouseOut attribute.
GetOnMouseOver()
Returns the OnMouseOver attribute. If a on mouse over event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseOver()
Return
Libraries.Web.Page.Attribute: The current OnMouseOver attribute.
GetOnMouseUp()
Returns the OnMouseUp attribute. If a on mouse button up event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseUp()
Return
Libraries.Web.Page.Attribute: The current OnMouseUp attribute.
GetOnMouseWheel()
Returns the OnMouseWheel attribute. If a mouse wheel scroll event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnMouseWheel()
Return
Libraries.Web.Page.Attribute: The current OnMouseWheel attribute.
GetOnScroll()
Returns the OnScroll attribute. If a on scroll event occurs on a specified element a script is fired based on this attribute.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
Attribute attribute = accept:GetOnScroll()
Return
Libraries.Web.Page.Attribute: The current OnScroll attribute.
HasAttribute(text name)
This action returns whether or not an attribute exists for the key passed in as a parameter.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
boolean exists = accept:HasAttribute("src")
Parameters
- text name: The key value in this case is described in more detail in the documentation for this class's Add actions.
Return
boolean:
RemoveAttribute(text name)
This action removes an attribute with a particular key. If that attribute does not exist, then this action returns undefined.
Example Code
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
//This helper action would throw an error if "src" were not set.
accept:RemoveAttribute("src")
Parameters
- text name: The name of the attribute that should be removed.
Return
SetOnClick(text value)
Sets the OnClick attribute script when the OnClick event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnClick("doSomething()")
Parameters
- text value: The current OnClick attribute.
SetOnDoubleClick(text value)
Sets the OnDoubleClick attribute script when the OnDoubleClick event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDoubleClick("doSomething()")
Parameters
- text value: The current OnDoubleClick attribute.
SetOnDrag(text value)
Sets the OnDrag attribute script when the OnDrag event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDrag("doSomething()")
Parameters
- text value: The current OnDrag attribute.
SetOnDragEnd(text value)
Sets the OnDragEnd attribute script when the OnDragEnd event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDragEnd("doSomething()")
Parameters
- text value: The current OnDragEnd attribute.
SetOnDragEnter(text value)
Sets the OnDragEnter attribute script when the OnDragEnter event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDragEnter("doSomething()")
Parameters
- text value: The current OnDragEnter attribute.
SetOnDragLeave(text value)
Sets the OnDragLeave attribute script when the OnDragLeave event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDragLeave("doSomething()")
Parameters
- text value: The current OnDragLeave attribute.
SetOnDragOver(text value)
Sets the OnDragOver attribute script when the OnDragOver event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDragOver("doSomething()")
Parameters
- text value: The current OnDragOver attribute.
SetOnDragStart(text value)
Sets the OnDragStart attribute script when the OnDragStart event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDragStart("doSomething()")
Parameters
- text value: The current OnDragStart attribute.
SetOnDrop(text value)
Sets the OnDrop attribute script when the OnDrop event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnDrop("doSomething()")
Parameters
- text value: The current OnDrop attribute.
SetOnMouseDown(text value)
Sets the OnMouseDown attribute script when the OnMouseDown event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseDown("doSomething()")
Parameters
- text value: The current OnMouseDown attribute.
SetOnMouseMove(text value)
Sets the OnMouseMove attribute script when the OnMouseMove event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseMove("doSomething()")
Parameters
- text value: The current OnMouseMove attribute.
SetOnMouseOut(text value)
Sets the OnMouseOut attribute script when the OnMouseOut event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseOut("doSomething()")
Parameters
- text value: The current OnMouseOut attribute.
SetOnMouseOver(text value)
Sets the OnMouseOver attribute script when the OnMouseOver event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseOver("doSomething()")
Parameters
- text value: The current OnMouseOver attribute.
SetOnMouseUp(text value)
Sets the OnMouseUp attribute script when the OnMouseUp event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseUp("doSomething()")
Parameters
- text value: The current OnMouseUp attribute.
SetOnMouseWheel(text value)
Sets the OnMouseWheel attribute script when the OnMouseWheel event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnMouseWheel("doSomething()")
Parameters
- text value: The current OnMouseWheel attribute.
SetOnScroll(text value)
Sets the OnScroll attribute script when the OnScroll event is triggered.
Example Code
use Libraries.Web.Page.MouseAttributeAccepter
use Libraries.Web.Page.Attribute
MouseAttributeAccepter accept
accept:SetOnScroll("doSomething()")
Parameters
- text value: The current OnScroll attribute.