Jiffie: Java InterFace For Internet Explorer

net.sf.jiffie
Class IHTMLDocument2

Package class diagram package IHTMLDocument2
java.lang.Object
  extended by net.sf.jiffie.IDispatch
      extended by net.sf.jiffie.BrowserDispatch
          extended by net.sf.jiffie.IHTMLDOMNode
              extended by net.sf.jiffie.ElementContainer
                  extended by net.sf.jiffie.IHTMLDocument2
All Implemented Interfaces:
java.lang.Cloneable, Releaseable

public class IHTMLDocument2
extends ElementContainer

Implementation of the IHTMLDocument2 interface.


Field Summary
static java.lang.String IID
           
 
Constructor Summary
IHTMLDocument2(InternetExplorer parentBrowser, Dispatch object)
          Constructor
 
Method Summary
 IHTMLElement createElement(java.lang.String tagName)
          Creates an element given the tagName.
 boolean execCommand(java.lang.String command, boolean showUI, Variant argument)
          Executes a command against the current page.
 IHTMLBodyElement getBody()
          Retrieve the body of the document.
 java.lang.String getCookie()
          Retrieves the cookie associated with this document.
 IHTMLElement getDocumentElement()
          Retrieve the document element.
 java.lang.String getDomain()
          Retrieves the security domain of the document.
 ElementList getFrames()
          Retrieves a list of frames if the current document contains a frameset tag, or a list of iframes if this document contains a body tag.
 java.lang.String getTitle()
          Retrieves the document title.
 java.lang.String getUrl()
          Retrieves the document url.
 void setCookie(java.lang.String cookie)
          Sets the cookie associated with this document.
 void setDomain(java.lang.String domain)
          Sets the security domain of the document.
 void waitWhileIncomplete()
          This method is called to wait until the document is complete.
 void write(java.lang.String html)
          Writes HTML text into the document.
 void writeln(java.lang.String html)
          Writes HTML text into the document.
 
Methods inherited from class net.sf.jiffie.ElementContainer
getElementById, getElementByName, getElementByNameAndTag, getElementByTag, getElementList, getElementListByName, getElementListByNameAndTag, getElementListByTag
 
Methods inherited from class net.sf.jiffie.IHTMLDOMNode
appendChild, createNodeFromProperty, getAttributes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling
 
Methods inherited from class net.sf.jiffie.BrowserDispatch
getElementProperty, getParentBrowser
 
Methods inherited from class net.sf.jiffie.IDispatch
call, call, call, call, call, clone, finalize, getBooleanProperty, getDispatch, getDispatchProperty, getIntegerProperty, getStringProperty, getVariantProperty, isReleased, newDispatch, queryInterface, release, setBooleanProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IID

public static final java.lang.String IID
See Also:
Constant Field Values
Constructor Detail

IHTMLDocument2

public IHTMLDocument2(InternetExplorer parentBrowser,
                      Dispatch object)
Constructor

Parameters:
parentBrowser - parent browser
object - Jacob dispatch interface
Method Detail

getTitle

public java.lang.String getTitle()
Retrieves the document title.

Returns:
document title

getUrl

public java.lang.String getUrl()
Retrieves the document url.

Returns:
document url

getBody

public IHTMLBodyElement getBody()
Retrieve the body of the document.

Returns:
element inner HTML

write

public void write(java.lang.String html)
Writes HTML text into the document.

Parameters:
html - HTML text

writeln

public void writeln(java.lang.String html)
Writes HTML text into the document.

Parameters:
html - HTML text

getCookie

public java.lang.String getCookie()
Retrieves the cookie associated with this document.

Returns:
document cookie

setCookie

public void setCookie(java.lang.String cookie)
Sets the cookie associated with this document.

Parameters:
cookie - document cookie

getDomain

public java.lang.String getDomain()
Retrieves the security domain of the document.

Returns:
security domain of the document.

setDomain

public void setDomain(java.lang.String domain)
Sets the security domain of the document.

Parameters:
domain - security domain of the document

getDocumentElement

public IHTMLElement getDocumentElement()
                                throws JiffieException
Retrieve the document element. This retrieves the root node of the document, typically the tag for an HTML document, but may differ depending on the document type.

Returns:
root node of the document as an IHTMLElement
Throws:
JiffieException

createElement

public IHTMLElement createElement(java.lang.String tagName)
                           throws JiffieException
Creates an element given the tagName.

Parameters:
tagName - tag name of the element to be created.
Returns:
A refference to the element that was created.
Throws:
JiffieException

execCommand

public boolean execCommand(java.lang.String command,
                           boolean showUI,
                           Variant argument)
Executes a command against the current page. The list of available commands is described at the following URL: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/commandids.asp

Parameters:
command - name of the command to execute
showUI - flag indicating if the user interface associated with the command should be shown
argument - argument data
Returns:
boolean flag indicating if the command was successful

getFrames

public ElementList getFrames()
                      throws JiffieException
Retrieves a list of frames if the current document contains a frameset tag, or a list of iframes if this document contains a body tag.

Returns:
list of frames or iframes
Throws:
JiffieException

waitWhileIncomplete

public void waitWhileIncomplete()
                         throws JiffieException
This method is called to wait until the document is complete. Clients of Jiffie should call this prior to attempting to use any of the document contents.

Throws:
JiffieException


Copyright © 2004-2009 Packwood Software. All Rights Reserved.