Libraries.Web.Page.Image Documentation
The Image class represents HTML's (Hypertext Markup Language) img tag which is used to add an image to the page. You can find more information about this tag at: The img attribute.
Example Code
use Libraries.Web.Page.all
class Main
action main
WebPage page
Image image
image:SetAddress("http://images.free-extras.com/pics/s/smile-1613.jpg")
image:SetWidth("150")
image:SetHeight("150")
page:AddToBody(image)
output page:Generate()
end
end
Inherits from: Libraries.Web.Page.AttributeAccepter, Libraries.Language.Object, Libraries.Web.Page.GlobalAttributeAccepter, Libraries.Web.Page.WebTag, Libraries.Web.Page.FlowContent
Actions Documentation
Add(Libraries.Web.Page.Attribute attribute)
This action adds an attribute to this object. If an attribute with the same name as
Parameters
- Libraries.Web.Page.Attribute: The attribute that will be stored.
Example
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)
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
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.
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
AddClassAttribute(text value)
Adds to the ClassAttribute attribute. Multiple class names can be listed in the passed text, separated by a space.
Parameters
- text value: The classes to be added to the element
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
accept:AddClassAttribute("myClass")
AddNestedTag(Libraries.Web.Page.WebTag tag)
This action adds a WebTag to the list of WebTags contained within the current WebTag.
Parameters
- Libraries.Web.Page.WebTag: The WebTag to be added to the list of sub-WebTags.
Example
use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData
//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
AddText(text value)
This action sets the description text for this WebTag.
Parameters
- text value: The text contained in the WebTag.
Example
use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData
//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:AddDescription("name")
row:Add(cell)
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.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
Generate()
This action sets the mapname for an image to use.
Return
text:
Example
use Libraries.Web.Page.all
Image image
ImageMap imageMap
imageMap:SetName("smilemap")
image:SetUseMap("smilemap")
GenerateAttributes()
This action returns a text description of all attributes stored.
Return
text:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
text result = accept:GenerateAttributes()
GenerateNestedTags()
This action generates the HTML output text of all of the nested WebTags.
Return
text: The text including all webtags within this WebTag.
Example
use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData
//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
output row:GenerateNestedTags()
GetAccessKey()
Returns the AccessKey attribute. Specifies a shortcut key for the web element.
Return
Libraries.Web.Page.Attribute: The current AccessKey attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetAccessKey()
GetAddress()
This action gets the address attribute of the image. The address is the location of the linked webpage or document.
Return
Libraries.Web.Page.Attribute: The address of the link.
Example
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image image
Attribute address = image:GetAddress()
if address not= undefined
text href = address:GetValue()
end
GetAlternate()
This action gets alternative text in an image. This is used largely in accessibility technologies, where it provides an alternative representation of the image for technologies that benefit people with disabilities. For example, a screen reader might read the alternative message out loud when focused on the image.
Return
Libraries.Web.Page.Attribute: The alternative text of the link.
Example
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image image
Attribute altText = image:GetAlternate()
if altText not= undefined
text t = altText:GetValue()
end
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.
Parameters
- text name
Return
Example
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")
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.
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:
Example
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")
GetAttributes()
Returns a list of all attributes on the system.
Return
Libraries.Web.Page.Attributes: The attributes class contains all of the attributes that have been set for this object.
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attributes
AttributeAccepter accept
Attributes attributes = accept:GetAttributes()
GetClassAttribute()
Returns the ClassAttribute attribute.
Return
Libraries.Web.Page.Attribute: The current ClassAttribute attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetClassAttribute()
GetContentEditable()
Returns the ContentEditable attribute.
Return
Libraries.Web.Page.Attribute: The current ContentEditable attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetContentEditable()
GetContextMenu()
Returns the ContextMenu attribute.
Return
Libraries.Web.Page.Attribute: The current ContextMenu attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetContextMenu()
GetDraggable()
Returns the Draggable attribute.
Return
Libraries.Web.Page.Attribute: The current Draggable attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetDraggable()
GetDropZone()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetDropZone()
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetHeight()
This action gets the height attribute of the image.
Return
Libraries.Web.Page.Attribute: The height in pixels of the image.
Example
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image image
Attribute heightInPixels = image:GetHeight()
if heightInPixels not= undefined
text height = heightInPixels:GetValue()
end
GetHidden()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetHidden()
GetIdentifier()
Returns the Identifier attribute.
Return
Libraries.Web.Page.Attribute: The current Identifier attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetIdentifier()
GetIsMap()
This action returns true if the image will be used as a map.
Return
boolean: This returns true if image will be used as a map.
Example
use Libraries.Web.Page.all
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image image
boolean isMap = image:GetIsMap()
GetIterator()
This action returns an iterator of all attributes stored in this object.
Return
Example
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
GetLanguage()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetLanguage()
GetNumberOfAttributes()
This action returns the number of attributes that are currently stored in this object.
Return
integer:
Example
use Libraries.Web.Page.AttributeAccepter
use Libraries.Web.Page.Attribute
AttributeAccepter accept
accept:AddAttribute("src", "http://www.google.com")
integer num = accept:GetNumberOfAttributes()
GetNumberOfNestedTags()
This action gets the number of nested tags within the current WebTag.
Return
integer: The number of nested tags.
Example
use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData
//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
integer numTags = row:GetSize()
GetSpellcheck()
Returns the Spellcheck attribute.
Return
Libraries.Web.Page.Attribute: The current Spellcheck attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetSpellcheck()
GetStyle()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetStyle()
GetTabIndex()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTabIndex()
GetTag(integer index)
This action gets the number of nested tags within the current WebTag.
Parameters
- integer index
Return
Libraries.Web.Page.WebTag: The number of nested tags.
Example
use Libraries.Web.Page.TableRow
use Libraries.Web.Page.TableData
//TableRow and TableData are both WebTags
TableRow row
TableData cell
cell:SetDescription("name")
row:Add(cell)
WebTag tag = row:GetTag(0)
GetTextDirection()
Returns the TextDirection attribute.
Return
Libraries.Web.Page.Attribute: The current TextDirection attribute.
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTextDirection()
GetTitle()
Example
use Libraries.Web.Page.GlobalAttributeAccepter
use Libraries.Web.Page.Attribute
GlobalAttributeAccepter accept
Attribute attribute = accept:GetTitle()
GetUseMap()
This action gets the useMap attribute of the image.
Return
Libraries.Web.Page.Attribute: The mapname to use for the image.
Example
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image image
Attribute useMapName = image:GetUseMap()
if useMapName not= undefined
text mapName = useMapName:GetValue()
end
GetWidth()
This action gets the width attribute of the image.
Return
Libraries.Web.Page.Attribute: The width in pixels of the image.
Example
use Libraries.Web.Page.Image
use Libraries.Web.Page.Attribute
Image im