本文整理汇总了Java中org.xwalk.core.XWalkJavascriptResult类的典型用法代码示例。如果您正苦于以下问题:Java XWalkJavascriptResult类的具体用法?Java XWalkJavascriptResult怎么用?Java XWalkJavascriptResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XWalkJavascriptResult类属于org.xwalk.core包,在下文中一共展示了XWalkJavascriptResult类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onJavascriptModalDialog
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
@Override
public boolean onJavascriptModalDialog(XWalkView view, JavascriptMessageType type, String url,
String message, String defaultValue, XWalkJavascriptResult result) {
switch (type) {
case JAVASCRIPT_ALERT:
return onJsAlert(view, url, message, result);
case JAVASCRIPT_CONFIRM:
return onJsConfirm(view, url, message, result);
case JAVASCRIPT_PROMPT:
return onJsPrompt(view, url, message, defaultValue, result);
case JAVASCRIPT_BEFOREUNLOAD:
// Reuse onJsConfirm to show the dialog.
return onJsConfirm(view, url, message, result);
default:
break;
}
assert (false);
return false;
}
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:20,代码来源:XWalkCordovaUiClient.java
示例2: onJsPrompt
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
/**
* Tell the client to display a prompt dialog to the user.
* If the client returns true, WebView will assume that the client will
* handle the prompt dialog and call the appropriate JsPromptResult method.
* <p/>
* Since we are hacking prompts for our own purposes, we should not be using them for
* this purpose, perhaps we should hack console.log to do this instead!
*/
public boolean onJsPrompt(XWalkView view, String origin, String message, String defaultValue,
final XWalkJavascriptResult result) {
// Unlike the @JavascriptInterface bridge, this method is always called on the UI thread.
String handledRet = parentEngine.bridge.promptOnJsPrompt(origin, message, defaultValue);
if (handledRet != null) {
result.confirmWithResult(handledRet);
} else {
dialogsHelper.showPrompt(message, defaultValue, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirmWithResult(value);
} else {
result.cancel();
}
}
});
}
return true;
}
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:30,代码来源:XWalkCordovaUiClient.java
示例3: onJavascriptModalDialog
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
@Override
public boolean onJavascriptModalDialog(XWalkView view, JavascriptMessageType type, String url,
String message, String defaultValue, XWalkJavascriptResult result) {
switch(type) {
case JAVASCRIPT_ALERT:
return onJsAlert(view, url, message, result);
case JAVASCRIPT_CONFIRM:
return onJsConfirm(view, url, message, result);
case JAVASCRIPT_PROMPT:
return onJsPrompt(view, url, message, defaultValue, result);
case JAVASCRIPT_BEFOREUNLOAD:
// Reuse onJsConfirm to show the dialog.
return onJsConfirm(view, url, message, result);
default:
break;
}
assert(false);
return false;
}
开发者ID:ZachMoreno,项目名称:krakn,代码行数:20,代码来源:XWalkCordovaUiClient.java
示例4: AppDeckApiCall
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
public AppDeckApiCall(String command, String inputJSON, XWalkJavascriptResult/*JsPromptResult*/ result)
{
this.command = command;
this.inputJSON = inputJSON;
this.result = result;
input = null;
try {
//JSONArray inputArray = (JSONArray) new JSONTokener(inputJSON).nextValue();
inputObject = (JSONObject) new JSONTokener(inputJSON).nextValue();
input = new AppDeckJsonNode(inputObject);
param = new AppDeckJsonNode(paramObject);
eventID = input.getString("eventid", "false");
Object obj = inputObject.opt("param");
if (obj instanceof JSONObject)
param = new AppDeckJsonNode((JSONObject)obj);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:22,代码来源:AppDeckApiCall.java
示例5: appCanJsParse
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
private void appCanJsParse(final XWalkJavascriptResult result, XWalkView view, String parseStr) {
try {
if (!(view instanceof EBrowserView)) {
return;
}
EBrowserView browserView = (EBrowserView) view;
final EUExManager uexManager = browserView.getEUExManager();
if (uexManager != null) {
result.confirmWithResult(uexManager.dispatch(parseStr));
}
} catch (Exception e) {
if (BDebug.DEBUG) {
e.printStackTrace();
}
}
}
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:17,代码来源:CBrowserMainFrame.java
示例6: onJsAlert
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
/**
* Tell the client to display a javascript alert dialog.
*/
public boolean onJsAlert(XWalkView view, String url, String message,
final XWalkJavascriptResult result) {
dialogsHelper.showAlert(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:18,代码来源:XWalkCordovaUiClient.java
示例7: onJsConfirm
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
/**
* Tell the client to display a confirm dialog to the user.
*/
public boolean onJsConfirm(XWalkView view, String url, String message,
final XWalkJavascriptResult result) {
dialogsHelper.showConfirm(message, new CordovaDialogsHelper.Result() {
@Override
public void gotResult(boolean success, String value) {
if (success) {
result.confirm();
} else {
result.cancel();
}
}
});
return true;
}
开发者ID:infil00p,项目名称:cordova-plugin-crosswalk-webview,代码行数:18,代码来源:XWalkCordovaUiClient.java
示例8: onJavascriptModalDialog
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
@Override
public boolean onJavascriptModalDialog(XWalkView view,
JavascriptMessageType type, String url, String message,
String defaultValue, final XWalkJavascriptResult result) {
if (type == JavascriptMessageType.JAVASCRIPT_PROMPT) {
return onJsPrompt(view, url, message, defaultValue, result);
} else if (type == JavascriptMessageType.JAVASCRIPT_ALERT) {
return onJsAlert(view, url, message, result);
} else if (type == JavascriptMessageType.JAVASCRIPT_CONFIRM) {
return onJsConfirm(view, url, message, result);
} else {
return true;
}
}
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:15,代码来源:CBrowserMainFrame.java
示例9: onJsAlert
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
@Override
public boolean onJsAlert(XWalkView view, String url, String message, XWalkJavascriptResult result) {
return super.onJsAlert(view, url, message, result);
}
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:5,代码来源:CBrowserMainFrame.java
示例10: onJsConfirm
import org.xwalk.core.XWalkJavascriptResult; //导入依赖的package包/类
@Override
public boolean onJsConfirm(XWalkView view, String url, String message, XWalkJavascriptResult result) {
return super.onJsConfirm(view, url, message, result);
}
开发者ID:AppCanOpenSource,项目名称:appcan-android,代码行数:5,代码来源:CBrowserMainFrame.java
注:本文中的org.xwalk.core.XWalkJavascriptResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论