當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。