当前位置: 首页>>代码示例>>Java>>正文


Java GWT.getModuleBaseURL方法代码示例

本文整理汇总了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);
		}			
		
	};
}
 
开发者ID:Anuken,项目名称:Mindustry,代码行数:31,代码来源:HtmlLauncher.java

示例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());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:8,代码来源:FlashLocalMediaImpl.java

示例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);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:11,代码来源:SoundExecutorSwfSimple.java

示例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);
        }

    };
}
 
开发者ID:DaanVanYperen,项目名称:odb-artax,代码行数:31,代码来源:HtmlLauncher.java

示例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;
        }
      }
    });
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:33,代码来源:ProfilePage.java

示例6: getSwfSrc

import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
@Override
protected String getSwfSrc() {
    return GWT.getModuleBaseURL() + "wpaudioplayer/wpaudioplayer.swf";
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:5,代码来源:FlashLocalAudioImpl.java

示例7: getSwfSrc

import com.google.gwt.core.client.GWT; //导入方法依赖的package包/类
@Override
protected String getSwfSrc() {
    return GWT.getModuleBaseURL() + "flvplayer/flvplayer.swf";
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:5,代码来源:FlashLocalVideoImpl.java

示例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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:7,代码来源:StorageUtil.java

示例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());
    }
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:46,代码来源:GalleryPage.java


注:本文中的com.google.gwt.core.client.GWT.getModuleBaseURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。