java.lang.Object | +--com.ibm.lab.soln.interopedit.editors.ActiveXWebBrowser
This uses OleAutomation objects o send commands to the Win32 "Shell.Explorer" OLE control. Instances of this class manage the setup, typical use, and teardown of a simple web browser. This class wrappers, or is a proxy to, an aggregate of OLE automation objects contained in the Microsoft Web Browser control. Shell.Explorer (OleControSite). The Shdocvw.dll component is more frequently referred as the WebBrowser Control.The WebBrowser control in turn hosts the MSHTML control (mshtml.dll). Mshtml.dll is the component that performs the HTML parsing and rendering in Internet Explorer 4.0 and later. The MSHTML control provides all interfaces for accessing the DOM. The IDispatch interfaces used in this exercise are the same interfaces used to access the object model by scripts within web pages. We implement just a small portion of the automation capabilities of MSHTML here in this excercise. The MSHTML control (mshtml.dll) with IE 5.5 and above exposes a automation model that supports most commonly used editing features for both text and forms. This makes it possible to develop WYSIWYG HTML editing inside an Eclipse editor. This editor page allows users to enter * formatted text, images, etc. To learn more about MSTHL the DOM and the editing capabilities, see the MSDN:
Field Summary | |
static int |
DISPID_ACTIVE_ELEMENT
|
static int |
DISPID_BODY
|
static int |
DISPID_DOCUMENT
|
static int |
DISPID_DOCUMENT_ELEMENT
|
static int |
DISPID_INNERHTML
|
static int |
DISPID_READYSTATE
|
static int |
READYSTATE_COMPLETE
|
static int |
READYSTATE_INTERACTIVE
|
static int |
READYSTATE_LOADED
|
static int |
READYSTATE_LOADING
|
static int |
READYSTATE_UNINITIALIZED
|
Constructor Summary | |
ActiveXWebBrowser(org.eclipse.swt.ole.win32.OleAutomation oleAutomation,
org.eclipse.swt.ole.win32.OleControlSite controlSite)
Creates a Web browser control. |
Method Summary | |
int |
delete()
Method to delete/clear the document contents |
void |
dispose()
Method disposes of the OLE Automation object. |
int |
docExecCommand(java.lang.String command)
Method docExecCommand. |
int |
getDocReadyState()
Returns the current state of the control. |
org.eclipse.swt.ole.win32.OleAutomation |
getDocumentAutomation()
Method gets the document automation object. |
org.eclipse.swt.ole.win32.OleAutomation |
getElementAutomation()
Method A helper to dig out the document element |
java.lang.String |
getinnerHTML()
Method gets all the HTML code in the document |
int |
getReadyState()
Returns the current state of the control. |
static ActiveXWebBrowser |
getWebBrowser()
Returns the webBrowser. |
int |
Navigate(java.lang.String url)
Navigates to a particular URL. |
void |
Refresh()
Refreshes the currently viewed page. |
int |
replace(java.lang.String replaceText)
Method to replace the document contents |
int |
selectAll()
Method to Select All editor contents |
boolean |
setDesignModeProperty(java.lang.String flag)
Method setDesignModePropertyOn. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DISPID_ACTIVE_ELEMENT
public static final int DISPID_BODY
public static final int DISPID_DOCUMENT
public static final int DISPID_DOCUMENT_ELEMENT
public static final int DISPID_INNERHTML
public static final int DISPID_READYSTATE
public static final int READYSTATE_COMPLETE
public static final int READYSTATE_INTERACTIVE
public static final int READYSTATE_LOADED
public static final int READYSTATE_LOADING
public static final int READYSTATE_UNINITIALIZED
Constructor Detail |
public ActiveXWebBrowser(org.eclipse.swt.ole.win32.OleAutomation oleAutomation, org.eclipse.swt.ole.win32.OleControlSite controlSite)
Typical use:
OleControlSite oleControlSite = new OleControlSite(oleFrame, style, "Shell.Explorer");
OleAutomation oleAutomation = new OleAutomation(oleControlSite);
OleWebBrowser webBrowser = new OleWebBrowser(oleControlSite, oleAutomation);
oleAutomation
- the OleAutomation object for this control.oleControlSite
- the OleControlSite object for this control.Method Detail |
public int delete()
string
- public void dispose()
public int docExecCommand(java.lang.String command)
command
- - see the document exec command identifiers in MSDNpublic int getDocReadyState()
public org.eclipse.swt.ole.win32.OleAutomation getDocumentAutomation()
public org.eclipse.swt.ole.win32.OleAutomation getElementAutomation()
public java.lang.String getinnerHTML()
public int getReadyState()
public static ActiveXWebBrowser getWebBrowser()
public int Navigate(java.lang.String url)
public void Refresh()
public int replace(java.lang.String replaceText)
string
- - replacement textpublic int selectAll()
string
- public boolean setDesignModeProperty(java.lang.String flag)