|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.ScrollView
net.rim.device.api.ui.Manager
net.rim.device.api.browser.field2.BrowserField
public final class BrowserField
The BrowserField class is used to embed web content within a BlackBerry Java application. This field will take up the dimensions of web content rendered within it. However, it does not provide the ability to scroll implicitly. Instead it is the BrowserField's container's responsibility to implement scrolling.
A simple example of using the BrowserField to render a web page is as follows:
// create new instance of the BrowserField BrowserField browserField = new BrowserField(); // add the browser field to a ui manager or screen screen.add( browserField ); // request the content you wish to display // this method call is typically called once browserField.requestContent( "http://blackberry.com" );
Field Summary |
---|
Fields inherited from class net.rim.device.api.ui.Manager |
---|
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK |
Constructor Summary | ||
---|---|---|
BrowserField()
This contructor will create an instance of the BrowserField with the default configuration. |
||
BrowserField(BrowserFieldConfig config)
This contructor will create an instance of the BrowserField with the default configuration overridden by any configuration explicitly provided by the config parameter. |
Method Summary | ||
---|---|---|
void |
addListener(BrowserFieldListener listener)
This method will register a BrowserFieldListener to be notified for various events pertaining to this instance of a BrowserField. |
|
void |
addStandardRequestHeaders(Hashtable headers,
boolean usingMDS)
Add the standard headers used when making HTTP requests |
|
boolean |
back()
This method will find the previous page loaded into this BrowserField instance and reload it |
|
void |
displayContent(byte[] data,
String contentType,
String baseUrl)
This method will display the byte[] content in this BrowserField instance using the specified content type. |
|
void |
displayContent(String html,
String baseUrl)
This method will display the provided HTML content in this BrowserField instance. |
|
void |
displayContent(InputConnection connection,
String baseUrl)
This method will display the content returned from the provided InputConnection Note: this call does not affect the BrowserField's history. |
|
Object |
executeScript(String script)
This method executes an arbitrary string of JavaScript code and returns a result when appropriate. |
|
void |
extendScriptEngine(String name,
Scriptable scriptable)
This method will extend the current ScriptEngine at the place specified. |
|
boolean |
forward()
This method will find the next page in this BrowserField instance's history and reload it |
|
BrowserFieldConfig |
getConfig()
This method will return the currently active BrowserFieldConfig for this BrowserField instance. |
|
BrowserFieldConnectionManager |
getConnectionManager()
This method will return the currently active BrowserFieldConnectionManager for this BrowserField instance. |
|
BrowserFieldController |
getController()
This method will return the currently active BrowserFieldController for this BrowserField instance. |
|
BrowserFieldCookieManager |
getCookieManager()
This method will return the currently active BrowserFieldCookieManager for this BrowserField instance. |
|
BrowserFieldDebugger |
getDebugger()
This method will return the currently active BrowserFieldDebugger for this BrowserField instance. |
|
Document |
getDocument()
This method will return the Document object for the currently loaded page of this BrowserField instance. |
|
String |
getDocumentTitle()
This method will return the title of the currently loaded page of this BrowserField instance. |
|
String |
getDocumentUrl()
This method will return the URL of the currently loaded page of this BrowserField instance. |
|
BrowserFieldErrorHandler |
getErrorHandler()
This method will return the currently active BrowserFieldErrorHandler for this BrowserField instance. |
|
BrowserFieldHistory |
getHistory()
This method will return the currently active BrowserFieldHistory for this BrowserField instance. |
|
BrowserFieldListener[] |
getListeners()
This method will return an array containing all listeners registered on this BrowserField |
|
XYRect |
getNodePosition(Node node)
This method will return an XYRect object that contains the position of the node as laid out on the BrowserField. |
|
RenderingOptions |
getRenderingOptions()
Deprecated. |
|
ScriptEngine |
getScriptEngine()
This method will return the currently active ScriptEngine for this BrowserField instance. |
|
Node |
getTopmostNode(int x,
int y)
This method will return the topmost node found at the provided x,y coordinates. |
|
float |
getZoomScale()
This method will return the current zoom scale (zoom level) of this BrowserField instance |
|
boolean |
hasHoverStyle(Node node)
This method determines whether or not a node has a hover style associated with it |
|
void |
refresh()
This method will reload the current page in this BrowserField instance's history |
|
void |
removeListener(BrowserFieldListener listener)
This method will deregister the specified BrowserFieldListener so that it no longer receives events from this instance of a BrowserField |
|
void |
requestContent(String url)
This method will request the page specified and display the resulting content into the BrowserField If the url specified is an HTTP URL, the resulting request will be an HTTP GET request |
|
void |
requestContent(String url,
byte[] postData,
Hashtable requestHeaders)
This method will request the page specified and display the resulting content into the BrowserField If the url specified is an HTTP URL and the postData parameter is not null, the resulting request will be an HTTP POST request. |
|
void |
requestContent(BrowserFieldRequest request)
This method will make a request as specified by the request parameter and display the resulting content into this BrowserField instance |
|
void |
setBackground(int color)
This method will set the background color of this BrowserField instance. |
|
void |
setDebugger(BrowserFieldDebugger debugger)
This method will register the BrowserFieldDebugger instance that will capture debugging output for this BrowserField instance. |
|
boolean |
setFocus(Node node,
boolean on)
This method will set focus on or off for a particular node |
|
boolean |
setHover(Node node,
boolean on)
This method will enable hover for a particular node (results in node's hover style to be used) |
|
void |
setZoomScale(float scale)
This method will set the current zoom scale (zoom level) of this BrowserField instance If there is currently no content loaded, this method will do nothing |
Methods inherited from class net.rim.device.api.ui.ScrollView |
---|
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onDisplay, onUndisplay, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrowserField()
public BrowserField(BrowserFieldConfig config)
config
- the BrowserFieldConfig object containing the configuration for this BrowserField instanceMethod Detail |
---|
public void setBackground(int color)
color
- the color to set the background to (in the form: 0xRRGGBB)public Node getTopmostNode(int x, int y)
the
- x coordinatethe
- y coordinatepublic XYRect getNodePosition(Node node)
node
- the node whose position is requested
public boolean setFocus(Node node, boolean on)
node
- the node to which to change focus on or offon
- whether or not to turn focus on or offpublic boolean setHover(Node node, boolean on)
node
- the node to which to change hover on or offon
- whether or not to turn hover on or off
public boolean hasHoverStyle(Node node)
node
- the node in question
public void addListener(BrowserFieldListener listener)
listener
- the BrowserFieldListener instance that will be notified when various events occur in this BrowserFieldpublic void removeListener(BrowserFieldListener listener)
listener
- the BrowserFieldListener instance that will no longer receive event notifications occurred in this BrowserFieldpublic BrowserFieldListener[] getListeners()
public BrowserFieldConnectionManager getConnectionManager()
public BrowserFieldConfig getConfig()
public BrowserFieldCookieManager getCookieManager()
public BrowserFieldController getController()
public BrowserFieldErrorHandler getErrorHandler()
public void setDebugger(BrowserFieldDebugger debugger)
debugger
- the BrowserFieldDebugger object that will capture debugging output output for this BrowserField instancepublic BrowserFieldDebugger getDebugger()
public BrowserFieldHistory getHistory()
public ScriptEngine getScriptEngine()
public Object executeScript(String script)
script
- A string representation of arbitrary JavaScript code
IllegalStateException
- this exception is thrown if this method invoked before this BrowserField's document has
been created. This event is communicated via the BrowserFieldListener.documentCreated() method.public void extendScriptEngine(String name, Scriptable scriptable) throws Exception
name
- The name by which the added Scriptable will be accessible by JavaScriptscriptable
- The implementation of the ScriptEngine extension itself.
Exception
public Document getDocument()
public String getDocumentUrl()
public String getDocumentTitle()
public void requestContent(String url)
url
- The url for the page content to displaypublic void requestContent(String url, byte[] postData, Hashtable requestHeaders)
url
- The url for the page content to displaypostData
- The data to be used for a HTTP POST request. In the case of non-HTTP requests, this
parameter is ignored.requestHeaders
- A set of name-value pairs to be inserted into an HTTP request. In the case of
non-HTTP requests, this parameter is ignored.public void requestContent(BrowserFieldRequest request)
request
- An object containing specifics about the request to be made to retrieve the page contentpublic RenderingOptions getRenderingOptions()
public void displayContent(String html, String baseUrl)
html
- The HTML content to be displayedbaseUrl
- The URL identifying this content. This will be used to resolve relative urls.public void displayContent(byte[] data, String contentType, String baseUrl)
data
- The content to be displayedcontentType
- The content type of the byte data providedbaseUrl
- The URL identifying this content. This will be used to resolve relative urls.public void displayContent(InputConnection connection, String baseUrl)
connection
- This connection should have an input stream that will be used to provide
content to load into this BrowserField instance.baseUrl
- The URL identifying this content. This will be used to resolve relative urls.public void setZoomScale(float scale)
scale
- The new zoom scale for this BrowserField instancepublic float getZoomScale()
public boolean back()
public boolean forward()
public void refresh()
public void addStandardRequestHeaders(Hashtable headers, boolean usingMDS)
requestHeaders
- The current set of request headers to add tousingMDS
- Indicating whether or not an MDS transport service is being used
to make the HTTP request
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.