public class nUIWebView extends nUIViewDisplay
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 |
---|
nUIWebView() |
nUIWebView(java.util.Hashtable properties) |
nUIWebView(nUIWebviewElement webviewElement) |
nUIWebView(nUIWebviewElement webviewElement,
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.
|
nUIWebviewElement |
createWebviewElement()
Creates the
nUIWebviewElement that will be used internally in this View. |
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.
|
int |
getBgcolor()
Gets the current background colour, if one has been set directly.
|
boolean |
getHscrollable()
Determine if this web view allows horizontal scrolling.
|
nUIWebviewCallBack |
getRegisteredCallback()
Return the currently registered callback for this Webview, or
null . |
boolean |
getVscrollable()
Determine if this web view allows vertical scrolling.
|
boolean |
insertAt(int index,
nUIObject to_add)
Insert a nUIObject as a child of this one, at the given index.
|
boolean |
isOverscrollingEnabled()
Determine if overscrolling is enabled on this nUIWebView.
|
boolean |
isScaleToFitEnabled()
Determine if this nUIWebView will attempt to scale HTML content to fit the page.
|
boolean |
isZoomControlEnabled()
Determine if this nUIWebView 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.
|
boolean |
registerCallBack(nUIWebviewCallBack callback)
Register a callback to process url requests from this webview.
|
void |
reload()
Reload the current document.
|
void |
setBgcolor(int bgcolor)
Sets the background colour of this nUIWebView.
|
void |
setHscrollable(boolean hscrollable)
Sets whether this web view is 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 nUIWebView (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.
|
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 view is 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 through "pinch and zoom" or other controls.
|
getBgimageScroll, getHeaderBackground, getHeaderHeight, getHeadertext, getInterElementYSpacing, getPopupDismissText, onUISynced, setBgimageScroll, setHeaderBackground, setHeaderFgColor, setHeadertext, setInterElementYSpacing, setPopupDismissText, syncUI
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, insertBefore, outputChildHierarchy, remove, removeEventListener, replace, replace, setId, setTag, setUnlinkChildrenOnRemoval
public nUIWebView()
public nUIWebView(java.util.Hashtable properties)
public nUIWebView(nUIWebviewElement webviewElement)
public nUIWebView(nUIWebviewElement webviewElement, java.util.Hashtable properties)
public nUIWebviewElement createWebviewElement()
nUIWebviewElement
that will be used internally in this View.public void setURL(java.lang.String url)
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()
public boolean insertAt(int index, nUIObject to_add)
nUIObject
public void setHTMLText(java.lang.String html_data)
html_data
- public void setHscrollable(boolean hscrollable)
setHscrollable
in class nUIViewDisplay
hscrollable
- true to allow scrolling.public void setVscrollable(boolean vscrollable)
setVscrollable
in class nUIViewDisplay
vscrollable
- true to allow scrolling.public boolean getHscrollable()
getHscrollable
in class nUIViewDisplay
public boolean getVscrollable()
getVscrollable
in class nUIViewDisplay
public boolean registerCallBack(nUIWebviewCallBack callback)
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
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)
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
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)
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 int getBgcolor()
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()