本文整理了Java中com.google.gwt.core.client.GWT.getModuleBaseURL()
方法的一些代码示例,展示了GWT.getModuleBaseURL()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GWT.getModuleBaseURL()
方法的具体详情如下:
包路径:com.google.gwt.core.client.GWT
类名称:GWT
方法名:getModuleBaseURL
[英]Gets the URL prefix that should be prepended to URLs that are intended to be module-relative, such as RPC entry points.
If the URL points to an output file of the GWT compiler (such as a file in the public path), use #getModuleBaseForStaticFiles()instead.
[中]获取URL前缀,该前缀应放在与模块相关的URL(如RPC入口点)前面。
如果URL指向GWT编译器的输出文件(例如公共路径中的文件),请改用#getModuleBaseForStaticFiles()。
代码示例来源:origin: kaaproject/kaa
/**
* Export CTL schema.
*
* @param key the CTL export key
*/
public static void exportCtlSchema(String key) {
String getUrl = composeUrl(KAA_CTL_EXPORT_SERVLET_PATH, CTL_EXPORT_KEY_PARAMETER
+ "=" + URL.encodeQueryString(key));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
/**
* Download the SDK.
*
* @param key the SDK key
*/
public static void downloadSdk(String key) {
String getUrl = composeUrl(KAA_SDK_SERVLET_PATH,
SDK_KEY_PARAMETER + "=" + URL.encodeQueryString(key));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
/**
* Download record library.
*
* @param key the record library key
*/
public static void downloadRecordLibrary(String key) {
String getUrl = composeUrl(KAA_RECORD_LIBRARY_SERVLET_PATH, RECORD_KEY_PARAMETER
+ "=" + URL.encodeQueryString(key));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
/**
* Download endpoint configuration.
*
* @param endpointKeyHash the endpoint key hash
*/
public static void downloadEndpointConfiguration(String endpointKeyHash) {
String getUrl = composeUrl(EP_CONF_SERVLET_PATH,
ENDPOINT_KEY_PARAMETER + "=" + URL.encodeQueryString(endpointKeyHash));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
/**
* Download endpoint profile.
*
* @param endpointKey the endpoint key
* @param type the type of an endpoint
*/
public static void downloadEndpointProfile(String endpointKey, ProfileType type) {
String getUrl = composeUrl(KAA_PROFILE_DOWNLOAD_SERVLET_PATH,
ENDPOINT_KEY_PARAMETER + "=" + URL.encodeQueryString(endpointKey),
PROFILE_TYPE_PARAMETER + "=" + URL.encodeQueryString(type.name()));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
/**
* Sign out.
*/
public static void signOut() {
RequestBuilder builder = new RequestBuilder(
RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_logout");
try {
builder.sendRequest(null, new RequestCallback() {
@Override
public void onResponseReceived(Request request,
Response response) {
redirectToModule("..");
}
@Override
public void onError(Request request, Throwable exception) {
redirectToModule("..");
}
});
} catch (RequestException ex) {
GWT.log("Exception: " + ex.getMessage());
}
}
代码示例来源:origin: kaaproject/kaa
/**
* Download user configuration.
*
* @param externalUId the external user identifier
* @param schemaVersion the configuration schema version
* @param appId the application identifier
*/
public static void downloadUserConfiguration(String externalUId, String schemaVersion,
String appId) {
String getUrl = composeUrl(KAA_USER_CONFIGURATION_SERVLET_PATH,
APPLICATION_ID_PARAMETER + "=" + URL.encodeQueryString(appId),
USER_EXTERNAL_ID_PARAMETER + "=" + URL.encodeQueryString(externalUId),
CONFIGURATION_SCHEMA_ID + "=" + URL.encodeQueryString(schemaVersion));
String url = GWT.getModuleBaseURL() + getUrl;
Window.open(url, "_self", "enabled");
}
代码示例来源:origin: kaaproject/kaa
GWT.getModuleBaseURL() + "j_spring_security_check?" + postData);
try {
builder.sendRequest(null, new RequestCallback() {
代码示例来源:origin: libgdx/libgdx
public PreloaderCallback getPreloaderCallback () {
final Panel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
logo.setStyleName("logo");
preloaderPanel.add(logo);
final Panel meterPanel = new SimplePanel();
meterPanel.setStyleName("gdx-meter");
meterPanel.addStyleName("red");
final InlineHTML meter = new InlineHTML();
final Style meterStyle = meter.getElement().getStyle();
meterStyle.setWidth(0, Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new PreloaderCallback() {
@Override
public void error (String file) {
System.out.println("error: " + file);
}
@Override
public void update (PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
}
};
}
代码示例来源:origin: libgdx/libgdx
public PreloaderCallback getPreloaderCallback () {
final Panel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
logo.setStyleName("logo");
preloaderPanel.add(logo);
final Panel meterPanel = new SimplePanel();
meterPanel.setStyleName("gdx-meter");
meterPanel.addStyleName("red");
final InlineHTML meter = new InlineHTML();
final Style meterStyle = meter.getElement().getStyle();
meterStyle.setWidth(0, Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new PreloaderCallback() {
@Override
public void error (String file) {
System.out.println("error: " + file);
}
@Override
public void update (PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
}
};
}
代码示例来源:origin: kaaproject/kaa
/**
* Instantiates a new FileUploadForm.
*/
public FileUploadForm() {
this.setEncoding(FormPanel.ENCODING_MULTIPART);
this.setMethod(FormPanel.METHOD_POST);
fu.setName(Guid.get());
fu.setHeight("30px");
this.add(fu);
addSubmitHandler(new FormPanel.SubmitHandler() {
public void onSubmit(SubmitEvent event) {
if ("".equalsIgnoreCase(fu.getFilename())) {
event.cancel();
}
}
});
this.setAction(GWT.getModuleBaseURL() + KAA_FILE_UPLOAD_SERVLET_PATH);
}
代码示例来源:origin: libgdx/libgdx
} else {
SoundManager.init(GWT.getModuleBaseURL(), 9, config.preferFlash, new SoundManager.SoundManagerCallback() {
代码示例来源:origin: libgdx/libgdx
} else {
SoundManager.init(GWT.getModuleBaseURL(), 9, config.preferFlash, new SoundManager.SoundManagerCallback() {
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* The URL to retrieve a fragment of code from. NOTE: this function is not
* stable. It tweaks the URL with each call so that browsers are not tempted
* to cache a download failure.
*/
private String getUrl(int fragment) {
return GWT.getModuleBaseURL() + getDeferredJavaScriptDirectory()
+ GWT.getPermutationStrongName() + "/" + fragment + ".cache.js?serial="
+ getSerial(fragment);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Called by {@link #finish()} prior to returning the RequestBuilder to the
* caller.
* <p>
* The default implementation sets the {@value #STRONG_NAME_HEADER} header to
* the value returned by {@link GWT#getPermutationStrongName()}.
*
* @param rb The RequestBuilder that is currently being configured
*/
protected void doFinish(RequestBuilder rb) {
rb.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName());
rb.setHeader(MODULE_BASE_HEADER, GWT.getModuleBaseURL());
}
代码示例来源:origin: org.dashbuilder/dashbuilder-common-client
/**
* <p>Returns the upload URL for a given file provided by a servlet method.</p>
* @param path The path of the file.
*/
public String getUploadFileUrl(String path) {
final StringBuilder sb = new StringBuilder(GWT.getModuleBaseURL() + UPLOAD_SERVLET_URL);
sb.append("?").append("path").append("=").append(URL.encode(path));
return sb.toString();
}
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-library-client
String getBaseURL() {
final String url = GWT.getModuleBaseURL();
final String baseUrl = url.replace(GWT.getModuleName() + "/",
"");
return baseUrl;
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
public static MessagesRpcServiceAsync getInstance(String uri) {
MessagesRpcServiceAsync result = GWT.create(MessagesRpcService.class);
((ServiceDefTarget) result).setServiceEntryPoint(GWT.getModuleBaseURL() + uri);
return result;
}
}
代码示例来源:origin: org.uberfire/uberfire-widgets-core-client
@Override
public void execute() {
form.setAction(GWT.getModuleBaseURL() + "defaulteditor/upload" + createParametersForURL());
if (isValid()) {
form.submit();
}
}
},
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
/**
* Inject public resource css file as a file.
* @param filename inject file name
*/
public static void injectResourceCssAsFile(String filename) {
LinkElement link = Document.get().createLinkElement();
link.setType("text/css");
link.setRel("stylesheet");
link.setHref(GWT.getModuleBaseURL() + "css/" + filename);
getHead().appendChild(link);
}
内容来源于网络,如有侵权,请联系作者删除!