Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.lobobrowser.html.test.SimpleHtmlRendererContext
SimpleHtmlRendererContext
class implements
the HtmlRendererContext
interface.
Note that this class provides simple implementations
of most methods, which should be overridden to provide
real-world functionality.
Constructor Summary | |
| |
| |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
boolean |
|
BrowserFrame | |
protected HtmlParserContext |
|
void |
|
void |
|
void |
|
String | |
HTMLCollection | |
HtmlObject |
|
int | |
String |
|
HtmlRendererContext | |
HtmlRendererContext | |
protected Proxy |
|
String | |
String | |
HtmlRendererContext |
|
UserAgentContext | |
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
HtmlRendererContext |
|
HtmlRendererContext |
|
String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public SimpleHtmlRendererContext(HtmlPanel contextComponent)
Constructs a SimpleHtmlRendererContext.
- Parameters:
contextComponent
- The component that will render HTML.
public SimpleHtmlRendererContext(HtmlPanel contextComponent, HtmlParserContext pcontext)
Deprecated. HtmlParserContext is no longer used in this class.
Constructs a simpleHtmlRendererContext
without a parent. This constructor should not be used to create the context of a frame with a parent.
- Parameters:
contextComponent
-pcontext
-
public SimpleHtmlRendererContext(HtmlPanel contextComponent, HtmlParserContext pcontext, HtmlRendererContext parentRcontext)
Deprecated. HtmlParserContext is no longer used in this class.
Constructs a SimpleHtmlRendererContext.
- Parameters:
contextComponent
- The component that will render HTML.pcontext
- A parser context.parentRcontext
- The parent's renderer context. This isnull
for the root renderer context. Normally ony frame renderer contexts would have parents.
public SimpleHtmlRendererContext(HtmlPanel contextComponent, HtmlRendererContext parentRcontext)
Constructs a SimpleHtmlRendererContext.
- Parameters:
contextComponent
- The component that will render HTML.parentRcontext
- The parent's renderer context. This isnull
for the root renderer context. Normally ony frame renderer contexts would have parents.
public BrowserFrame createBrowserFrame()
- Specified by:
- createBrowserFrame in interface HtmlRendererContext
protected HtmlParserContext createParserContext(java.net.URL url)
This method is called by the local navigate() implementation and creates aSimpleHtmlParserContext
. Override this method if you need to use the local navigate() implementation with an overridden parser context.
public void error(String message)
public void error(String message, Throwable throwable)
public String getDefaultStatus()
- Specified by:
- getDefaultStatus in interface HtmlRendererContext
public HtmlObject getHtmlObject(HTMLElement element)
- Specified by:
- getHtmlObject in interface HtmlRendererContext
public int getLength()
public HtmlRendererContext getOpener()
- Specified by:
- getOpener in interface HtmlRendererContext
public HtmlRendererContext getParent()
- Specified by:
- getParent in interface HtmlRendererContext
protected Proxy getProxy()
Gets the connection proxy used innavigate(URL,String)
. This implementation callsSimpleUserAgentContext.getProxy()
ifgetUserAgentContext()
returns an instance assignable toSimpleUserAgentContext
. The method may be overridden to provide a different proxy setting.
public String getSourceCode()
public UserAgentContext getUserAgentContext()
- Specified by:
- getUserAgentContext in interface HtmlRendererContext
public boolean isMedia(String mediaName)
Deprecated. This method has been moved to
UserAgentContext
. Override method from SimpleUserAgentContext instead.
public boolean isVisitedLink(HTMLLinkElement link)
Should be overridden to return true if the link has been visited.
- Specified by:
- isVisitedLink in interface HtmlRendererContext
public void linkClicked(HTMLElement linkNode, URL url, String target)
Implements the link click handler by invokingnavigate(URL,String)
.
- Specified by:
- linkClicked in interface HtmlRendererContext
public void navigate(URL href, String target)
Implements simple navigation with incremental rendering, and target processing, including frame lookup. Should be overridden to allow for more robust browser navigation. Notes:
- Encoding ISO-8859-1 assumed always.
- Caching is not implemented.
- Cookies are not implemented.
- Incremental rendering is not optimized for ignorable document change notifications.
- Other HTTP features are not implemented.
- Specified by:
- navigate in interface HtmlRendererContext
public void onContextMenu(HTMLElement element, MouseEvent event)
This method must be overridden to implement a context menu.
public void onMouseOut(HTMLElement element, MouseEvent event)
This method can be overridden to receive notifications when the mouse leaves an element.
public void onMouseOver(HTMLElement element, MouseEvent event)
This method can be overridden to receive notifications when the mouse first enters an element.
public HtmlRendererContext open(String url, String windowName, String windowFeatures, boolean replace)
- Specified by:
- open in interface HtmlRendererContext
public HtmlRendererContext open(java.net.URL url, String windowName, String windowFeatures, boolean replace)
public String prompt(String message, String inputDefault)
- Specified by:
- prompt in interface HtmlRendererContext
public void reload()
Implements reload as navigation to current URL. Override to implement a more robust reloading mechanism.
- Specified by:
- reload in interface HtmlRendererContext
public void setDefaultStatus(String message)
- Specified by:
- setDefaultStatus in interface HtmlRendererContext
public void setOpener(HtmlRendererContext opener)
- Specified by:
- setOpener in interface HtmlRendererContext
public void setStatus(String message)
- Specified by:
- setStatus in interface HtmlRendererContext
public void submitForm(String method, java.net.URL action, String target, String enctype, FormInput[] formInputs)
public void warn(String message)
public void warn(String message, Throwable throwable)