本文整理匯總了Java中com.google.gwt.core.client.GWT.getModuleBaseURL方法的典型用法代碼示例。如果您正苦於以下問題:Java GWT.getModuleBaseURL方法的具體用法?Java GWT.getModuleBaseURL怎麽用?Java GWT.getModuleBaseURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.core.client.GWT
的用法示例。
在下文中一共展示了GWT.getModuleBaseURL方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPreloaderCallback
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
@Override
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);
}
};
}
示例2: onLoad
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
@Override
public void onLoad() {
String swfSrc = getSwfSrc();
String installSrc = GWT.getModuleBaseURL() + "swfobject/expressInstall.swf";
String srcNormalized = PathUtil.normalizePath(src);
loadFlvPlayerThroughSwfobject(elementId, swfSrc, installSrc, srcNormalized, getWidth(), getHeight());
}
示例3: playFromSource
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
private void playFromSource(String src) {
panelMain.clear();
FlowPanel panelEmbed = new FlowPanel();
String htmlId = Document.get().createUniqueId();
panelEmbed.getElement().setId(htmlId);
panelMain.add(panelEmbed);
String installSrc = GWT.getModuleBaseURL() + "swfobject/expressInstall.swf";
String swfSrc = GWT.getModuleBaseURL() + "flashAudioExecutorSimple/flashAudioExecutorSimple.swf";
embedSwf(htmlId, swfSrc, installSrc, src);
}
示例4: getPreloaderCallback
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
@Override
public Preloader.PreloaderCallback getPreloaderCallback() {
final VerticalPanel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
preloaderPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.gif");
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, Style.Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new Preloader.PreloaderCallback() {
@Override
public void error(String file) {
System.out.println("error: " + file);
}
@Override
public void update(Preloader.PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Style.Unit.PCT);
}
};
}
示例5: uploadImage
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
/**
* Main method to validify and upload the app image
*/
private void uploadImage() {
String uploadFilename = imageUpload.getFilename();
if (!uploadFilename.isEmpty()) {
String filename = makeValidFilename(uploadFilename);
// Forge the request URL for gallery servlet
String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
"/user/" + userId + "/" + filename;
Uploader.getInstance().upload(imageUpload, uploadUrl,
new OdeAsyncCallback<UploadResponse>(MESSAGES.fileUploadError()) {
@Override
public void onSuccess(UploadResponse uploadResponse) {
switch (uploadResponse.getStatus()) {
case SUCCESS:
ErrorReporter.hide();
imageUploadBoxInner.clear();
updateUserImage(gallery.getUserImageURL(userId), imageUploadBoxInner);
break;
case FILE_TOO_LARGE:
// The user can resolve the problem by uploading a smaller file.
ErrorReporter.reportInfo(MESSAGES.fileTooLargeError());
break;
default:
ErrorReporter.reportError(MESSAGES.fileUploadError());
break;
}
}
});
}
}
示例6: getSwfSrc
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
@Override
protected String getSwfSrc() {
return GWT.getModuleBaseURL() + "wpaudioplayer/wpaudioplayer.swf";
}
示例7: getSwfSrc
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
@Override
protected String getSwfSrc() {
return GWT.getModuleBaseURL() + "flvplayer/flvplayer.swf";
}
示例8: getFileUrl
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
/**
* Returns the URL for the given project file.
*/
public static String getFileUrl(long projectId, String fileId) {
return GWT.getModuleBaseURL() + getFilePath(projectId, fileId);
}
示例9: uploadImage
import com.google.gwt.core.client.GWT; //導入方法依賴的package包/類
/**
* Main method to validify and upload the app image
*/
private void uploadImage() {
String uploadFilename = upload.getFilename();
if (!uploadFilename.isEmpty()) {
// Grab and validify the filename
final String filename = makeValidFilename(uploadFilename);
// Forge the request URL for gallery servlet
// we used to send the gallery id to the servlet, now the project id as
// the servlet just stores image temporarily before publish
/* String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
"/apps/" + String.valueOf(app.getGalleryAppId()) + "/"+ filename; */
// send the project id as the id, to store image temporarily until published
String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
"/apps/" + String.valueOf(app.getProjectId()) + "/"+ filename;
Uploader.getInstance().upload(upload, uploadUrl,
new OdeAsyncCallback<UploadResponse>(MESSAGES.fileUploadError()) {
@Override
public void onSuccess(UploadResponse uploadResponse) {
switch (uploadResponse.getStatus()) {
case SUCCESS:
// Update the app image preview after a success upload
imageUploadBoxInner.clear();
// updateAppImage(app.getCloudImageURL(), imageUploadBoxInner);
updateAppImage(gallery.getProjectImageURL(app.getProjectId()),imageUploadBoxInner);
imageUploaded=true;
ErrorReporter.hide();
break;
case FILE_TOO_LARGE:
// The user can resolve the problem by uploading a smaller file.
ErrorReporter.reportInfo(MESSAGES.fileTooLargeError());
break;
default:
ErrorReporter.reportError(MESSAGES.fileUploadError());
break;
}
}
});
} else {
if (editStatus == NEWAPP) {
Window.alert(MESSAGES.noFileSelected());
}
}
}