This document describes the suggested Embedded Browser API.
BrowserFactory.createBrowser(BrowserType);
Note: There should be also created enumeration BrowserType, which will define browser type component to be created, i.e. firefox, ie, etc.
Those should be enough for the basic browsing. Now here other methods, which provide other features.
Summary of the API in tables:
| BrowserType enumeration | |
|---|---|
| Field name | Meaning of the field |
| FIREFOX | |
| UNKNOWN | Representing uknown browser type (not defined by this enumeration yet). |
| BrowserFactory class | |
|---|---|
| Method name | Purpose of the Method |
| public Browser createBrowser(BrowserType) | Factory method creating browser component of specified browser type. |
| Browser interface | |
|---|---|
| Method name | Purpose of the Method |
| public JComponent getComponent() | Provides Swing component representing the browser canvas. |
| public void showUrl(String) | Shows the specified URL (as if typed in address field (in full browser). |
| public org.w3c.dom.Document read(InputStream) | Reads input stream and provides DOM document constructed from it. |
| public Point getLocation(Element) | Gets location of the element on the canvas. |
| public Rectangle\\ getBoxRectangles(Element) | Gets box rectangles for the specified element. This might require notion of Box to be defined. |
| public Element getElementAt(Point) | Gets element which corresponds to certain point on canvas. This might be enhanced to provide all elements in z-order at the point. |
That should be all the first, but later there might be found out more detailed needs, e.g. like need of css box notion (in order to be able better to control elements which create more and complicated box structure, e.g. table).