|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.ibm.jdg2e.activex.editor.ActiveXWebBrowser
This class send commands to the Win32 "Shell.Explorer" OLE control using OleAutomation objects to to 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 example 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
an 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 and the WebBrowser Control reference.
See the generated .IDL file (by the OLE/COM Object Viewer)
typelib filename: mshtml.idl file in the doc folder of this project
| 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. |
void |
Navigate(java.lang.String url)
Navigates to a particular URL. |
void |
Refresh()
Refreshes the currently viewed page. |
void |
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.| Method Detail |
public int delete()
public void dispose()
public int docExecCommand(java.lang.String command)
command - -
see the document exec command identifiers in MSDN
public 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 void Navigate(java.lang.String url)
public void Refresh()
public void replace(java.lang.String replaceText)
public int selectAll()
public boolean setDesignModeProperty(java.lang.String flag)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||