public class nUIWebviewElement extends nUIElementDisplay implements IWebviewElement
Y_IDENTIFIER_PREV_BOTTOM
COLOR_BACKGROUND_NORMAL, COLOR_BLACK, COLOR_FOREGROUND_DARK, COLOR_FOREGROUND_LIGHT, COLOR_FOREGROUND_NORMAL, COLOR_TRANSPARENT, COLOR_WHITE, DIMENSIONS_IDENTIFIER_PARENT_DIMENSIONS
Constructor and Description |
---|
nUIWebviewElement() |
nUIWebviewElement(java.util.Hashtable properties) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
callJavaScript(java.lang.String method,
java.lang.String[] parameters)
Evaluate some JavaScript on this page by calling a method.
|
void |
callJavaScript(java.lang.String method,
java.lang.String[] parameters,
IJSCallback callback)
Evaluate some JavaScript on this page by calling a method.
|
java.lang.String |
evaluateJavaScript(java.lang.String script)
Evaluate an arbitrary block of JavaScript code, and return the result (if any).
|
void |
evaluateJavaScript(java.lang.String script,
IJSCallback callback)
Evaluate an arbitrary piece of JavaScript code, asynchronously if possible.
|
boolean |
getHscrollable()
Determine whether this web element will scroll horizontally.
|
nUIWebviewCallBack |
getRegisteredCallback()
Return the currently registered callback for this Webview, or
null . |
boolean |
getVscrollable()
Determine whether this web element will scroll vertically.
|
boolean |
isOverscrollingEnabled()
Determine if overscrolling is enabled on this nUIWebviewElement.
|
boolean |
isScaleToFitEnabled()
Determine if this nUIWebviewElement will attempt to scale HTML content to fit the page.
|
boolean |
isZoomControlEnabled()
Determine if this nUIWebviewElement will attempt to use platform-provided zooming controls that are available.
|
boolean |
isZoomingEnabled()
Determine if the user is allowed to zoom in on the content in this webview element.
|
boolean |
registerCallBack(nUIWebviewCallBack callback)
Register a callback to process url requests from this webview.
|
void |
reload()
Reload the current document.
|
void |
renderInternal(javax.microedition.lcdui.Graphics g,
int x,
int y,
int width,
int height,
int parent_inner_x,
int parent_inner_y,
int parent_inner_width,
int parent_inner_height,
boolean webviewTop) |
void |
setBgcolor(int bgcolor)
Sets the background colour of this nUIWebviewElement.
|
IWebviewElement |
setDelegate(IWebviewElement delegate) |
void |
setFocus(boolean focus) |
void |
setHscrollable(boolean hscrollable)
Sets whether this web element should be allowed to scroll horizontally.
|
void |
setHTMLText(java.lang.String html_data)
Sets the content of the page directly by passing in raw html.
|
void |
setOverscrollingEnabled(boolean overscrollingEnabled)
Enable or disable overscrolling when reaching the end of the content of this
nUIWebviewElement (sometimes called "bouncing").
|
void |
setScaleToFitEnabled(boolean scaleToFitEnabled)
Enable or disable scaling web content to fit the page (if available).
|
void |
setURL(java.lang.String url)
Sets the current URL to visit.
|
void |
setURL(java.lang.String url,
java.lang.String mimeType)
Sets the URL and its mime-type
|
void |
setVscrollable(boolean vscrollable)
Sets whether this web element should be allowed to scroll vertically.
|
void |
setZoomControlEnabled(boolean zoomControlEnabled)
Enable or disable any platform-provided magnification controls (zoom in/out buttons, sliders, etc.) that may be available.
|
void |
setZoomingEnabled(boolean zoomingEnabled)
Enable or disable user-driven magnification of the content in this webview element through "pinch and zoom" or other controls.
|
applyBackground, applyBackground, applyBackground
getBackgroundDrawable, getBottom, getElementIdentifier, getFocusable, getGesturable, getHeight, getInnerHeight, getInnerWidth, getInnerX, getInnerY, getLeft, getMaxChildX, getMaxChildY, getProperties, getProperty, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, getY, insertAtInternal, isEnabled, isVisible, onRemoved, remove, setBackgroundDrawable, setBottom, setElementIdentifier, setEnabled, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setProperties, setProperty, setRight, setTop, setTriggerable, setVisible, setWidth, setX, setY
add, addEventListener, childElementAt, childIndexOf, getFirstChild, getId, getLastChild, getNextSibling, getParent, getPrevSibling, getTag, insertAfter, insertAt, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setId, setTag, setUnlinkChildrenOnRemoval
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setBackgroundDrawable
public nUIWebviewElement()
public nUIWebviewElement(java.util.Hashtable properties)
public IWebviewElement setDelegate(IWebviewElement delegate)
public void setURL(java.lang.String url)
setURL
in interface IWebviewElement
url
- the url to load nowpublic void setURL(java.lang.String url, java.lang.String mimeType)
url
- - the URL to loadmimeType
- - the expected mime-typepublic void reload()
reload
in interface IWebviewElement
public void setHTMLText(java.lang.String html_data)
setHTMLText
in interface IWebviewElement
html_data
- public void setHscrollable(boolean hscrollable)
hscrollable
- true if scrolling should be allowed.public boolean getHscrollable()
public void setVscrollable(boolean vscrollable)
vscrollable
- true to enable scrolling.public boolean getVscrollable()
public boolean registerCallBack(nUIWebviewCallBack callback)
registerCallBack
in interface IWebviewElement
callback
- the nUIWebviewCallBack
to register,
or null
to remove the existing callback.public nUIWebviewCallBack getRegisteredCallback()
null
.public java.lang.String callJavaScript(java.lang.String method, java.lang.String[] parameters) throws java.lang.Exception
callJavaScript
in interface IWebviewElement
method
- The name of the JavaScript method to call, e.g. "myMethod".parameters
- String constants that should be passed to the method to be called, in order.an
- Exception if the request cannot be handled on this Thread.java.lang.Exception
public void callJavaScript(java.lang.String method, java.lang.String[] parameters, IJSCallback callback)
callJavaScript
in interface IWebviewElement
method
- The name of the JavaScript method to call, e.g. "myMethod".parameters
- String constants that should be passed to the method to be called, in order.callback
- The callback that will be notified when evaluation completes.public java.lang.String evaluateJavaScript(java.lang.String script) throws java.lang.Exception
evaluateJavaScript
in interface IWebviewElement
script
- the JavaScript code to evaluate.an
- Exception if the request cannot be handled on this Thread.java.lang.Exception
public void evaluateJavaScript(java.lang.String script, IJSCallback callback)
evaluateJavaScript
in interface IWebviewElement
script
- the JavaScript code to evaluate.callback
- the callback that will be notified when evaluation completes. Can be null if no callback is required.public void setBgcolor(int bgcolor)
bgcolor
- an ARGB color.public void setOverscrollingEnabled(boolean overscrollingEnabled)
overscrollingEnabled
- indicates if overscrolling is enabled or not.public boolean isOverscrollingEnabled()
public void setScaleToFitEnabled(boolean scaleToFitEnabled)
scaleToFitEnabled
- indicates if scaling to fit is enabled or not.public boolean isScaleToFitEnabled()
public void setZoomControlEnabled(boolean zoomControlEnabled)
zoomControlEnabled
- set to true to indicate the OS should provide extra controls.public boolean isZoomControlEnabled()
public void setZoomingEnabled(boolean zoomingEnabled)
zoomingEnabled
- true if the content may be zoomed.public boolean isZoomingEnabled()
public void renderInternal(javax.microedition.lcdui.Graphics g, int x, int y, int width, int height, int parent_inner_x, int parent_inner_y, int parent_inner_width, int parent_inner_height, boolean webviewTop)
public void setFocus(boolean focus)
setFocus
in interface IWebviewElement