|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.Container com.sun.lwuit.BrowserComponent
public class BrowserComponent
The browser component is an interface to an embeddable native platform browser on platforms
that support embedding the native browser in place, if you need wide compatibility and flexibility
you should check out the HTMLComponent which provides a lightweight 100% cross platform
web component.
This component will only work on platforms that support embedding a native browser which
exclude earlier versions of Blackberry devices and J2ME devices.
Its recommended that you place this component in a fixed position (none scrollable) on the screen without other
focusable components to prevent confusion between focus authority and allow the component to scroll
itself rather than LWUIT making that decision for it.
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
BrowserComponent()
This constructor will work as expected when a browser component is supported, see isNativeBrowserSupported() |
Method Summary | |
---|---|
void |
addWebEventListener(java.lang.String type,
ActionListener listener)
Adds a listener to the given event type name, event type names are platform specific but some must be fired for all platforms and will invoke the action listener when the appropriate event loads |
void |
back()
Navigates back in the history |
void |
clearHistory()
Clears navigation history |
void |
execute(java.lang.String javaScript)
Executes the given JavaScript string within the current context |
void |
exposeInJavaScript(java.lang.Object o,
java.lang.String name)
Allows exposing the given object to JavaScript code so the JavaScript code can invoke methods and access fields on the given object. |
void |
fireWebEvent(java.lang.String type,
ActionEvent ev)
Used internally by the implementation to fire an event from the native browser widget |
void |
forward()
Navigates forward in the history |
java.lang.String |
getTitle()
The page title |
java.lang.String |
getURL()
The page URL |
boolean |
hasBack()
Indicates whether back is currently available |
boolean |
hasForward()
Indicates whether forward is currently available |
static boolean |
isNativeBrowserSupported()
Returns true if the platform supports embedding a native browser component |
void |
reload()
Reload the current page |
void |
removeWebEventListener(java.lang.String type,
ActionListener listener)
Removes the listener, see addWebEventListener for details |
void |
setPage(java.lang.String html,
java.lang.String baseUrl)
Shows the given HTML in the native viewer |
void |
setProperty(java.lang.String key,
java.lang.Object value)
This method allows customizing the properties of a web view in various ways including platform specific settings. |
void |
setURL(java.lang.String url)
Sets the page URL, jar: URL's must be supported by the implementation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BrowserComponent()
Method Detail |
---|
public static boolean isNativeBrowserSupported()
public void setProperty(java.lang.String key, java.lang.Object value)
key
- see the documentation with the LWUIT Implementation for further detailsvalue
- see the documentation with the LWUIT Implementation for further detailspublic java.lang.String getTitle()
public java.lang.String getURL()
public void setURL(java.lang.String url)
url
- the URLpublic void reload()
public boolean hasBack()
public boolean hasForward()
public void back()
public void forward()
public void clearHistory()
public void setPage(java.lang.String html, java.lang.String baseUrl)
html
- HTML web pagebaseUrl
- base URL to associate with the HTMLpublic void addWebEventListener(java.lang.String type, ActionListener listener)
type
- platform specific but must support: onLoad, onErrorlistener
- callback for the eventpublic void removeWebEventListener(java.lang.String type, ActionListener listener)
type
- see addWebEventListener for detailslistener
- see addWebEventListener for detailspublic void fireWebEvent(java.lang.String type, ActionEvent ev)
type
- the type of the eventev
- the eventpublic void execute(java.lang.String javaScript)
javaScript
- the JavaScript stringpublic void exposeInJavaScript(java.lang.Object o, java.lang.String name)
o
- the object to invoke, notice all public fields and methods would be exposed to JavaScriptname
- the name to expose within JavaScript
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |