public interface IDocument
A
This class allows access to the underlying Document Object Model of a WebpageDocument class can be retrieved by calling
getDocument() on an IBrowserCanvas
after the current page has loaded. The current page has finished loading
when the NetworkEvent onDocumentComplete has fired.
NetworkListener| Modifier and Type | Method and Description |
|---|---|
void |
addScrollPositionListener(ScrollPositionListener listener)
Add a ScrollPositionListener to this document.
|
void |
close()
Deprecated.
This method is not implemented.
|
IElement |
createElement(String name)
Creates an instance of the element for the specified tag.
|
IRange |
createRange()
Returns an empty Range object that is tied to the current document.
|
void |
deleteSelectedText()
Deletes the current selected text.
|
IElement |
elementFromPoint(long x,
long y)
Gets the element object located at coordinate (x, y) on the document.
|
boolean |
equals(IDocument element)
Compares with another IDocument.
|
void |
execCommand(String cmd,
boolean showUI,
String value)
Executes a command on the current document with specified value.
|
IElement |
getActiveElement()
Gets the object that has the focus when the parent document has focus.
|
String |
getAlinkColour()
Gets the colour of all active links in the document.
|
IElementCollection |
getAll()
Gets an interface pointer to a zero-based
collection of all the elements in the HTML document.
|
IElementCollection |
getAnchors()
Gets an interface pointer to a zero-based
collection of all the anchors in an HTML document.
|
IElementCollection |
getApplets()
Gets an interface pointer to a zero-based
collection of all the applet objects in an HTML
document.
|
String |
getBgColour()
Gets a value that indicates the
background color behind the object.
|
IElement |
getBody()
Gets the document's body object.
|
String |
getCharSet()
Gets the character set used to encode the object.
|
IDocument[] |
getChildFrames()
Gets the child frames of a document.
|
String |
getCookie()
Gets the string value of a cookie.
|
String |
getDocumentSource()
Gets the unmodified source for the document.
|
String |
getDomain()
Gets the security domain of the document.
|
IElement |
getElementById(String iD)
Returns the
IElement with specified
ID or null if no element exists with that ID |
IElementCollection |
getEmbeds()
Gets an interface pointer to a zero-based
collection of all the embed objects in an HTML
document.
|
String |
getFgColour()
Gets the foreground (text) colour of the document.
|
String |
getFileModifiedDate()
Deprecated.
This method is not implemented.
|
IElementCollection |
getForms()
Gets an interface pointer to a zero-based
collection of all the form objects in an HTML document.
|
IElementCollection |
getImages()
Gets a collection of images in a document.
|
String |
getLinkColour()
Gets the colour of the document links.
|
IElementCollection |
getLinks()
Gets an interface pointer to a zero-based
collection of all the link and area objects in an
HTML document.
|
String |
getReferrer()
Gets the referrer URL.
|
String |
getSelectedText()
Returns the active text selection in the document.
|
IRange |
getSelectionAsRange()
Returns a Range object that is constructed from the current selection.
|
IStyleSheet[] |
getStyleSheets()
Get the styleSheets on the document.
|
String |
getTitle()
Gets the title of the document.
|
String |
getURL()
Deprecated.
This method is not implemented.
|
String |
getVlinkColour()
Gets the colour of the links that the user has visited.
|
void |
open()
Deprecated.
This method is not implemented.
|
void |
putAlinkColour(String col)
Sets the colour of all active links in the document.
|
void |
putBgColour(String col)
Sets the value that indicates the
background colour of the document.
|
void |
putCookie(String cookie)
Sets the String value of a cookie
|
void |
putFgColour(String col)
Sets the foreground (text) colour of the document.
|
void |
putLinkColour(String col)
Sets the colour of links in the document.
|
void |
putTitle(String title)
Sets the title of the document.
|
void |
putVlinkColour(String col)
Sets the colour in which visited links are displayed.
|
void |
removeScrollPositionListener(ScrollPositionListener listener)
Remove a scrollPositionListener from this Document.
|
void |
scrollTo(long x,
long y)
Scroll this Document to given x,y position.
|
String |
toString()
Gets a string representation of the object.
|
void |
write(String data)
Deprecated.
This method is not implemented.
|
void |
writeln(String data)
Deprecated.
This method is not implemented.
|
IElement getActiveElement()
MozillaBrowserCanvas
it will only get focusable elements, as Mozilla has no concept of an active element.String getAlinkColour()
void putAlinkColour(String col)
col - the colour of active links.IElementCollection getAll()
IElementCollection getAnchors()
IElementCollection getApplets()
String getBgColour()
void putBgColour(String col)
col - background colour of the document.IElement getBody()
String getCharSet()
void close()
String getCookie()
void putCookie(String cookie)
cookie - value of cookieIElement createElement(String name)
name - tagString getDomain()
IElement elementFromPoint(long x, long y)
x - X-coordinate.y - Y-coordinate.IElementCollection getEmbeds()
String getFgColour()
void putFgColour(String col)
col - Foreground colour of the document.String getFileModifiedDate()
IElementCollection getForms()
IDocument[] getChildFrames()
IElementCollection getImages()
String getLinkColour()
void putLinkColour(String col)
col - Colour of the links.IElementCollection getLinks()
String getReferrer()
IStyleSheet[] getStyleSheets()
String getTitle()
void putTitle(String title)
title - The title of the document.String toString()
String getURL()
String getVlinkColour()
void putVlinkColour(String col)
col - Colour of the links.void open()
void write(String data)
data - HTML expression.void writeln(String data)
data - HTML expression.String getSelectedText()
IRange createRange()
IRange getSelectionAsRange()
null is returned.IElement getElementById(String iD)
IElement with specified
ID or null if no element exists with that IDiD - ID of element.boolean equals(IDocument element)
element - IDocument to comparetrue if IDocuments are the same.void addScrollPositionListener(ScrollPositionListener listener)
listener - The ScrollPositionListener to add.void removeScrollPositionListener(ScrollPositionListener listener)
listener - The ScrollPositionListener to remove.void scrollTo(long x,
long y)
x - coordinate.y - coordinate.void execCommand(String cmd, boolean showUI, String value)
doc.execCommand("Bold",false,"");
doc.execCommand("Font",false,"Arial");
doc.execCommand("FontSize",false,"3");
doc.execCommand("ForeColor",false,"red");
doc.execCommand("Italic",false,"");
doc.execCommand("Underline",false,"");
See http://msdn.microsoft.com/workshop/author/dhtml/reference/commandids.asp for a complete list of commands.
cmd - The command to execute.showUI - if set to true, display a user interface if the command supports one.value - the value to assign.String getDocumentSource()
void deleteSelectedText()